[BUGFIX] Improve l10n_mode config for sys_file_reference
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Configuration / TCA / sys_file_reference.php
1 <?php
2 return array(
3 'ctrl' => array(
4 'title' => 'LLL:EXT:lang/locallang_tca.xlf:sys_file_reference',
5 'label' => 'uid',
6 'formattedLabel_userFunc' => 'EXT:core/Classes/Resource/Service/UserFileInlineLabelService.php:TYPO3\\CMS\\Core\\Resource\\Service\\UserFileInlineLabelService->getInlineLabel',
7 'formattedLabel_userFunc_options' => array(
8 'sys_file' => array(
9 'title',
10 'name'
11 )
12 ),
13 'tstamp' => 'tstamp',
14 'crdate' => 'crdate',
15 'cruser_id' => 'cruser_id',
16 'type' => 'uid_local:type',
17 'hideTable' => TRUE,
18 'sortby' => 'sorting',
19 'delete' => 'deleted',
20 'versioningWS' => TRUE,
21 'languageField' => 'sys_language_uid',
22 'transOrigPointerField' => 'l10n_parent',
23 'transOrigDiffSourceField' => 'l10n_diffsource',
24 // records can and should be edited in workspaces
25 'shadowColumnsForNewPlaceholders' => 'tablenames,fieldname,uid_local,uid_foreign',
26 'enablecolumns' => array(
27 'disabled' => 'hidden'
28 ),
29 'typeicon_classes' => array(
30 'default' => 'mimetypes-other-other'
31 ),
32 'security' => array(
33 'ignoreWebMountRestriction' => TRUE,
34 'ignoreRootLevelRestriction' => TRUE,
35 ),
36 'searchFields' => 'uid_local,uid_foreign,tablenames,fieldname,title,description'
37 ),
38 'interface' => array(
39 'showRecordFieldList' => 'hidden,uid_local,uid_foreign,tablenames,fieldname,sorting_foreign,table_local,title,description'
40 ),
41 'columns' => array(
42 't3ver_label' => array(
43 'exclude' => 0,
44 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.versionLabel',
45 'config' => array(
46 'type' => 'input',
47 'size' => '30',
48 'max' => '30'
49 )
50 ),
51 'sys_language_uid' => array(
52 'exclude' => 0,
53 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language',
54 'config' => array(
55 'type' => 'select',
56 'foreign_table' => 'sys_language',
57 'foreign_table_where' => 'ORDER BY sys_language.title',
58 'items' => array(
59 array('LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages', -1),
60 array('LLL:EXT:lang/locallang_general.xlf:LGL.default_value', 0)
61 )
62 )
63 ),
64 'l10n_parent' => array(
65 'displayCond' => 'FIELD:sys_language_uid:>:0',
66 'exclude' => 0,
67 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent',
68 'config' => array(
69 'type' => 'select',
70 'items' => array(
71 array('', 0)
72 ),
73 'foreign_table' => 'sys_file_reference',
74 'foreign_table_where' => 'AND sys_file_reference.uid=###REC_FIELD_l10n_parent### AND sys_file_reference.sys_language_uid IN (-1,0)'
75 )
76 ),
77 'l10n_diffsource' => array(
78 'exclude' => 0,
79 'config' => array(
80 'type' => 'passthrough'
81 )
82 ),
83 'hidden' => array(
84 'exclude' => 0,
85 'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.hidden',
86 'config' => array(
87 'type' => 'check',
88 'default' => '0'
89 )
90 ),
91 'uid_local' => array(
92 'exclude' => 0,
93 'label' => 'LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.uid_local',
94 'config' => array(
95 'type' => 'group',
96 'internal_type' => 'db',
97 'size' => 1,
98 'maxitems' => 1,
99 'minitems' => 0,
100 'allowed' => 'sys_file'
101 )
102 ),
103 'uid_foreign' => array(
104 'exclude' => 0,
105 'label' => 'LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.uid_foreign',
106 'config' => array(
107 'type' => 'input',
108 'size' => '10',
109 'eval' => 'int'
110 )
111 ),
112 'tablenames' => array(
113 'exclude' => 0,
114 'label' => 'LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.tablenames',
115 'config' => array(
116 'type' => 'input',
117 'size' => '30',
118 'eval' => 'trim'
119 )
120 ),
121 'fieldname' => array(
122 'exclude' => 0,
123 'label' => 'LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.fieldname',
124 'config' => array(
125 'type' => 'input',
126 'size' => '30'
127 )
128 ),
129 'sorting_foreign' => array(
130 'exclude' => 0,
131 'label' => 'LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.sorting_foreign',
132 'config' => array(
133 'type' => 'input',
134 'size' => '4',
135 'max' => '4',
136 'eval' => 'int',
137 'checkbox' => '0',
138 'range' => array(
139 'upper' => '1000',
140 'lower' => '10'
141 ),
142 'default' => 0
143 )
144 ),
145 'table_local' => array(
146 'exclude' => 0,
147 'label' => 'LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.table_local',
148 'config' => array(
149 'type' => 'input',
150 'size' => '20',
151 'default' => 'sys_file'
152 )
153 ),
154 'title' => array(
155 'l10n_mode' => 'prefixLangTitle',
156 'exclude' => 1,
157 'label' => 'LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.title',
158 'config' => array(
159 'type' => 'input',
160 'size' => '20',
161 'eval' => 'null',
162 'placeholder' => '__row|uid_local|metadata|title',
163 'mode' => 'useOrOverridePlaceholder',
164 'default' => NULL,
165 )
166 ),
167 'link' => array(
168 'exclude' => 1,
169 'label' => 'LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.link',
170 'config' => array(
171 'type' => 'input',
172 'size' => '20',
173 'wizards' => array(
174 '_PADDING' => 2,
175 'link' => array(
176 'type' => 'popup',
177 'title' => 'LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.link',
178 'icon' => 'link_popup.gif',
179 'module' => array(
180 'name' => 'wizard_element_browser',
181 'urlParameters' => array(
182 'mode' => 'wizard'
183 )
184 ),
185 'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1'
186 )
187 ),
188 'softref' => 'typolink'
189 )
190 ),
191 'description' => array(
192 // This is used for captions in the frontend
193 'l10n_mode' => 'prefixLangTitle',
194 'exclude' => 1,
195 'label' => 'LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.description',
196 'config' => array(
197 'type' => 'text',
198 'cols' => '20',
199 'rows' => '5',
200 'eval' => 'null',
201 'placeholder' => '__row|uid_local|metadata|description',
202 'mode' => 'useOrOverridePlaceholder',
203 'default' => NULL,
204 )
205 ),
206 'alternative' => array(
207 'l10n_mode' => 'prefixLangTitle',
208 'exclude' => 1,
209 'label' => 'LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.alternative',
210 'config' => array(
211 'type' => 'input',
212 'size' => '20',
213 'eval' => 'null',
214 'placeholder' => '__row|uid_local|metadata|alternative',
215 'mode' => 'useOrOverridePlaceholder',
216 'default' => NULL,
217 ),
218 ),
219 ),
220 'types' => array(
221 // Note that at the moment we define the same fields for every media type.
222 // We leave the extensive definition of each type here anyway, to make clear that you can use it to differentiate between the types.
223 '0' => array(
224 'showitem' => '
225 --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.basicoverlayPalette;basicoverlayPalette,
226 --palette--;;filePalette'
227 ),
228 \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => array(
229 'showitem' => '
230 --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.basicoverlayPalette;basicoverlayPalette,
231 --palette--;;filePalette'
232 ),
233 \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => array(
234 'showitem' => '
235 --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.basicoverlayPalette;basicoverlayPalette,
236 --palette--;;filePalette'
237 ),
238 \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => array(
239 'showitem' => '
240 --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.basicoverlayPalette;basicoverlayPalette,
241 --palette--;;filePalette'
242 ),
243 \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => array(
244 'showitem' => '
245 --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.basicoverlayPalette;basicoverlayPalette,
246 --palette--;;filePalette'
247 ),
248 \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => array(
249 'showitem' => '
250 --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.basicoverlayPalette;basicoverlayPalette,
251 --palette--;;filePalette'
252 )
253 ),
254 'palettes' => array(
255 // Used for basic overlays: having a file list etc
256 'basicoverlayPalette' => array(
257 'showitem' => 'title,description',
258 'canNotCollapse' => TRUE
259 ),
260 // Used for everything that is an image (because it has a link and a alternative text)
261 'imageoverlayPalette' => array(
262 'showitem' => '
263 title,alternative;;;;3-3-3,--linebreak--,
264 link,description
265 ',
266 'canNotCollapse' => TRUE
267 ),
268 // File palette, hidden but needs to be included all the time
269 'filePalette' => array(
270 'showitem' => 'uid_local, hidden, sys_language_uid, l10n_parent',
271 'isHiddenPalette' => TRUE
272 )
273 )
274 );