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