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