4cfb6b135984ed3fbb6cef1afc5126fffab92e4d
[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 'EXT:t3skin/icons/gfx/i/tt_content_textpic.gif'
17 ],
18 'header',
19 'after'
20 );
21 $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['textmedia'] = 'mimetypes-x-content-text-media';
22 $GLOBALS['TCA']['tt_content']['palettes']['mediaAdjustments'] = [
23 'showitem' => '
24 imagewidth;' . $languageFilePrefix . 'tt_content.palette.textmedia.imagewidth,
25 imageheight;' . $languageFilePrefix . 'tt_content.palette.textmedia.imageheight,
26 imageborder;' . $languageFilePrefix . 'tt_content.palette.textmedia.imageborder
27 '
28 ];
29 $GLOBALS['TCA']['tt_content']['palettes']['gallerySettings'] = [
30 'showitem' => '
31 imageorient;' . $frontendLanguageFilePrefix . 'imageorient_formlabel,
32 imagecols;' . $frontendLanguageFilePrefix . 'imagecols_formlabel
33 '
34 ];
35 $GLOBALS['TCA']['tt_content']['types']['textmedia'] = [
36 'showitem' => '
37 --palette--;' . $frontendLanguageFilePrefix . 'palette.general;general,
38 --palette--;' . $frontendLanguageFilePrefix . 'palette.header;header,
39 bodytext;' . $frontendLanguageFilePrefix . 'bodytext_formlabel;;richtext:rte_transform[mode=ts_css],
40 --div--;' . $frontendLanguageFilePrefix . 'tabs.media,
41 media,
42 --palette--;' . $frontendLanguageFilePrefix . 'palette.imagelinks;imagelinks,
43 --div--;' . $frontendLanguageFilePrefix . 'tabs.appearance,
44 layout;' . $frontendLanguageFilePrefix . 'layout_formlabel,
45 --palette--;' . $languageFilePrefix . 'tt_content.palette.mediaAdjustments;mediaAdjustments,
46 --palette--;' . $languageFilePrefix . 'tt_content.palette.gallerySettings;gallerySettings,
47 --palette--;' . $frontendLanguageFilePrefix . 'palette.appearanceLinks;appearanceLinks,
48 --div--;' . $frontendLanguageFilePrefix . 'tabs.access,
49 hidden;' . $frontendLanguageFilePrefix . 'field.default.hidden,
50 --palette--;' . $frontendLanguageFilePrefix . 'palette.access;access,
51 --div--;' . $frontendLanguageFilePrefix . 'tabs.extended
52 ',
53 'columnsOverrides' => [
54 'media' => [
55 'label' => $languageFilePrefix . 'tt_content.media_references',
56 'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('media', [
57 'appearance' => [
58 'createNewRelationLinkTitle' => $languageFilePrefix . 'tt_content.media_references.addFileReference'
59 ],
60 // custom configuration for displaying fields in the overlay/reference table
61 // behaves the same as the image field.
62 'foreign_types' => $GLOBALS['TCA']['tt_content']['columns']['image']['config']['foreign_types']
63 ], $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext'])
64 ]
65 ]
66 ];
67
68 // Add category tab when categories column exits
69 if (!empty($GLOBALS['TCA']['tt_content']['columns']['categories'])) {
70 $GLOBALS['TCA']['tt_content']['types']['textmedia']['showitem'] .=
71 ',--div--;LLL:EXT:lang/locallang_tca.xlf:sys_category.tabs.category,
72 categories';
73 }
74
75 // Add additional fields for bullets + upload CTypes
76 $additionalColumns = [
77 'bullets_type' => [
78 'exclude' => TRUE,
79 'label' => $languageFilePrefix . 'tt_content.bullets_type',
80 'config' => [
81 'type' => 'select',
82 'items' => [
83 [$languageFilePrefix . 'tt_content.bullets_type.0', 0],
84 [$languageFilePrefix . 'tt_content.bullets_type.1', 1],
85 [$languageFilePrefix . 'tt_content.bullets_type.2', 2]
86 ],
87 'default' => 0
88 ]
89 ],
90 'uploads_description' => [
91 'exclude' => TRUE,
92 'label' => $languageFilePrefix . 'tt_content.uploads_description',
93 'config' => [
94 'type' => 'check',
95 'default' => 0,
96 'items' => [
97 ['LLL:EXT:lang/locallang_core.xml:labels.enabled', 1]
98 ]
99 ]
100 ],
101 'uploads_type' => [
102 'exclude' => TRUE,
103 'label' => $languageFilePrefix . 'tt_content.uploads_type',
104 'config' => [
105 'type' => 'select',
106 'items' => [
107 [$languageFilePrefix . 'tt_content.uploads_type.0', 0],
108 [$languageFilePrefix . 'tt_content.uploads_type.1', 1],
109 [$languageFilePrefix . 'tt_content.uploads_type.2', 2]
110 ],
111 'default' => 0
112 ]
113 ]
114 ];
115
116 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $additionalColumns);
117 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('tt_content', 'bullets_type', 'bullets', 'after:layout');
118 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette('tt_content', 'uploadslayout', 'uploads_description,uploads_type');
119 });