2021-02-18 08:49:27 +01:00
< ? php
2023-12-05 09:43:55 +01:00
declare ( strict_types = 1 );
use TYPO3\CMS\Core\Utility\ArrayUtility ;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility ;
use WerkraumMedia\ThueCat\Extension ;
2021-02-18 08:49:27 +01:00
defined ( 'TYPO3' ) or die ();
( static function ( string $extensionKey , string $tableName ) {
2023-12-05 09:43:55 +01:00
$languagePath = Extension :: getLanguagePath ()
2021-02-18 08:49:27 +01:00
. 'locallang_tca.xlf:' . $tableName ;
2023-12-05 09:43:55 +01:00
ArrayUtility :: mergeRecursiveWithOverrule ( $GLOBALS [ 'TCA' ][ $tableName ], [
2022-12-13 15:02:25 +01:00
'ctrl' => [
'typeicon_classes' => [
'contains-thuecat' => 'pages_module_thuecat' ,
],
],
2021-02-18 08:49:27 +01:00
'columns' => [
'tx_thuecat_flexform' => [
'label' => $languagePath . '.tx_thuecat_flexform' ,
'config' => [
'type' => 'flex' ,
'ds_pointerField' => 'doktype' ,
'ds' => [
'default' => '<T3DataStructure> <ROOT> <type>array</type> <el> <!-- Repeat an element like "xmlTitle" beneath for as many elements you like. Remember to name them uniquely --> <xmlTitle> <TCEforms> <label>The Title:</label> <config> <type>input</type> <size>48</size> </config> </TCEforms> </xmlTitle> </el> </ROOT> </T3DataStructure>' ,
],
],
],
],
'palettes' => [
'tx_thuecat' => [
'label' => $languagePath . 'palette.tx_thuecat' ,
'showitem' => 'tx_thuecat_flexform' ,
],
],
]);
2023-12-05 09:43:55 +01:00
ExtensionManagementUtility :: addTcaSelectItemGroup (
2021-02-18 08:49:27 +01:00
$tableName ,
'doktype' ,
2023-12-05 09:43:55 +01:00
Extension :: TCA_SELECT_GROUP_IDENTIFIER ,
2021-02-18 08:49:27 +01:00
$languagePath . '.group'
);
2022-12-13 15:02:25 +01:00
2023-12-05 09:43:55 +01:00
ExtensionManagementUtility :: addTcaSelectItem (
2022-12-13 15:02:25 +01:00
$tableName ,
'module' ,
[
2023-12-05 09:43:55 +01:00
'label' => $languagePath . '.module.thuecat' ,
'value' => 'thuecat' ,
'icon' => 'pages_module_thuecat' ,
2022-12-13 15:02:25 +01:00
]
);
2021-02-18 08:49:27 +01:00
})(
2023-12-05 09:43:55 +01:00
Extension :: EXTENSION_KEY ,
2021-02-18 08:49:27 +01:00
'pages'
);