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