5e1faa24e9feb4f1f2d10dcd7e45793645048ef0
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid_styled_content / Configuration / TCA / Overrides / tt_content.php
1 <?php
2 defined('TYPO3_MODE') or die();
3
4 call_user_func(function () {
5
6 $languageFilePrefix = 'LLL:EXT:fluid_styled_content/Resources/Private/Language/Database.xlf:';
7 $frontendLanguageFilePrefix = 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:';
8
9 // Add the CType "textmedia"
10 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
11 'tt_content',
12 'CType',
13 [
14 $languageFilePrefix . 'tt_content.CType.textmedia',
15 'textmedia',
16 'content-textpic'
17 ],
18 'header',
19 'after'
20 );
21 $GLOBALS['TCA']['tt_content']['columns']['CType']['config']['default'] = 'textmedia';
22
23 $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['textmedia'] = 'mimetypes-x-content-text-media';
24 $GLOBALS['TCA']['tt_content']['palettes']['mediaAdjustments'] = [
25 'showitem' => '
26 imagewidth;' . $languageFilePrefix . 'tt_content.palette.textmedia.imagewidth,
27 imageheight;' . $languageFilePrefix . 'tt_content.palette.textmedia.imageheight,
28 imageborder;' . $languageFilePrefix . 'tt_content.palette.textmedia.imageborder
29 '
30 ];
31 $GLOBALS['TCA']['tt_content']['palettes']['gallerySettings'] = [
32 'showitem' => '
33 imageorient;' . $frontendLanguageFilePrefix . 'imageorient_formlabel,
34 imagecols;' . $frontendLanguageFilePrefix . 'imagecols_formlabel
35 '
36 ];
37 $GLOBALS['TCA']['tt_content']['types']['textmedia'] = [
38 'showitem' => '
39 --palette--;' . $frontendLanguageFilePrefix . 'palette.general;general,
40 --palette--;' . $frontendLanguageFilePrefix . 'palette.header;header,rowDescription,
41 bodytext;' . $frontendLanguageFilePrefix . 'bodytext_formlabel,
42 --div--;' . $frontendLanguageFilePrefix . 'tabs.media,
43 assets,
44 --palette--;' . $frontendLanguageFilePrefix . 'palette.imagelinks;imagelinks,
45 --div--;' . $frontendLanguageFilePrefix . 'tabs.appearance,
46 layout;' . $frontendLanguageFilePrefix . 'layout_formlabel,
47 --palette--;' . $languageFilePrefix . 'tt_content.palette.mediaAdjustments;mediaAdjustments,
48 --palette--;' . $languageFilePrefix . 'tt_content.palette.gallerySettings;gallerySettings,
49 --palette--;' . $frontendLanguageFilePrefix . 'palette.appearanceLinks;appearanceLinks,
50 --div--;' . $frontendLanguageFilePrefix . 'tabs.access,
51 hidden;' . $frontendLanguageFilePrefix . 'field.default.hidden,
52 --palette--;' . $frontendLanguageFilePrefix . 'palette.access;access,
53 --div--;' . $frontendLanguageFilePrefix . 'tabs.extended
54 ',
55 'columnsOverrides' => ['bodytext' => ['defaultExtras' => 'richtext:rte_transform[mode=ts_css]']]
56 ];
57
58 // Add category tab when categories column exits
59 if (!empty($GLOBALS['TCA']['tt_content']['columns']['categories'])) {
60 $GLOBALS['TCA']['tt_content']['types']['textmedia']['showitem'] .=
61 ',--div--;LLL:EXT:lang/locallang_tca.xlf:sys_category.tabs.category,
62 categories';
63 }
64
65 // Add table wizard
66 $GLOBALS['TCA']['tt_content']['types']['table']['columnsOverrides']['bodytext']['defaultExtras'] = 'nowrap:wizards[table]';
67
68 // Add additional fields for bullets + upload CTypes
69 $additionalColumns = [
70 'bullets_type' => [
71 'exclude' => true,
72 'label' => $languageFilePrefix . 'tt_content.bullets_type',
73 'config' => [
74 'type' => 'select',
75 'renderType' => 'selectSingle',
76 'items' => [
77 [$languageFilePrefix . 'tt_content.bullets_type.0', 0],
78 [$languageFilePrefix . 'tt_content.bullets_type.1', 1],
79 [$languageFilePrefix . 'tt_content.bullets_type.2', 2]
80 ],
81 'default' => 0
82 ]
83 ],
84 'uploads_description' => [
85 'exclude' => true,
86 'label' => $languageFilePrefix . 'tt_content.uploads_description',
87 'config' => [
88 'type' => 'check',
89 'default' => 0,
90 'items' => [
91 ['LLL:EXT:lang/locallang_core.xml:labels.enabled', 1]
92 ]
93 ]
94 ],
95 'uploads_type' => [
96 'exclude' => true,
97 'label' => $languageFilePrefix . 'tt_content.uploads_type',
98 'config' => [
99 'type' => 'select',
100 'renderType' => 'selectSingle',
101 'items' => [
102 [$languageFilePrefix . 'tt_content.uploads_type.0', 0],
103 [$languageFilePrefix . 'tt_content.uploads_type.1', 1],
104 [$languageFilePrefix . 'tt_content.uploads_type.2', 2]
105 ],
106 'default' => 0
107 ]
108 ],
109 'assets' => [
110 'label' => $languageFilePrefix . 'tt_content.asset_references',
111 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('assets', [
112 'appearance' => [
113 'createNewRelationLinkTitle' => $languageFilePrefix . 'tt_content.asset_references.addFileReference'
114 ],
115 // custom configuration for displaying fields in the overlay/reference table
116 // behaves the same as the image field.
117 'foreign_types' => $GLOBALS['TCA']['tt_content']['columns']['image']['config']['foreign_types']
118 ], $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext'])
119 ],
120 ];
121
122 $GLOBALS['TCA']['tt_content']['ctrl']['thumbnail'] = 'assets';
123
124 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $additionalColumns);
125 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('tt_content', 'bullets_type', 'bullets', 'after:layout');
126 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette('tt_content', 'uploadslayout', 'uploads_description,uploads_type');
127 });