mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-10 01:16:12 +01:00

[TASK] Use anonymous function in TCA overrides (#829)

Resolves: #827
This commit is contained in:
Łukasz Uznański 2023-05-03 12:56:50 +02:00 committed by GitHub
parent 44ce11bde2
commit b06eb38f9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,8 +2,10 @@
defined('TYPO3') || die();
// This makes the plugin selectable in the BE.
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
call_user_func(
static function (): void {
// This makes the plugin selectable in the BE.
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
// extension name, matching the PHP namespaces (but without the vendor)
'Tea',
// arbitrary, but unique plugin name (not visible in the BE)
@ -12,16 +14,18 @@ defined('TYPO3') || die();
'LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea_index',
// the icon visible in the drop-down in the BE
'EXT:tea/Resources/Public/Icons/Extension.svg'
);
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'Tea',
'TeaShow',
'LLL:EXT:tea/Resources/Private/Language/locallang.xlf:plugin.tea_show',
'EXT:tea/Resources/Public/Icons/Extension.svg'
);
);
// This removes the default controls from the plugin.
$controlsToRemove = 'recursive,select_key,pages';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['tea_teaindex'] = $controlsToRemove;
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['tea_teashow'] = $controlsToRemove;
// This removes the default controls from the plugin.
$controlsToRemove = 'recursive,select_key,pages';
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['tea_teaindex'] = $controlsToRemove;
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['tea_teashow'] = $controlsToRemove;
}
);