589dc2ebf30e770e0dc6b6e2cdd27c219ab88f7c
[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 'canNotCollapse' => 1
214 ),
215 '8' => array(
216 'showitem' => '
217 layout
218 '
219 ),
220 '10' => array(
221 'showitem' => '
222 table_bgColor,
223 table_border,
224 table_cellspacing,
225 table_cellpadding
226 '
227 ),
228 '11' => array(
229 'showitem' => '
230 image_compression,
231 image_effects,
232 image_frames
233 ',
234 'canNotCollapse' => 1
235 ),
236 '12' => array(
237 'showitem' => '
238 recursive
239 '
240 ),
241 '13' => array(
242 'showitem' => '
243 imagewidth,
244 imageheight
245 ',
246 'canNotCollapse' => 1
247 ),
248 '14' => array(
249 'showitem' => '
250 sys_language_uid,
251 l18n_parent,
252 colPos
253 '
254 ),
255 'image_accessibility' => array(
256 'showitem' => '
257 altText;LLL:EXT:cms/locallang_ttc.xlf:altText_formlabel,
258 titleText;LLL:EXT:cms/locallang_ttc.xlf:titleText_formlabel,
259 --linebreak--,
260 longdescURL;LLL:EXT:cms/locallang_ttc.xlf:longdescURL_formlabel
261 ',
262 'canNotCollapse' => 1
263 )
264 )
265 );
266
267 // Add palettes from css_styled_content if css_styled_content is NOT loaded but needed for CE's "search" and "mailform"
268 if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('css_styled_content')) {
269 $GLOBALS['TCA']['tt_content']['palettes'] = array_replace(
270 $GLOBALS['TCA']['tt_content']['palettes'],
271 array(
272 'visibility' => array(
273 'showitem' => '
274 hidden;LLL:EXT:cms/locallang_ttc.xlf:hidden_formlabel,
275 sectionIndex;LLL:EXT:cms/locallang_ttc.xlf:sectionIndex_formlabel,
276 linkToTop;LLL:EXT:cms/locallang_ttc.xlf:linkToTop_formlabel
277 ',
278 'canNotCollapse' => 1
279 ),
280 'frames' => array(
281 'showitem' => '
282 layout;LLL:EXT:cms/locallang_ttc.xlf:layout_formlabel,
283 spaceBefore;LLL:EXT:cms/locallang_ttc.xlf:spaceBefore_formlabel,
284 spaceAfter;LLL:EXT:cms/locallang_ttc.xlf:spaceAfter_formlabel,
285 section_frame;LLL:EXT:cms/locallang_ttc.xlf:section_frame_formlabel
286 ',
287 'canNotCollapse' => 1
288 )
289 )
290 );
291 }
292
293 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette('tt_content', 'image_settings', 'image_frames;LLL:EXT:cms/locallang_ttc.xlf:image_frames_formlabel');
294
295 /**
296 * CType "search"
297 */
298 $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['search'] = 'mimetypes-x-content-form-search';
299 $GLOBALS['TCA']['tt_content']['ctrl']['typeicons']['search'] = 'tt_content_search.gif';
300 $GLOBALS['TCA']['tt_content']['types']['search'] = array(
301 'showitem' => '--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
302 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,
303 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.appearance,
304 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,
305 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
306 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
307 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
308 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.behaviour,
309 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.searchform;searchform,
310 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended'
311 );
312
313 $GLOBALS['TCA']['tt_content']['palettes']['searchform'] = array(
314 'showitem' => 'pages;LLL:EXT:cms/locallang_ttc.xlf:pages.ALT.searchform',
315 'canNotCollapse' => 1
316 );
317
318 // check if there is already a forms tab and add the item after that, otherwise
319 // add the tab item as well
320 $additionalCTypeItem = array(
321 'LLL:EXT:cms/locallang_ttc.xlf:CType.I.9',
322 'search',
323 'i/tt_content_search.gif'
324 );
325
326 $existingCTypeItems = $GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'];
327 $groupFound = FALSE;
328 $groupPosition = FALSE;
329 foreach ($existingCTypeItems as $position => $item) {
330 if ($item[0] === 'LLL:EXT:cms/locallang_ttc.xlf:CType.div.forms') {
331 $groupFound = TRUE;
332 $groupPosition = $position;
333 break;
334 }
335 }
336
337 if ($groupFound && $groupPosition) {
338 // add the new CType item below CType
339 array_splice($GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'], $groupPosition+1, 0, array(0 => $additionalCTypeItem));
340 } else {
341 // nothing found, add two items (group + new CType) at the bottom of the list
342 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType',
343 array('LLL:EXT:cms/locallang_ttc.xlf:CType.div.forms', '--div--')
344 );
345 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType', $additionalCTypeItem);
346 }
347
348
349 /**
350 * CType "mailform"
351 */
352 if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('form')) {
353 $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['mailform'] = 'mimetypes-x-content-form';
354 $GLOBALS['TCA']['tt_content']['ctrl']['typeicons']['mailform'] = 'tt_content_form.gif';
355 $GLOBALS['TCA']['tt_content']['columns']['bodytext']['config']['wizards']['forms'] = array(
356 'notNewRecords' => 1,
357 'enableByTypeConfig' => 1,
358 'type' => 'script',
359 'title' => 'LLL:EXT:cms/locallang_ttc.xlf:bodytext.W.forms',
360 'icon' => 'wizard_forms.gif',
361 'module' => array(
362 'name' => 'wizard_forms',
363 'urlParameters' => array(
364 'special' => 'formtype_mail'
365 )
366 ),
367 'params' => array(
368 'xmlOutput' => 0
369 )
370 );
371
372 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType', array(
373 'LLL:EXT:cms/locallang_ttc.xlf:CType.I.8',
374 'mailform',
375 'i/tt_content_form.gif'
376 ),
377 'search',
378 'before'
379 );
380 }
381
382
383 // set up the fields
384 $GLOBALS['TCA']['tt_content']['types']['mailform'] = array(
385 'showitem' => '
386 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
387 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,
388 bodytext;LLL:EXT:cms/locallang_ttc.xlf:bodytext.ALT.mailform_formlabel,
389 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.appearance,
390 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,
391 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
392 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
393 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
394 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.behaviour,
395 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.mailform;mailform,
396 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended'
397 );
398 $baseDefaultExtrasOfBodytext = '';
399 if (!empty($GLOBALS['TCA']['tt_content']['columns']['bodytext']['defaultExtras'])) {
400 $baseDefaultExtrasOfBodytext = $GLOBALS['TCA']['tt_content']['columns']['bodytext']['defaultExtras'] . ':';
401 }
402 if (!is_array($GLOBALS['TCA']['tt_content']['types']['mailform']['columnsOverrides'])) {
403 $GLOBALS['TCA']['tt_content']['types']['mailform']['columnsOverrides'] = array();
404 }
405 if (!is_array($GLOBALS['TCA']['tt_content']['types']['mailform']['columnsOverrides']['bodytext'])) {
406 $GLOBALS['TCA']['tt_content']['types']['mailform']['columnsOverrides']['bodytext'] = array();
407 }
408 $GLOBALS['TCA']['tt_content']['types']['mailform']['columnsOverrides']['bodytext']['defaultExtras'] = $baseDefaultExtrasOfBodytext . 'nowrap:wizards[forms]';
409
410 $GLOBALS['TCA']['tt_content']['palettes']['mailform'] = array(
411 'showitem' => 'pages;LLL:EXT:cms/locallang_ttc.xlf:pages.ALT.mailform, --linebreak--, subheader;LLL:EXT:cms/locallang_ttc.xlf:subheader.ALT.mailform_formlabel',
412 'canNotCollapse' => 1
413 );