[!!!][TASK] Move legacy "search" CType to compatibility6
[Packages/TYPO3.CMS.git] / typo3 / sysext / compatibility6 / Configuration / TCA / Overrides / tt_content.php
1 <?php
2 defined('TYPO3_MODE') or die();
3
4 /**
5 * CType "search"
6 */
7 $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['search'] = 'mimetypes-x-content-form-search';
8 $GLOBALS['TCA']['tt_content']['ctrl']['typeicons']['search'] = 'tt_content_search.gif';
9 $GLOBALS['TCA']['tt_content']['types']['search'] = array(
10 'showitem' => '--palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
11 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,
12 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.appearance,
13 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,
14 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
15 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
16 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
17 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.behaviour,
18 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.searchform;searchform,
19 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended'
20 );
21
22 $GLOBALS['TCA']['tt_content']['palettes']['searchform'] = array(
23 'showitem' => 'pages;LLL:EXT:cms/locallang_ttc.xlf:pages.ALT.searchform',
24 'canNotCollapse' => 1
25 );
26
27 // check if there is already a forms tab and add the item after that, otherwise
28 // add the tab item as well
29 $additionalCTypeItem = array(
30 'LLL:EXT:cms/locallang_ttc.xlf:CType.I.9',
31 'search',
32 'i/tt_content_search.gif'
33 );
34
35 $existingCTypeItems = $GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'];
36 $groupFound = FALSE;
37 $groupPosition = FALSE;
38 foreach ($existingCTypeItems as $position => $item) {
39 if ($item[0] === 'LLL:EXT:cms/locallang_ttc.xlf:CType.div.forms') {
40 $groupFound = TRUE;
41 $groupPosition = $position;
42 break;
43 }
44 }
45
46 if ($groupFound && $groupPosition) {
47 // add the new CType item below CType
48 array_splice($GLOBALS['TCA']['tt_content']['columns']['CType']['config']['items'], $groupPosition+1, 0, array(0 => $additionalCTypeItem));
49 } else {
50 // nothing found, add two items (group + new CType) at the bottom of the list
51 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType',
52 array('LLL:EXT:cms/locallang_ttc.xlf:CType.div.forms', '--div--')
53 );
54 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType', $additionalCTypeItem);
55 }
56
57
58 /**
59 * CType "mailform"
60 */
61 if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('form')) {
62 $GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['mailform'] = 'mimetypes-x-content-form';
63 $GLOBALS['TCA']['tt_content']['ctrl']['typeicons']['mailform'] = 'tt_content_form.gif';
64 $GLOBALS['TCA']['tt_content']['columns']['bodytext']['config']['wizards']['forms'] = array(
65 'notNewRecords' => 1,
66 'enableByTypeConfig' => 1,
67 'type' => 'script',
68 'title' => 'LLL:EXT:cms/locallang_ttc.xlf:bodytext.W.forms',
69 'icon' => 'wizard_forms.gif',
70 'module' => array(
71 'name' => 'wizard_forms',
72 'urlParameters' => array(
73 'special' => 'formtype_mail'
74 )
75 ),
76 'params' => array(
77 'xmlOutput' => 0
78 )
79 );
80
81 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType', array(
82 'LLL:EXT:cms/locallang_ttc.xlf:CType.I.8',
83 'mailform',
84 'i/tt_content_form.gif'
85 ),
86 'search',
87 'before'
88 );
89 }
90
91
92 // set up the fields
93 $GLOBALS['TCA']['tt_content']['types']['mailform'] = array(
94 'showitem' => '
95 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.general;general,
96 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.header;header,
97 bodytext;LLL:EXT:cms/locallang_ttc.xlf:bodytext.ALT.mailform_formlabel;;nowrap:wizards[forms],
98 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.appearance,
99 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.frames;frames,
100 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access,
101 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.visibility;visibility,
102 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.access;access,
103 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.behaviour,
104 --palette--;LLL:EXT:cms/locallang_ttc.xlf:palette.mailform;mailform,
105 --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.extended'
106 );
107 $GLOBALS['TCA']['tt_content']['palettes']['mailform'] = array(
108 'showitem' => 'pages;LLL:EXT:cms/locallang_ttc.xlf:pages.ALT.mailform, --linebreak--, subheader;LLL:EXT:cms/locallang_ttc.xlf:subheader.ALT.mailform_formlabel',
109 'canNotCollapse' => 1
110 );