thuecat/Configuration/TCA/Overrides/tt_content_tourist_attraction.php
Daniel Siepmann 92c8bbedaa Add multi language handling
Import entities in all available languages.
Provide translated records in frontend.
2021-02-17 14:51:00 +01:00

68 lines
2.8 KiB
PHP

<?php
defined('TYPO3') or die();
(static function (string $extensionKey, string $tableName, string $cType) {
$languagePath = \WerkraumMedia\ThueCat\Extension::getLanguagePath()
. 'locallang_tca.xlf:' . $tableName . '.' . $cType;
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA'][$tableName], [
'ctrl' => [
// TODO: Add Icon
// 'typeicon_classes' => [
// $cType => '',
// ],
],
'types' => [
$cType => [
'showitem' =>
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,'
. '--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',
'suggestOptions' => [
'tx_thuecat_tourist_attraction' => [
'addWhere' => 'sys_language_uid in (0,-1)',
],
],
],
],
],
],
],
]);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
$tableName,
'CType',
[
$languagePath,
$cType,
// TODO: Add Icon
'',
\WerkraumMedia\ThueCat\Extension::TT_CONTENT_GROUP,
]
);
})(
\WerkraumMedia\ThueCat\Extension::EXTENSION_KEY,
'tt_content',
'thuecat_tourist_attraction'
);