[!!!][TASK] Isolate unused fields and field arrangements
[Packages/TYPO3.CMS.git] / typo3 / sysext / compatibility6 / Configuration / TCA / Overrides / tt_content.php
1 <?php
2 defined('TYPO3_MODE') or die();
3
4 //Extra fields for the tt_content table
5 $extraContentColumns = array(
6 'altText' => array(
7 'exclude' => TRUE,
8 'label' => 'LLL:EXT:cms/locallang_ttc.xlf:image_altText',
9 'config' => array(
10 'type' => 'text',
11 'cols' => '30',
12 'rows' => '3'
13 )
14 ),
15 'imagecaption' => array(
16 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.caption',
17 'config' => array(
18 'type' => 'text',
19 'cols' => '30',
20 'rows' => '3',
21 'softref' => 'typolink_tag,images,email[subst],url'
22 )
23 ),
24 'imagecaption_position' => array(
25 'exclude' => TRUE,
26 'label' => 'LLL:EXT:cms/locallang_ttc.xlf:imagecaption_position',
27 'config' => array(
28 'type' => 'select',
29 'items' => array(
30 array(
31 'LLL:EXT:lang/locallang_general.xlf:LGL.default_value',
32 ''
33 ),
34 array(
35 'LLL:EXT:cms/locallang_ttc.xlf:imagecaption_position.I.1',
36 'center'
37 ),
38 array(
39 'LLL:EXT:cms/locallang_ttc.xlf:imagecaption_position.I.2',
40 'right'
41 ),
42 array(
43 'LLL:EXT:cms/locallang_ttc.xlf:imagecaption_position.I.3',
44 'left'
45 )
46 ),
47 'default' => ''
48 )
49 ),
50 'image_link' => array(
51 'exclude' => TRUE,
52 'label' => 'LLL:EXT:cms/locallang_ttc.xlf:image_link',
53 'config' => array(
54 'type' => 'text',
55 'cols' => '30',
56 'rows' => '3',
57 'wizards' => array(
58 'link' => array(
59 'type' => 'popup',
60 'title' => 'LLL:EXT:cms/locallang_ttc.xlf:image_link_formlabel',
61 'icon' => 'link_popup.gif',
62 'module' => array(
63 'name' => 'wizard_element_browser',
64 'urlParameters' => array(
65 'mode' => 'wizard'
66 )
67 ),
68 'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1'
69 )
70 ),
71 'softref' => 'typolink[linkList]'
72 )
73 ),
74 'longdescURL' => array(
75 'exclude' => TRUE,
76 'label' => 'LLL:EXT:cms/locallang_ttc.xlf:image_longdescURL',
77 'config' => array(
78 'type' => 'text',
79 'cols' => '30',
80 'rows' => '3',
81 'wizards' => array(
82 'link' => array(
83 'type' => 'popup',
84 'title' => 'LLL:EXT:cms/locallang_ttc.xlf:image_link_formlabel',
85 'icon' => 'link_popup.gif',
86 'module' => array(
87 'name' => 'wizard_element_browser',
88 'urlParameters' => array(
89 'mode' => 'wizard'
90 )
91 ),
92 'params' => array(
93 'blindLinkOptions' => 'folder,file,mail,spec',
94 'blindLinkFields' => 'target,title,class,params'
95 ),
96 'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1'
97 )
98 ),
99 'softref' => 'typolink[linkList]'
100 )
101 ),
102 'titleText' => array(
103 'exclude' => TRUE,
104 'label' => 'LLL:EXT:cms/locallang_ttc.xlf:image_titleText',
105 'config' => array(
106 'type' => 'text',
107 'cols' => '30',
108 'rows' => '3'
109 )
110 )
111 );
112
113 // Adding fields to the tt_content table definition in TCA
114 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $extraContentColumns);
115
116 // Add default palettes
117 $GLOBALS['TCA']['tt_content']['palettes'] = array_replace(
118 $GLOBALS['TCA']['tt_content']['palettes'],
119 array(
120 '1' => array(
121 'showitem' => '
122 starttime,
123 endtime
124 '
125 ),
126 '2' => array(
127 'showitem' => '
128 imagecols,
129 image_noRows,
130 imageborder
131 '
132 ),
133 '3' => array(
134 'showitem' => '
135 header_position,
136 header_layout,
137 header_link,
138 date
139 '
140 ),
141 '4' => array(
142 'showitem' => '
143 sys_language_uid,
144 l18n_parent,
145 colPos,
146 spaceBefore,
147 spaceAfter,
148 section_frame,
149 sectionIndex
150 '
151 ),
152 '5' => array(
153 'showitem' => '
154 imagecaption_position
155 '
156 ),
157 '6' => array(
158 'showitem' => '
159 imagewidth,
160 image_link
161 '
162 ),
163 '7' => array(
164 'showitem' => '
165 image_link,
166 image_zoom
167 ',
168 'canNotCollapse' => 1
169 ),
170 '8' => array(
171 'showitem' => '
172 layout
173 '
174 ),
175 '10' => array(
176 'showitem' => '
177 table_bgColor,
178 table_border,
179 table_cellspacing,
180 table_cellpadding
181 '
182 ),
183 '11' => array(
184 'showitem' => '
185 image_compression,
186 image_effects,
187 image_frames
188 ',
189 'canNotCollapse' => 1
190 ),
191 '12' => array(
192 'showitem' => '
193 recursive
194 '
195 ),
196 '13' => array(
197 'showitem' => '
198 imagewidth,
199 imageheight
200 ',
201 'canNotCollapse' => 1
202 ),
203 '14' => array(
204 'showitem' => '
205 sys_language_uid,
206 l18n_parent,
207 colPos
208 '
209 ),
210 'image_accessibility' => array(
211 'showitem' => '
212 altText;LLL:EXT:cms/locallang_ttc.xlf:altText_formlabel,
213 titleText;LLL:EXT:cms/locallang_ttc.xlf:titleText_formlabel,
214 --linebreak--,
215 longdescURL;LLL:EXT:cms/locallang_ttc.xlf:longdescURL_formlabel
216 ',
217 'canNotCollapse' => 1
218 )
219 )
220 );
221
222 // Add palettes from css_styled_content if css_styled_content is NOT loaded but needed for CE's "search" and "mailform"
223 if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('css_styled_content')) {
224 $GLOBALS['TCA']['tt_content']['palettes'] = array_replace(
225 $GLOBALS['TCA']['tt_content']['palettes'],
226 array(
227 'visibility' => array(
228 'showitem' => '
229 hidden;LLL:EXT:cms/locallang_ttc.xlf:hidden_formlabel,
230 sectionIndex;LLL:EXT:cms/locallang_ttc.xlf:sectionIndex_formlabel,
231 linkToTop;LLL:EXT:cms/locallang_ttc.xlf:linkToTop_formlabel
232 ',
233 'canNotCollapse' => 1
234 ),
235 'frames' => array(
236 'showitem' => '
237 layout;LLL:EXT:cms/locallang_ttc.xlf:layout_formlabel,
238 spaceBefore;LLL:EXT:cms/locallang_ttc.xlf:spaceBefore_formlabel,
239 spaceAfter;LLL:EXT:cms/locallang_ttc.xlf:spaceAfter_formlabel,
240 section_frame;LLL:EXT:cms/locallang_ttc.xlf:section_frame_formlabel
241 ',
242 'canNotCollapse' => 1
243 )
244 )
245 );
246 }
247
248 /**
249 * CType "search"
250 */
251 $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['search'] = 'mimetypes-x-content-form-search';
252 $GLOBALS['TCA']['tt_content']['ctrl']['typeicons']['search'] = 'tt_content_search.gif';
253 $GLOBALS['TCA']['tt_content']['types']['search'] = array(
254 'showitem' => '--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
255 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,
256 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.appearance,
257 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,
258 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
259 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
260 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
261 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.behaviour,
262 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.searchform;searchform,
263 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended'
264 );
265
266 $GLOBALS['TCA']['tt_content']['palettes']['searchform'] = array(
267 'showitem' => 'pages;LLL:EXT:cms/locallang_ttc.xlf:pages.ALT.searchform',
268 'canNotCollapse' => 1
269 );
270
271 // check if there is already a forms tab and add the item after that, otherwise
272 // add the tab item as well
273 $additionalCTypeItem = array(
274 'LLL:EXT:cms/locallang_ttc.xlf:CType.I.9',
275 'search',
276 'i/tt_content_search.gif'
277 );
278
279 $existingCTypeItems = $GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'];
280 $groupFound = FALSE;
281 $groupPosition = FALSE;
282 foreach ($existingCTypeItems as $position => $item) {
283 if ($item[0] === 'LLL:EXT:cms/locallang_ttc.xlf:CType.div.forms') {
284 $groupFound = TRUE;
285 $groupPosition = $position;
286 break;
287 }
288 }
289
290 if ($groupFound && $groupPosition) {
291 // add the new CType item below CType
292 array_splice($GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'], $groupPosition+1, 0, array(0 => $additionalCTypeItem));
293 } else {
294 // nothing found, add two items (group + new CType) at the bottom of the list
295 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType',
296 array('LLL:EXT:cms/locallang_ttc.xlf:CType.div.forms', '--div--')
297 );
298 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType', $additionalCTypeItem);
299 }
300
301
302 /**
303 * CType "mailform"
304 */
305 if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('form')) {
306 $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['mailform'] = 'mimetypes-x-content-form';
307 $GLOBALS['TCA']['tt_content']['ctrl']['typeicons']['mailform'] = 'tt_content_form.gif';
308 $GLOBALS['TCA']['tt_content']['columns']['bodytext']['config']['wizards']['forms'] = array(
309 'notNewRecords' => 1,
310 'enableByTypeConfig' => 1,
311 'type' => 'script',
312 'title' => 'LLL:EXT:cms/locallang_ttc.xlf:bodytext.W.forms',
313 'icon' => 'wizard_forms.gif',
314 'module' => array(
315 'name' => 'wizard_forms',
316 'urlParameters' => array(
317 'special' => 'formtype_mail'
318 )
319 ),
320 'params' => array(
321 'xmlOutput' => 0
322 )
323 );
324
325 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType', array(
326 'LLL:EXT:cms/locallang_ttc.xlf:CType.I.8',
327 'mailform',
328 'i/tt_content_form.gif'
329 ),
330 'search',
331 'before'
332 );
333 }
334
335
336 // set up the fields
337 $GLOBALS['TCA']['tt_content']['types']['mailform'] = array(
338 'showitem' => '
339 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
340 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,
341 bodytext;LLL:EXT:cms/locallang_ttc.xlf:bodytext.ALT.mailform_formlabel;;nowrap:wizards[forms],
342 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.appearance,
343 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,
344 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
345 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
346 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
347 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.behaviour,
348 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.mailform;mailform,
349 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended'
350 );
351 $GLOBALS['TCA']['tt_content']['palettes']['mailform'] = array(
352 'showitem' => 'pages;LLL:EXT:cms/locallang_ttc.xlf:pages.ALT.mailform, --linebreak--, subheader;LLL:EXT:cms/locallang_ttc.xlf:subheader.ALT.mailform_formlabel',
353 'canNotCollapse' => 1
354 );