‪TYPO3CMS  ‪main
BackendModuleProvider.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 
22 
24 {
25  public function ‪__construct(protected readonly ‪ModuleProvider $provider) {}
26 
27  public function ‪getConfiguration(): array
28  {
29  $configurationArray = [];
30  foreach ($this->provider->getModules(respectWorkspaceRestrictions: false, grouped: false) as ‪$identifier => $module) {
31  $configurationArray[‪$identifier] = [
32  'identifier' => $module->getIdentifier(),
33  'parentIdentifier' => $module->getParentIdentifier(),
34  'iconIdentifier' => $module->getIconIdentifier(),
35  'title' => $module->getTitle(),
36  'description' => $module->getDescription(),
37  'shortDescription' => $module->getShortDescription(),
38  'access' => $module->getAccess(),
39  'aliases' => $module->getAliases(),
40  'position' => $module->getPosition(),
41  'workspaces' => $module->getWorkspaceAccess() ?: $module->getParentModule()?->getWorkspaceAccess(),
42  'isStandalone' => $module->isStandalone() ? 'true' : 'false',
43  'submodules' => $module->hasSubModules() ? implode(',', array_keys($module->getSubModules())) : '',
44  'path' => $module->getPath(),
45  ];
46  }
47  ArrayUtility::naturalKeySortRecursive($configurationArray);
48  return $configurationArray;
49  }
50 }
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\AbstractProvider\$identifier
‪string $identifier
Definition: AbstractProvider.php:28
‪TYPO3\CMS\Backend\Module\ModuleProvider
Definition: ModuleProvider.php:29
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\BackendModuleProvider\__construct
‪__construct(protected readonly ModuleProvider $provider)
Definition: BackendModuleProvider.php:25
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\AbstractProvider
Definition: AbstractProvider.php:27
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\BackendModuleProvider\getConfiguration
‪getConfiguration()
Definition: BackendModuleProvider.php:27
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\BackendModuleProvider
Definition: BackendModuleProvider.php:24
‪TYPO3\CMS\Lowlevel\ConfigurationModuleProvider
Definition: AbstractProvider.php:18
‪TYPO3\CMS\Core\Utility\ArrayUtility
Definition: ArrayUtility.php:26