mirror of
https://github.com/SkillDisplay/TYPO3ContentElements.git
synced 2024-12-22 14:26:09 +01:00
Daniel Siepmann
da3aed135c
Allow editors to add new content element "skills". The element contains an input for a comma separated list of skill IDs. A preview in backend is shown. Frontend rendering is provided.
46 lines
2 KiB
PHP
46 lines
2 KiB
PHP
<?php
|
|
|
|
(function (string $extensionKey, string $tableName, string $contentType) {
|
|
$languagePath = 'LLL:EXT:' . $extensionKey . '/Resources/Private/Language/locallang_tca.xlf:' . $tableName . '.';
|
|
|
|
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA'][$tableName], [
|
|
'ctrl' => [
|
|
'typeicon_classes' => [
|
|
$contentType => 'skilldisplay-skill',
|
|
],
|
|
],
|
|
'types' => [
|
|
$contentType => [
|
|
'showitem' => implode(',', [
|
|
'--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general',
|
|
'--palette--;;general',
|
|
'skilldisplay_skills',
|
|
'--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',
|
|
]),
|
|
],
|
|
],
|
|
]);
|
|
|
|
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
|
|
$tableName,
|
|
'CType',
|
|
[
|
|
$languagePath . $contentType,
|
|
$contentType,
|
|
'skilldisplay-skill',
|
|
'skilldisplay'
|
|
]
|
|
);
|
|
})('skilldisplay', 'tt_content', 'skilldisplay_skills');
|