‪TYPO3CMS  9.5
tt_content.php
Go to the documentation of this file.
1 <?php
2 defined('TYPO3_MODE') or die();
3 
4 call_user_func(function () {
5  // Add the FlexForm
7  '*',
8  'FILE:EXT:felogin/Configuration/FlexForms/Login.xml',
9  'login'
10  );
11 
12  ‪$GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['login'] = 'mimetypes-x-content-login';
13 
14  // check if there is already a forms tab and add the item after that, otherwise
15  // add the tab item as well
16  $additionalCTypeItem = [
17  'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:CType.I.10',
18  'login',
19  'content-elements-login'
20  ];
21 
22  $existingCTypeItems = ‪$GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'];
23  $groupFound = false;
24  $groupPosition = false;
25  foreach ($existingCTypeItems as $position => $item) {
26  if ($item[0] === 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:CType.div.forms') {
27  $groupFound = true;
28  $groupPosition = $position;
29  break;
30  }
31  }
32 
33  if ($groupFound && $groupPosition) {
34  // add the new CType item below CType
35  array_splice(‪$GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'], $groupPosition, 0, [0 => $additionalCTypeItem]);
36  } else {
37  // nothing found, add two items (group + new CType) at the bottom of the list
39  'tt_content',
40  'CType',
41  ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:CType.div.forms', '--div--']
42  );
43  ‪\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType', $additionalCTypeItem);
44  }
45 
46  ‪$GLOBALS['TCA']['tt_content']['types']['login']['showitem'] = '
47  --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
48  --palette--;;general,
49  --palette--;;headers,
50  pi_flexform,
51  --div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance,
52  --palette--;;frames,
53  --palette--;;appearanceLinks,
54  --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
55  --palette--;;language,
56  --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
57  --palette--;;hidden,
58  --palette--;;access,
59  --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories,
60  categories,
61  --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes,
62  rowDescription,
63  --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended,
64  ';
65 });
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addTcaSelectItem
‪static addTcaSelectItem($table, $field, array $item, $relativeToField='', $relativePosition='')
Definition: ExtensionManagementUtility.php:503
‪TYPO3\CMS\Core\Utility\ExtensionManagementUtility\addPiFlexFormValue
‪static addPiFlexFormValue($piKeyToMatch, $value, $CTypeToMatch='list')
Definition: ExtensionManagementUtility.php:1273
‪$GLOBALS
‪$GLOBALS['TCA']['tt_content']['ctrl']['hideAtCopy']
Definition: tt_content.php:4