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