‪TYPO3CMS  ‪main
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 {
35  public function ‪getIdentifier(): string
36  {
37  return 'info_userint';
38  }
39 
40  public function ‪getLabel(): string
41  {
42  return $this->‪getLanguageService()->sL(
43  'LLL:EXT:adminpanel/Resources/Private/Language/locallang_info.xlf:sub.userint.label'
44  );
45  }
46 
47  public function ‪getDataToStore(ServerRequestInterface $request): ‪ModuleData
48  {
49  return new ‪ModuleData(
50  [
51  'userIntInfo' => $this->‪getUserIntInfo(),
52  ]
53  );
54  }
55 
56  public function ‪getContent(‪ModuleData $data): string
57  {
58  $view = GeneralUtility::makeInstance(StandaloneView::class);
59  $templateNameAndPath = 'EXT:adminpanel/Resources/Private/Templates/Modules/Info/UserInt.html';
60  $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($templateNameAndPath));
61  $view->setPartialRootPaths(['EXT:adminpanel/Resources/Private/Partials']);
62 
63  $view->assignMultiple($data->getArrayCopy());
64  $view->assign('languageKey', $this->‪getBackendUser()->user['lang'] ?? null);
65 
66  return $view->render();
67  }
68 
69  protected function ‪getUserIntInfo(): array
70  {
71  $userIntInfo = [];
72  $intScripts = ‪$GLOBALS['TSFE']->config['INTincScript'] ?? [];
73 
74  foreach ($intScripts as $intScriptName => $intScriptConf) {
75  $info = isset($intScriptConf['type']) ? ['TYPE' => $intScriptConf['type']] : [];
76  foreach (($intScriptConf['conf'] ?? []) as $key => $conf) {
77  if (is_array($conf)) {
78  $conf = ‪ArrayUtility::flatten($conf);
79  }
80  $info[$key] = $conf;
81  }
82  $userIntInfo[$intScriptName] = $info;
83  }
84 
85  return $userIntInfo;
86  }
87 }
‪TYPO3\CMS\Adminpanel\ModuleApi\DataProviderInterface
Definition: DataProviderInterface.php:30
‪TYPO3\CMS\Adminpanel\Modules\Info\UserIntInformation\getLabel
‪getLabel()
Definition: UserIntInformation.php:40
‪TYPO3\CMS\Adminpanel\Modules\Info\UserIntInformation\getContent
‪getContent(ModuleData $data)
Definition: UserIntInformation.php:56
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractSubModule\getBackendUser
‪getBackendUser()
Definition: AbstractSubModule.php:35
‪TYPO3\CMS\Core\Utility\ArrayUtility\flatten
‪static flatten(array $array, string $prefix='', bool $keepDots=false)
Definition: ArrayUtility.php:469
‪TYPO3\CMS\Adminpanel\Modules\Info\UserIntInformation
Definition: UserIntInformation.php:34
‪TYPO3\CMS\Adminpanel\Modules\Info\UserIntInformation\getIdentifier
‪getIdentifier()
Definition: UserIntInformation.php:35
‪TYPO3\CMS\Adminpanel\Modules\Info
Definition: GeneralInformation.php:18
‪TYPO3\CMS\Adminpanel\Modules\Info\UserIntInformation\getDataToStore
‪getDataToStore(ServerRequestInterface $request)
Definition: UserIntInformation.php:47
‪TYPO3\CMS\Adminpanel\Modules\Info\UserIntInformation\getUserIntInfo
‪getUserIntInfo()
Definition: UserIntInformation.php:69
‪TYPO3\CMS\Fluid\View\StandaloneView
Definition: StandaloneView.php:30
‪TYPO3\CMS\Core\Utility\ArrayUtility
Definition: ArrayUtility.php:26
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractSubModule\getLanguageService
‪getLanguageService()
Definition: AbstractSubModule.php:30
‪TYPO3\CMS\Adminpanel\ModuleApi\ModuleData
Definition: ModuleData.php:26
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Adminpanel\ModuleApi\AbstractSubModule
Definition: AbstractSubModule.php:29