‪TYPO3CMS  10.4
UserIntInformation.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Psr\Http\Message\ServerRequestInterface;
27 
34 {
38  public function ‪getIdentifier(): string
39  {
40  return 'info_userint';
41  }
42 
46  public function ‪getLabel(): string
47  {
48  return $this->‪getLanguageService()->‪sL(
49  'LLL:EXT:adminpanel/Resources/Private/Language/locallang_info.xlf:sub.userint.label'
50  );
51  }
52 
56  public function ‪getDataToStore(ServerRequestInterface $request): ‪ModuleData
57  {
58  return new ‪ModuleData(
59  [
60  'userIntInfo' => $this->‪getUserIntInfo()
61  ]
62  );
63  }
64 
68  public function ‪getContent(‪ModuleData $data): string
69  {
70  $view = GeneralUtility::makeInstance(StandaloneView::class);
71  $templateNameAndPath = 'EXT:adminpanel/Resources/Private/Templates/Modules/Info/UserInt.html';
72  $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($templateNameAndPath));
73  $view->setPartialRootPaths(['EXT:adminpanel/Resources/Private/Partials']);
74 
75  $view->assignMultiple($data->getArrayCopy());
76  $view->assign('languageKey', $this->‪getBackendUser()->user['lang']);
77 
78  return $view->render();
79  }
80 
84  protected function ‪getUserIntInfo(): array
85  {
86  $userIntInfo = [];
87  $intScripts = ‪$GLOBALS['TSFE']->config['INTincScript'] ?? [];
88 
89  foreach ($intScripts as $intScriptName => $intScriptConf) {
90  $info = isset($intScriptConf['type']) ? ['TYPE' => $intScriptConf['type']] : [];
91  foreach ($intScriptConf['conf'] as $key => $conf) {
92  if (is_array($conf)) {
93  $conf = ‪ArrayUtility::flatten($conf);
94  }
95  $info[$key] = $conf;
96  }
97  $userIntInfo[$intScriptName] = $info;
98  }
99 
100  return $userIntInfo;
101  }
102 }
‪TYPO3\CMS\Core\Utility\ArrayUtility\flatten
‪static array flatten(array $array, $prefix='', bool $keepDots=false)
Definition: ArrayUtility.php:486
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractSubModule\getLanguageService
‪LanguageService getLanguageService()
Definition: AbstractSubModule.php:35
‪TYPO3\CMS\Adminpanel\ModuleApi\DataProviderInterface
Definition: DataProviderInterface.php:30
‪TYPO3\CMS\Adminpanel\Modules\Info\UserIntInformation\getLabel
‪getLabel()
Definition: UserIntInformation.php:46
‪TYPO3\CMS\Adminpanel\Modules\Info\UserIntInformation\getContent
‪getContent(ModuleData $data)
Definition: UserIntInformation.php:68
‪TYPO3\CMS\Core\Localization\LanguageService\sL
‪string sL($input)
Definition: LanguageService.php:194
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractSubModule\getBackendUser
‪getBackendUser()
Definition: AbstractSubModule.php:40
‪TYPO3\CMS\Adminpanel\Modules\Info\UserIntInformation
Definition: UserIntInformation.php:34
‪TYPO3\CMS\Adminpanel\Modules\Info\UserIntInformation\getIdentifier
‪getIdentifier()
Definition: UserIntInformation.php:38
‪TYPO3\CMS\Adminpanel\Modules\Info
Definition: GeneralInformation.php:18
‪TYPO3\CMS\Adminpanel\Modules\Info\UserIntInformation\getDataToStore
‪getDataToStore(ServerRequestInterface $request)
Definition: UserIntInformation.php:56
‪TYPO3\CMS\Adminpanel\Modules\Info\UserIntInformation\getUserIntInfo
‪array getUserIntInfo()
Definition: UserIntInformation.php:84
‪TYPO3\CMS\Fluid\View\StandaloneView
Definition: StandaloneView.php:34
‪TYPO3\CMS\Core\Utility\ArrayUtility
Definition: ArrayUtility.php:24
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Adminpanel\ModuleApi\ModuleData
Definition: ModuleData.php:27
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractSubModule
Definition: AbstractSubModule.php:29