2021-02-03 17:20:01 +01:00
|
|
|
<?php
|
|
|
|
|
2023-11-30 13:52:23 +01:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
use TYPO3\CMS\Core\Utility\ArrayUtility;
|
|
|
|
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
|
|
|
|
use WerkraumMedia\ThueCat\Extension;
|
|
|
|
|
2021-02-03 17:20:01 +01:00
|
|
|
defined('TYPO3') or die();
|
|
|
|
|
|
|
|
(static function (string $extensionKey, string $tableName, string $cType) {
|
2023-11-30 13:52:23 +01:00
|
|
|
$languagePath = Extension::getLanguagePath()
|
2021-02-03 17:20:01 +01:00
|
|
|
. 'locallang_tca.xlf:' . $tableName . '.' . $cType;
|
|
|
|
|
2023-11-30 13:52:23 +01:00
|
|
|
ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA'][$tableName], [
|
2021-02-03 17:20:01 +01:00
|
|
|
'ctrl' => [
|
2021-02-18 08:49:27 +01:00
|
|
|
'typeicon_classes' => [
|
2022-12-13 15:02:25 +01:00
|
|
|
$cType => 'tt_content_' . $cType,
|
2021-02-18 08:49:27 +01:00
|
|
|
],
|
2021-02-03 17:20:01 +01:00
|
|
|
],
|
|
|
|
'types' => [
|
|
|
|
$cType => [
|
2021-02-18 14:54:00 +01:00
|
|
|
'showitem' => '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,'
|
2021-02-03 17:20:01 +01:00
|
|
|
. '--palette--;;general,'
|
|
|
|
. '--palette--;;headers,'
|
|
|
|
. 'records,'
|
|
|
|
. '--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance,'
|
|
|
|
. '--palette--;;frames,'
|
|
|
|
. '--palette--;;appearanceLinks,'
|
|
|
|
. '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,'
|
|
|
|
. '--palette--;;language,'
|
|
|
|
. '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,'
|
|
|
|
. '--palette--;;hidden,'
|
|
|
|
. '--palette--;;access,'
|
|
|
|
. '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories,'
|
|
|
|
. '--div--;LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_category.tabs.category,'
|
|
|
|
. 'categories,'
|
|
|
|
. '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes,'
|
|
|
|
. 'rowDescription,'
|
|
|
|
. '--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended',
|
|
|
|
'columnsOverrides' => [
|
|
|
|
'records' => [
|
|
|
|
'config' => [
|
|
|
|
'allowed' => 'tx_thuecat_tourist_attraction',
|
2021-02-16 17:12:47 +01:00
|
|
|
'suggestOptions' => [
|
|
|
|
'tx_thuecat_tourist_attraction' => [
|
|
|
|
'addWhere' => 'sys_language_uid in (0,-1)',
|
|
|
|
],
|
|
|
|
],
|
2021-02-03 17:20:01 +01:00
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
]);
|
|
|
|
|
2023-11-30 13:52:23 +01:00
|
|
|
ExtensionManagementUtility::addTcaSelectItem(
|
2021-02-03 17:20:01 +01:00
|
|
|
$tableName,
|
|
|
|
'CType',
|
|
|
|
[
|
2023-11-30 13:52:23 +01:00
|
|
|
'label' => $languagePath,
|
|
|
|
'value' => $cType,
|
|
|
|
'icon' => Extension::getIconPath() . 'tt_content_' . $cType . '.svg',
|
|
|
|
'group' => Extension::TCA_SELECT_GROUP_IDENTIFIER,
|
2021-02-03 17:20:01 +01:00
|
|
|
]
|
|
|
|
);
|
|
|
|
})(
|
2023-11-30 13:52:23 +01:00
|
|
|
Extension::EXTENSION_KEY,
|
2021-02-03 17:20:01 +01:00
|
|
|
'tt_content',
|
|
|
|
'thuecat_tourist_attraction'
|
|
|
|
);
|