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