watchlist/Configuration/TCA/Overrides/tt_content.php
Daniel Siepmann 521920542a Fix broken TCA registration of plugin
We broke the registerPlugin() call by using lower cased version (the
extension key) instead of an UpperCamelCase version (the ExtensionName),
as opposed to the configurePlugin() call.
Both calls have to be in sync.

This is now adjusted and removes the need for a workaround to call
addTcaSelectItem().
2024-02-20 14:50:26 +01:00

53 lines
2.2 KiB
PHP

<?php
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
defined('TYPO3') || die();
(static function (string $extKey, string $table, string $contentType) {
$languagePath = implode(':', [
'LLL',
'EXT',
$extKey . '/Resources/Private/Language/locallang.xlf',
$table . '.' . $contentType . '.',
]);
ExtensionUtility::registerPlugin(
'Watchlist',
'Watchlist',
$languagePath . 'title',
'EXT:' . $extKey . '/Resources/Public/Icons/Extension.svg'
);
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA'][$table], [
'ctrl' => [
'typeicon_classes' => [
$contentType => 'content-bullets',
],
],
'types' => [
$contentType => [
'showitem' => implode(',', [
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general',
'--palette--;;general',
'--palette--;;headers',
'--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',
]),
],
],
]);
})('watchlist', 'tt_content', 'watchlist_watchlist');