ds-site/Configuration/TCA/Overrides/tt_content_admonition.php

63 lines
2.4 KiB
PHP
Raw Permalink Normal View History

2019-12-13 15:17:30 +01:00
<?php
2024-02-08 08:04:56 +01:00
declare(strict_types=1);
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
(static function (string $extensionKey, string $tableName, string $contentType) {
2019-12-13 15:17:30 +01:00
$languagePath = 'LLL:EXT:' . $extensionKey . '/Resources/Private/Language/locallang_tca.xlf:' . $tableName . '.';
2024-02-08 08:04:56 +01:00
ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA'][$tableName], [
2019-12-13 15:17:30 +01:00
'ctrl' => [
'typeicon_classes' => [
$contentType => 'content-idea',
],
],
'types' => [
$contentType => [
'showitem' => implode(',', [
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general',
'--palette--;;general',
'header_layout',
'bodytext',
'--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',
'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' => [
'bodytext' => [
'config' => [
'enableRichtext' => true,
'richtextConfiguration' => 'default',
],
],
],
],
],
]);
2024-02-08 08:04:56 +01:00
ExtensionManagementUtility::addTcaSelectItem(
2019-12-13 15:17:30 +01:00
$tableName,
'CType',
[
2024-02-08 08:04:56 +01:00
'label' => $languagePath . $contentType,
'value' => $contentType,
'icon' => 'content-idea',
'group' => 'default',
2019-12-13 15:17:30 +01:00
],
'image',
'after'
);
})('ds_site', 'tt_content', 'admonition');