444961b6884f7d2734a0ab7a94480169303728cc
[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,
41 bodytext;' . $frontendLanguageFilePrefix . 'bodytext_formlabel;;richtext:rte_transform[mode=ts_css],
42 --div--;' . $frontendLanguageFilePrefix . 'tabs.media,
43 media,
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' => [
56 'media' => [
57 'label' => $languageFilePrefix . 'tt_content.media_references',
58 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('media', [
59 'appearance' => [
60 'createNewRelationLinkTitle' => $languageFilePrefix . 'tt_content.media_references.addFileReference'
61 ],
62 // custom configuration for displaying fields in the overlay/reference table
63 // behaves the same as the image field.
64 'foreign_types' => $GLOBALS['TCA']['tt_content']['columns']['image']['config']['foreign_types']
65 ], $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext'])
66 ]
67 ]
68 ];
69
70 // Add category tab when categories column exits
71 if (!empty($GLOBALS['TCA']['tt_content']['columns']['categories'])) {
72 $GLOBALS['TCA']['tt_content']['types']['textmedia']['showitem'] .=
73 ',--div--;LLL:EXT:lang/locallang_tca.xlf:sys_category.tabs.category,
74 categories';
75 }
76
77 // Add table wizard
78 $GLOBALS['TCA']['tt_content']['types']['table']['columnsOverrides']['bodytext']['defaultExtras'] = 'nowrap:wizards[table]';
79
80 // Add additional fields for bullets + upload CTypes
81 $additionalColumns = [
82 'bullets_type' => [
83 'exclude' => TRUE,
84 'label' => $languageFilePrefix . 'tt_content.bullets_type',
85 'config' => [
86 'type' => 'select',
87 'items' => [
88 [$languageFilePrefix . 'tt_content.bullets_type.0', 0],
89 [$languageFilePrefix . 'tt_content.bullets_type.1', 1],
90 [$languageFilePrefix . 'tt_content.bullets_type.2', 2]
91 ],
92 'default' => 0
93 ]
94 ],
95 'uploads_description' => [
96 'exclude' => TRUE,
97 'label' => $languageFilePrefix . 'tt_content.uploads_description',
98 'config' => [
99 'type' => 'check',
100 'default' => 0,
101 'items' => [
102 ['LLL:EXT:lang/locallang_core.xml:labels.enabled', 1]
103 ]
104 ]
105 ],
106 'uploads_type' => [
107 'exclude' => TRUE,
108 'label' => $languageFilePrefix . 'tt_content.uploads_type',
109 'config' => [
110 'type' => 'select',
111 'items' => [
112 [$languageFilePrefix . 'tt_content.uploads_type.0', 0],
113 [$languageFilePrefix . 'tt_content.uploads_type.1', 1],
114 [$languageFilePrefix . 'tt_content.uploads_type.2', 2]
115 ],
116 'default' => 0
117 ]
118 ]
119 ];
120
121 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $additionalColumns);
122 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('tt_content', 'bullets_type', 'bullets', 'after:layout');
123 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette('tt_content', 'uploadslayout', 'uploads_description,uploads_type');
124 });