‪TYPO3CMS  ‪main
AvailableTcaTables.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 
23 
28 {
32  public function ‪populateTables(array &$fieldDefinition): void
33  {
34  $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
35 
36  foreach (‪$GLOBALS['TCA'] as $tableName => $tableConfiguration) {
37  if ($tableConfiguration['ctrl']['adminOnly'] ?? false) {
38  // Hide "admin only" tables
39  continue;
40  }
41  $label = ($tableConfiguration['ctrl']['title'] ?? '') ?: '';
42  $icon = $iconFactory->mapRecordTypeToIconIdentifier($tableName, []);
43  $fieldDefinition['items'][] = [$label, $tableName, $icon];
44  }
45  }
46 
48  {
49  return ‪$GLOBALS['LANG'];
50  }
51 }
‪TYPO3\CMS\IndexedSearch\Hook\AvailableTcaTables
Definition: AvailableTcaTables.php:28
‪TYPO3\CMS\Core\Imaging\IconFactory
Definition: IconFactory.php:34
‪TYPO3\CMS\IndexedSearch\Hook\AvailableTcaTables\populateTables
‪populateTables(array &$fieldDefinition)
Definition: AvailableTcaTables.php:32
‪TYPO3\CMS\IndexedSearch\Hook\AvailableTcaTables\getLanguageService
‪getLanguageService()
Definition: AvailableTcaTables.php:47
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:46
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\IndexedSearch\Hook
Definition: AvailableTcaTables.php:18