[!!!][TASK] FormEngine: Drop "Show secondary options"
[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 'image_frames' => array(
75 'exclude' => TRUE,
76 'label' => 'LLL:EXT:cms/locallang_ttc.xlf:image_frames',
77 'config' => array(
78 'type' => 'select',
79 'items' => array(
80 array(
81 'LLL:EXT:cms/locallang_ttc.xlf:image_frames.I.0',
82 0
83 ),
84 array(
85 'LLL:EXT:cms/locallang_ttc.xlf:image_frames.I.1',
86 1
87 ),
88 array(
89 'LLL:EXT:cms/locallang_ttc.xlf:image_frames.I.2',
90 2
91 ),
92 array(
93 'LLL:EXT:cms/locallang_ttc.xlf:image_frames.I.3',
94 3
95 ),
96 array(
97 'LLL:EXT:cms/locallang_ttc.xlf:image_frames.I.4',
98 4
99 ),
100 array(
101 'LLL:EXT:cms/locallang_ttc.xlf:image_frames.I.5',
102 5
103 ),
104 array(
105 'LLL:EXT:cms/locallang_ttc.xlf:image_frames.I.6',
106 6
107 ),
108 array(
109 'LLL:EXT:cms/locallang_ttc.xlf:image_frames.I.7',
110 7
111 ),
112 array(
113 'LLL:EXT:cms/locallang_ttc.xlf:image_frames.I.8',
114 8
115 )
116 )
117 )
118 ),
119 'longdescURL' => array(
120 'exclude' => TRUE,
121 'label' => 'LLL:EXT:cms/locallang_ttc.xlf:image_longdescURL',
122 'config' => array(
123 'type' => 'text',
124 'cols' => '30',
125 'rows' => '3',
126 'wizards' => array(
127 'link' => array(
128 'type' => 'popup',
129 'title' => 'LLL:EXT:cms/locallang_ttc.xlf:image_link_formlabel',
130 'icon' => 'link_popup.gif',
131 'module' => array(
132 'name' => 'wizard_element_browser',
133 'urlParameters' => array(
134 'mode' => 'wizard'
135 )
136 ),
137 'params' => array(
138 'blindLinkOptions' => 'folder,file,mail,spec',
139 'blindLinkFields' => 'target,title,class,params'
140 ),
141 'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1'
142 )
143 ),
144 'softref' => 'typolink[linkList]'
145 )
146 ),
147 'titleText' => array(
148 'exclude' => TRUE,
149 'label' => 'LLL:EXT:cms/locallang_ttc.xlf:image_titleText',
150 'config' => array(
151 'type' => 'text',
152 'cols' => '30',
153 'rows' => '3'
154 )
155 )
156 );
157
158 // Adding fields to the tt_content table definition in TCA
159 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $extraContentColumns);
160
161 // Add default palettes
162 $GLOBALS['TCA']['tt_content']['palettes'] = array_replace(
163 $GLOBALS['TCA']['tt_content']['palettes'],
164 array(
165 '1' => array(
166 'showitem' => '
167 starttime,
168 endtime
169 '
170 ),
171 '2' => array(
172 'showitem' => '
173 imagecols,
174 image_noRows,
175 imageborder
176 '
177 ),
178 '3' => array(
179 'showitem' => '
180 header_position,
181 header_layout,
182 header_link,
183 date
184 '
185 ),
186 '4' => array(
187 'showitem' => '
188 sys_language_uid,
189 l18n_parent,
190 colPos,
191 spaceBefore,
192 spaceAfter,
193 section_frame,
194 sectionIndex
195 '
196 ),
197 '5' => array(
198 'showitem' => '
199 imagecaption_position
200 '
201 ),
202 '6' => array(
203 'showitem' => '
204 imagewidth,
205 image_link
206 '
207 ),
208 '7' => array(
209 'showitem' => '
210 image_link,
211 image_zoom
212 ',
213 ),
214 '8' => array(
215 'showitem' => '
216 layout
217 '
218 ),
219 '10' => array(
220 'showitem' => '
221 table_bgColor,
222 table_border,
223 table_cellspacing,
224 table_cellpadding
225 '
226 ),
227 '11' => array(
228 'showitem' => '
229 image_compression,
230 image_effects,
231 image_frames
232 ',
233 ),
234 '12' => array(
235 'showitem' => '
236 recursive
237 '
238 ),
239 '13' => array(
240 'showitem' => '
241 imagewidth,
242 imageheight
243 ',
244 ),
245 '14' => array(
246 'showitem' => '
247 sys_language_uid,
248 l18n_parent,
249 colPos
250 '
251 ),
252 'image_accessibility' => array(
253 'showitem' => '
254 altText;LLL:EXT:cms/locallang_ttc.xlf:altText_formlabel,
255 titleText;LLL:EXT:cms/locallang_ttc.xlf:titleText_formlabel,
256 --linebreak--,
257 longdescURL;LLL:EXT:cms/locallang_ttc.xlf:longdescURL_formlabel
258 ',
259 )
260 )
261 );
262
263 // Add palettes from css_styled_content if css_styled_content is NOT loaded but needed for CE's "search" and "mailform"
264 if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('css_styled_content')) {
265 $GLOBALS['TCA']['tt_content']['palettes'] = array_replace(
266 $GLOBALS['TCA']['tt_content']['palettes'],
267 array(
268 'visibility' => array(
269 'showitem' => '
270 hidden;LLL:EXT:cms/locallang_ttc.xlf:hidden_formlabel,
271 sectionIndex;LLL:EXT:cms/locallang_ttc.xlf:sectionIndex_formlabel,
272 linkToTop;LLL:EXT:cms/locallang_ttc.xlf:linkToTop_formlabel
273 ',
274 ),
275 'frames' => array(
276 'showitem' => '
277 layout;LLL:EXT:cms/locallang_ttc.xlf:layout_formlabel,
278 spaceBefore;LLL:EXT:cms/locallang_ttc.xlf:spaceBefore_formlabel,
279 spaceAfter;LLL:EXT:cms/locallang_ttc.xlf:spaceAfter_formlabel,
280 section_frame;LLL:EXT:cms/locallang_ttc.xlf:section_frame_formlabel
281 ',
282 )
283 )
284 );
285 }
286
287 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette('tt_content', 'image_settings', 'image_frames;LLL:EXT:cms/locallang_ttc.xlf:image_frames_formlabel');
288
289 /**
290 * CType "search"
291 */
292 $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['search'] = 'mimetypes-x-content-form-search';
293 $GLOBALS['TCA']['tt_content']['ctrl']['typeicons']['search'] = 'tt_content_search.gif';
294 $GLOBALS['TCA']['tt_content']['types']['search'] = array(
295 'showitem' => '--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
296 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,
297 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.appearance,
298 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,
299 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
300 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
301 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
302 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.behaviour,
303 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.searchform;searchform,
304 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended'
305 );
306
307 $GLOBALS['TCA']['tt_content']['palettes']['searchform'] = array(
308 'showitem' => 'pages;LLL:EXT:cms/locallang_ttc.xlf:pages.ALT.searchform',
309 );
310
311 // check if there is already a forms tab and add the item after that, otherwise
312 // add the tab item as well
313 $additionalCTypeItem = array(
314 'LLL:EXT:cms/locallang_ttc.xlf:CType.I.9',
315 'search',
316 'i/tt_content_search.gif'
317 );
318
319 $existingCTypeItems = $GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'];
320 $groupFound = FALSE;
321 $groupPosition = FALSE;
322 foreach ($existingCTypeItems as $position => $item) {
323 if ($item[0] === 'LLL:EXT:cms/locallang_ttc.xlf:CType.div.forms') {
324 $groupFound = TRUE;
325 $groupPosition = $position;
326 break;
327 }
328 }
329
330 if ($groupFound && $groupPosition) {
331 // add the new CType item below CType
332 array_splice($GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'], $groupPosition+1, 0, array(0 => $additionalCTypeItem));
333 } else {
334 // nothing found, add two items (group + new CType) at the bottom of the list
335 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType',
336 array('LLL:EXT:cms/locallang_ttc.xlf:CType.div.forms', '--div--')
337 );
338 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType', $additionalCTypeItem);
339 }
340
341
342 /**
343 * CType "mailform"
344 */
345 if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('form')) {
346 $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['mailform'] = 'mimetypes-x-content-form';
347 $GLOBALS['TCA']['tt_content']['ctrl']['typeicons']['mailform'] = 'tt_content_form.gif';
348 $GLOBALS['TCA']['tt_content']['columns']['bodytext']['config']['wizards']['forms'] = array(
349 'notNewRecords' => 1,
350 'enableByTypeConfig' => 1,
351 'type' => 'script',
352 'title' => 'LLL:EXT:cms/locallang_ttc.xlf:bodytext.W.forms',
353 'icon' => 'wizard_forms.gif',
354 'module' => array(
355 'name' => 'wizard_forms',
356 'urlParameters' => array(
357 'special' => 'formtype_mail'
358 )
359 ),
360 'params' => array(
361 'xmlOutput' => 0
362 )
363 );
364
365 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType', array(
366 'LLL:EXT:cms/locallang_ttc.xlf:CType.I.8',
367 'mailform',
368 'i/tt_content_form.gif'
369 ),
370 'search',
371 'before'
372 );
373 }
374
375
376 // set up the fields
377 $GLOBALS['TCA']['tt_content']['types']['mailform'] = array(
378 'showitem' => '
379 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
380 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,
381 bodytext;LLL:EXT:cms/locallang_ttc.xlf:bodytext.ALT.mailform_formlabel,
382 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.appearance,
383 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,
384 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
385 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
386 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
387 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.behaviour,
388 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.mailform;mailform,
389 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended'
390 );
391 $baseDefaultExtrasOfBodytext = '';
392 if (!empty($GLOBALS['TCA']['tt_content']['columns']['bodytext']['defaultExtras'])) {
393 $baseDefaultExtrasOfBodytext = $GLOBALS['TCA']['tt_content']['columns']['bodytext']['defaultExtras'] . ':';
394 }
395 if (!is_array($GLOBALS['TCA']['tt_content']['types']['mailform']['columnsOverrides'])) {
396 $GLOBALS['TCA']['tt_content']['types']['mailform']['columnsOverrides'] = array();
397 }
398 if (!is_array($GLOBALS['TCA']['tt_content']['types']['mailform']['columnsOverrides']['bodytext'])) {
399 $GLOBALS['TCA']['tt_content']['types']['mailform']['columnsOverrides']['bodytext'] = array();
400 }
401 $GLOBALS['TCA']['tt_content']['types']['mailform']['columnsOverrides']['bodytext']['defaultExtras'] = $baseDefaultExtrasOfBodytext . 'nowrap:wizards[forms]';
402
403 $GLOBALS['TCA']['tt_content']['palettes']['mailform'] = array(
404 'showitem' => 'pages;LLL:EXT:cms/locallang_ttc.xlf:pages.ALT.mailform, --linebreak--, subheader;LLL:EXT:cms/locallang_ttc.xlf:subheader.ALT.mailform_formlabel',
405 );