[TASK] Replace deprecated API calls and label references
[TYPO3CMS/Extensions/languagevisibility.git] / ext_tables.php
1 <?php
2
3 if (!defined('TYPO3_MODE')) {
4 die('Access denied.');
5 }
6
7 $langXml = 'EXT:languagevisibility/locallang_db.xml';
8 $tempColumns = array(
9 'tx_languagevisibility_fallbackorder' => array(
10 'exclude' => 0,
11 'label' => 'LLL:' . $langXml . ':sys_language.tx_languagevisibility_fallbackorder',
12 'l10n_display' => 'hideDiff',
13 'config' => array(
14 'type' => 'select',
15 'foreign_table' => 'sys_language',
16 'foreign_table_where' => ' ORDER BY sys_language.title',
17 'items' => array(
18 array('default', '999'),
19 ),
20 'size' => 10,
21 'minitems' => 0,
22 'maxitems' => 10,
23 )
24 ),
25 'tx_languagevisibility_fallbackorderel' => array(
26 'exclude' => 0,
27 'label' => 'LLL:' . $langXml . ':sys_language.tx_languagevisibility_fallbackorderel',
28 'displayCond' => 'FIELD:tx_languagevisibility_complexfallbacksetting:>=:1',
29 'l10n_display' => 'hideDiff',
30 'config' => array(
31 'type' => 'select',
32 'foreign_table' => 'sys_language',
33 'foreign_table_where' => ' ORDER BY sys_language.title',
34 'items' => array(
35 array('default', '999'),
36 ),
37 'size' => 10,
38 'minitems' => 0,
39 'maxitems' => 10,
40 )
41 ),
42 'tx_languagevisibility_fallbackorderttnewsel' => array(
43 'exclude' => 0,
44 'label' => 'LLL:' . $langXml . ':sys_language.tx_languagevisibility_fallbackorderttnewsel',
45 'displayCond' => 'FIELD:tx_languagevisibility_complexfallbacksetting:>=:1',
46 'l10n_display' => 'hideDiff',
47 'config' => array(
48 'type' => 'select',
49 'foreign_table' => 'sys_language',
50 'foreign_table_where' => ' ORDER BY sys_language.title',
51 'items' => array(
52 array('default', '999'),
53 ),
54 'size' => 10,
55 'minitems' => 0,
56 'maxitems' => 10,
57 )
58 ),
59 'tx_languagevisibility_defaultvisibility' => array(
60 'exclude' => 0,
61 'label' => 'LLL:' . $langXml . ':sys_language.tx_languagevisibility_defaultvisibility',
62 'config' => array(
63 'type' => 'select',
64 'items' => array(
65 array('',''),
66 array('LLL:' . $langXml . ':tx_languagevisibility_visibility.I.yes', 'yes'),
67 array('LLL:' . $langXml . ':tx_languagevisibility_visibility.I.no', 'no'),
68 array('LLL:' . $langXml . ':tx_languagevisibility_visibility.I.t', 't'),
69 array('LLL:' . $langXml . ':tx_languagevisibility_visibility.I.f', 'f'),
70 ),
71 'default' => 'f',
72 'size' => 1,
73 'maxitems' => 1,
74 )
75 ),
76 'tx_languagevisibility_defaultvisibilityel' => array(
77 'exclude' => 0,
78 'label' => 'LLL:' . $langXml . ':sys_language.tx_languagevisibility_defaultvisibilityel',
79 'config' => array(
80 'type' => 'select',
81 'items' => array(
82 array('',''),
83 array('LLL:' . $langXml . ':tx_languagevisibility_visibility.I.yes', 'yes'),
84 array('LLL:' . $langXml . ':tx_languagevisibility_visibility.I.no', 'no'),
85 array('LLL:' . $langXml . ':tx_languagevisibility_visibility.I.t', 't'),
86 array('LLL:' . $langXml . ':tx_languagevisibility_visibility.I.f', 'f'),
87 ),
88 'default' => 'f',
89 'size' => 1,
90 'maxitems' => 1,
91 )
92 ),
93 'tx_languagevisibility_defaultvisibilityttnewsel' => array(
94 'exclude' => 0,
95 'label' => 'LLL:' . $langXml . ':sys_language.tx_languagevisibility_defaultvisibilityttnewsel',
96 'config' => array(
97 'type' => 'select',
98 'items' => array(
99 array('',''),
100 array('LLL:' . $langXml . ':tx_languagevisibility_visibility.I.yes', 'yes'),
101 array('LLL:' . $langXml . ':tx_languagevisibility_visibility.I.no', 'no'),
102 array('LLL:' . $langXml . ':tx_languagevisibility_visibility.I.t', 't'),
103 array('LLL:' . $langXml . ':tx_languagevisibility_visibility.I.f', 'f'),
104 ),
105 'default' => 'f',
106 'size' => 1,
107 'maxitems' => 1,
108 )
109 ),
110 'tx_languagevisibility_complexfallbacksetting' => array(
111 'exclude' => 0,
112 'label' => 'LLL:' . $langXml . ':sys_language.tx_languagevisibility_complexfallbacksetting',
113 'config' => array(
114 'type' => 'check'
115 )
116 ),
117 );
118
119 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('sys_language', $tempColumns, 1);
120 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('sys_language', 'tx_languagevisibility_defaultvisibility, tx_languagevisibility_fallbackorder;;;;1-1-1,tx_languagevisibility_complexfallbacksetting, tx_languagevisibility_defaultvisibilityttnewsel, tx_languagevisibility_fallbackorderttnewsel;;;;1-1-1, tx_languagevisibility_defaultvisibilityel, tx_languagevisibility_fallbackorderel;;;;1-1-1');
121 $tempColumnsElements = array(
122 'tx_languagevisibility_visibility' => array(
123 'exclude' => 1,
124 'label' => 'LLL:' . $langXml . ':pages.tx_languagevisibility_visibility',
125 'config' => array(
126 'type' => 'user',
127 'size' => '30',
128 'userFunc' => 'tx_languagevisibility_fieldvisibility->user_fieldvisibility',
129 )
130 )
131 );
132
133 $tempColumnsPages = array(
134 'tx_languagevisibility_visibility' => array(
135 'exclude' => 1,
136 'label' => 'LLL:' . $langXml . ':pages.tx_languagevisibility_visibility',
137 'config' => array(
138 'type' => 'user',
139 'size' => '30',
140 'userFunc' => 'tx_languagevisibility_fieldvisibility->user_fieldvisibility',
141 )
142 ),
143 'tx_languagevisibility_inheritanceflag_original' => array(
144 'exclude' => 1,
145 'label' => 'LLL:' . $langXml . ':pages.tx_languagevisibility_inheritanceflag_original',
146 'config' => array(
147 'type' => 'check',
148 'default' => '0'
149 )
150 ),
151 'tx_languagevisibility_inheritanceflag_overlayed' => array(
152 'exclude' => 1,
153 'label' => 'LLL:' . $langXml . ':pages.tx_languagevisibility_inheritanceflag_overlayed',
154 'config' => array(
155 'type' => 'check',
156 'default' => '0'
157 )
158 ),
159 );
160
161 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages', $tempColumnsPages, 1);
162 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', '--div--;LLL:' . $langXml . ':tabname,tx_languagevisibility_visibility;;;;1-1-1', '', 'after:php_tree_stop');
163
164 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages_language_overlay', $tempColumnsPages,1);
165 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages_language_overlay', '--div--;LLL:' . $langXml . ':tabname,tx_languagevisibility_visibility;;;;1-1-1', '', '');
166
167 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_news', $tempColumnsElements,1);
168 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('tt_news', '--div--;LLL:' . $langXml . ':tabname,tx_languagevisibility_visibility;;;;1-1-1');
169
170 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $tempColumnsElements,1);
171 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('tt_content', '--div--;LLL:' . $langXml . ':tabname,tx_languagevisibility_visibility;;;;1-1-1,sys_language_uid,l18n_parent', '', 'before:--div--;LLL:EXT:cms/locallang_ttc.xml:tabs.extended');
172
173 $GLOBALS['TCA']['tt_content']['palettes']['general']['showitem'] = str_replace('sys_language_uid;LLL:EXT:cms/locallang_ttc.xlf:sys_language_uid_formlabel', '', $GLOBALS['TCA']['tt_content']['palettes']['general']['showitem']);
174
175 $GLOBALS['TCA']['tt_content']['ctrl']['dividers2tabs'] = TRUE;
176
177 $tempColumns = array(
178 'tx_languagevisibility_allow_movecutdelete_foroverlays' => array(
179 'exclude' => 1,
180 'label' => 'LLL:' . $langXml . ':be_groups.allow_movecutdelete_foroverlays:',
181 'config' => array(
182 'type' => 'check'
183 )
184 ),
185 );
186
187 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('be_groups', $tempColumns, 1);
188 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('be_groups', '--div--;LLL:' . $langXml . ':tabname,tx_languagevisibility_allow_movecutdelete_foroverlays;;;;1-1-1');
189
190 if (TYPO3_MODE == 'BE') {
191 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
192 'web_info',
193 'tx_languagevisibility_modfunc1',
194 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'modfunc1/class.tx_languagevisibility_modfunc1.php',
195 'LLL:' . $langXml . ':moduleFunction.tx_languagevisibility_modfunc1'
196 );
197 }
198
199 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['configuration'][] = 'tx_languagevisibility_reports_ConfigurationStatus';