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

57 lines
2.2 KiB
PHP
Raw Permalink Normal View History

<?php
2024-02-08 08:04:56 +01:00
declare(strict_types=1);
use DanielSiepmann\DsSite\Backend\PreviewRenderer\Video;
2024-02-08 08:04:56 +01:00
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
2024-02-08 08:04:56 +01:00
(static function (string $extensionKey, string $tableName, string $contentType) {
$languagePath = 'LLL:EXT:' . $extensionKey . '/Resources/Private/Language/locallang_tca.xlf:' . $tableName . '.';
2024-02-08 08:04:56 +01:00
ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA'][$tableName], [
'ctrl' => [
'typeicon_classes' => [
$contentType => 'content-media',
],
],
'types' => [
$contentType => [
'showitem' => implode(',', [
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general',
'--palette--;;general',
2020-08-19 23:14:32 +02:00
'--palette--;;headers',
'media',
'--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',
]),
'previewRenderer' => Video::class,
],
],
]);
2024-02-08 08:04:56 +01:00
ExtensionManagementUtility::addTcaSelectItem(
$tableName,
'CType',
[
2024-02-08 08:04:56 +01:00
'label' => $languagePath . $contentType,
'value' => $contentType,
'icon' => 'content-media',
'group' => 'default',
],
'image',
'after'
);
})('ds_site', 'tt_content', 'video');