Implemented versioning API, phase 1 (tcemain). See changelog
[Packages/TYPO3.CMS.git] / t3lib / stddb / tables.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2004 Kasper Skaarhoj (kasper@typo3.com)
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
18 *
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * Contains the initialization of global TYPO3 variables among which $TCA is the most significant.
29 *
30 * The list in order of apperance is: $PAGES_TYPES, $ICON_TYPES, $LANG_GENERAL_LABELS, $TCA, $TBE_MODULES, $TBE_STYLES, $FILEICONS
31 * These variables are first of all used in the backend but to some degree in the frontend as well. (See references)
32 * See the document "Inside TYPO3" for a description of each variable in addition to the comment associated with each.
33 *
34 * This file is included from "typo3/init.php" (backend) and "index_ts.php" (frontend) as the first file of a three-fold inclusion session (see references):
35 * 1) First this script is included (unless the constant "TYPO3_tables_script" instructs another filename to substitute it, see t3lib/config_default.php); This should initialize the variables shown above.
36 * 2) Then either the "typo3conf/temp_CACHED_??????_ext_tables.php" cache file OR "stddb/load_ext_tables.php" is included in order to let extensions add/modify these variables as they desire.
37 * 3) Finally if the constant "TYPO3_extTableDef_script" defines a file name from typo3conf/ it is included, also for overriding values (the old-school way before extensions came in). See config_default.php
38 *
39 * Configuration in this file should NOT be edited directly. If you would like to alter
40 * or extend this information, please make an extension which does so.
41 * Thus you preserve backwards compatibility.
42 *
43 *
44 * $Id$
45 * Revised for TYPO3 3.6 July/2003 by Kasper Skaarhoj
46 *
47 * @author Kasper Skaarhoj <kasper@typo3.com>
48 * @see tslib_fe::includeTCA(), typo3/init.php, t3lib/stddb/load_ext_tables.php
49 * @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=262&cHash=4f12caa011
50 */
51
52
53 /**
54 * $PAGES_TYPES defines the various types of pages (field: doktype) the system can handle and what restrictions may apply to them.
55 * Here you can set the icon and especially you can define which tables are allowed on a certain pagetype (doktype)
56 * NOTE: The 'default' entry in the $PAGES_TYPES-array is the 'base' for all types, and for every type the entries simply overrides the entries in the 'default' type!
57 */
58 $PAGES_TYPES = Array(
59 '254' => Array( // Doktype 254 is a 'sysFolder' - a general purpose storage folder for whatever you like. In CMS context it's NOT a viewable page. Can contain any element.
60 'type' => 'sys',
61 'icon' => 'sysf.gif',
62 'allowedTables' => '*'
63 ),
64 '255' => Array( // Doktype 255 is a recycle-bin.
65 'type' => 'sys',
66 'icon' => 'recycler.gif',
67 'allowedTables' => '*'
68 ),
69 'default' => Array(
70 'type' => 'web',
71 'icon' => 'pages.gif',
72 'allowedTables' => 'pages',
73 'onlyAllowedTables' => '0'
74 )
75 );
76
77
78 /**
79 * With $ICON_TYPES you can assign alternative icons to pages records based on another field than 'doktype'
80 * Each key is a value from the "module" field of page records and the value is an array with a key/value pair, eg. "icon" => "modules_shop.gif"
81 *
82 * @see t3lib_iconWorks::getIcon(), typo3/sysext/cms/ext_tables.php
83 * @deprecated
84 */
85 $ICON_TYPES = Array();
86
87
88 /**
89 * Commonly used language labels which can be used in the $TCA array and elsewhere.
90 * Obsolete - just use the values of each entry directly.
91 *
92 * @deprecated
93 */
94 $LANG_GENERAL_LABELS = array(
95 'endtime' => 'LLL:EXT:lang/locallang_general.php:LGL.endtime',
96 'hidden' => 'LLL:EXT:lang/locallang_general.php:LGL.hidden',
97 'starttime' => 'LLL:EXT:lang/locallang_general.php:LGL.starttime',
98 'fe_group' => 'LLL:EXT:lang/locallang_general.php:LGL.fe_group',
99 'hide_at_login' => 'LLL:EXT:lang/locallang_general.php:LGL.hide_at_login',
100 'any_login' => 'LLL:EXT:lang/locallang_general.php:LGL.any_login',
101 'usergroups' => 'LLL:EXT:lang/locallang_general.php:LGL.usergroups',
102 );
103
104
105
106
107
108
109
110
111
112
113
114
115 /**
116 * $TCA:
117 * This array configures TYPO3 to work with the tables from the database by assigning meta information about data types, relations etc.
118 * The global variable $TCA will contain the information needed to recognize and render each table in the backend
119 * See documentation 'Inside TYPO3' for the syntax and list of required tables/fields!
120 *
121 * The tables configured in this document (and backed up by "tbl_be.php") is the required minimum set of tables/field that any TYPO3 system MUST have. These tables are therefore a part of the TYPO3 core.
122 * The SQL definitions of these tables (and some more which are not defined in $TCA) is found in the file "tables.sql"
123 * Only the "pages" table is defined fully in this file - the others are only defined for the "ctrl" part and the columns are defined in detail in the associated file, "tbl_be.php"
124 *
125 * NOTE: The (default) icon for a table is defined 1) as a giffile named 'gfx/i/[tablename].gif' or 2) as the value of [table][ctrl][iconfile]
126 * NOTE: [table][ctrl][rootLevel] goes NOT for pages. Apart from that if rootLevel is true, records can ONLY be created on rootLevel. If it's false records can ONLY be created OUTSIDE rootLevel
127 */
128 $TCA = array();
129
130 /**
131 * Table "pages":
132 * The mandatory pages table. The backbone of the TYPO3 page tree structure.
133 * All other records configured in $TCA must have a field, "pid", which relates the record to a page record's "uid" field.
134 * Must be COMPLETELY configured in tables.php
135 */
136 $TCA['pages'] = Array (
137 'ctrl' => Array (
138 'label' => 'title',
139 'tstamp' => 'tstamp',
140 'sortby' => 'sorting',
141 'title' => 'LLL:EXT:lang/locallang_tca.php:pages',
142 'type' => 'doktype',
143 'versioning' => TRUE,
144 'delete' => 'deleted',
145 'crdate' => 'crdate',
146 'hideAtCopy' => 1,
147 'prependAtCopy' => 'LLL:EXT:lang/locallang_general.php:LGL.prependAtCopy',
148 'cruser_id' => 'cruser_id',
149 'editlock' => 'editlock',
150 'useColumnsForDefaultValues' => 'doktype'
151 ),
152 'interface' => Array (
153 'showRecordFieldList' => 'doktype,title',
154 'maxDBListItems' => 30,
155 'maxSingleDBListItems' => 50
156 ),
157 'columns' => Array (
158 'doktype' => Array (
159 'exclude' => 1,
160 'label' => 'LLL:EXT:lang/locallang_general.php:LGL.type',
161 'config' => Array (
162 'type' => 'select',
163 'items' => Array (
164 Array('LLL:EXT:lang/locallang_tca.php:doktype.I.0', '1'),
165 Array('LLL:EXT:lang/locallang_tca.php:doktype.I.1', '254'),
166 Array('LLL:EXT:lang/locallang_tca.php:doktype.I.2', '255')
167 ),
168 'default' => '1'
169 )
170 ),
171 'title' => Array (
172 'label' => 'LLL:EXT:lang/locallang_tca.php:title',
173 'config' => Array (
174 'type' => 'input',
175 'size' => '30',
176 'max' => '256',
177 'eval' => 'required'
178 )
179 ),
180 'TSconfig' => Array (
181 'exclude' => 1,
182 'label' => 'TSconfig:',
183 'config' => Array (
184 'type' => 'text',
185 'cols' => '40',
186 'rows' => '5',
187 'wizards' => Array(
188 '_PADDING' => 4,
189 '0' => Array(
190 'type' => t3lib_extMgm::isLoaded('tsconfig_help')?'popup':'',
191 'title' => 'TSconfig QuickReference',
192 'script' => 'wizard_tsconfig.php?mode=page',
193 'icon' => 'wizard_tsconfig.gif',
194 'JSopenParams' => 'height=500,width=780,status=0,menubar=0,scrollbars=1',
195 )
196 )
197 )
198 ),
199 'php_tree_stop' => Array (
200 'exclude' => 1,
201 'label' => 'LLL:EXT:lang/locallang_tca.php:php_tree_stop',
202 'config' => Array (
203 'type' => 'check'
204 )
205 ),
206 'is_siteroot' => Array (
207 'exclude' => 1,
208 'label' => 'LLL:EXT:lang/locallang_tca.php:is_siteroot',
209 'config' => Array (
210 'type' => 'check'
211 )
212 ),
213 'storage_pid' => Array (
214 'exclude' => 1,
215 'label' => 'LLL:EXT:lang/locallang_tca.php:storage_pid',
216 'config' => Array (
217 'type' => 'group',
218 'internal_type' => 'db',
219 'allowed' => 'pages',
220 'size' => '1',
221 'maxitems' => '1',
222 'minitems' => '0',
223 'show_thumbs' => '1'
224 )
225 ),
226 'tx_impexp_origuid' => Array('config'=>array('type'=>'passthrough')),
227 't3ver_label' => Array (
228 'label' => 'LLL:EXT:lang/locallang_general.php:LGL.versionLabel',
229 'config' => Array (
230 'type' => 'input',
231 'size' => '30',
232 'max' => '30',
233 )
234 ),
235 'editlock' => Array (
236 'exclude' => 1,
237 'label' => 'LLL:EXT:lang/locallang_tca.php:editlock',
238 'config' => Array (
239 'type' => 'check'
240 )
241 ),
242 ),
243 'types' => Array (
244 '1' => Array('showitem' => 'doktype, title, TSconfig;;6;nowrap, storage_pid;;7'),
245 '254' => Array('showitem' => 'doktype, title;LLL:EXT:lang/locallang_general.php:LGL.title, TSconfig;;6;nowrap, storage_pid;;7'),
246 '255' => Array('showitem' => 'doktype, title, TSconfig;;6;nowrap, storage_pid;;7')
247 ),
248 'palettes' => Array (
249 '6' => Array('showitem' => 'php_tree_stop, editlock'),
250 '7' => Array('showitem' => 'is_siteroot')
251 )
252 );
253
254 /**
255 * Table "be_users":
256 * Backend Users for TYPO3.
257 * This is only the 'header' part (ctrl). The full configuration is found in t3lib/stddb/tbl_be.php
258 */
259 $TCA['be_users'] = Array (
260 'ctrl' => Array (
261 'label' => 'username',
262 'tstamp' => 'tstamp',
263 'title' => 'LLL:EXT:lang/locallang_tca.php:be_users',
264 'crdate' => 'crdate',
265 'cruser_id' => 'cruser_id',
266 'delete' => 'deleted',
267 'adminOnly' => 1, // Only admin users can edit
268 'rootLevel' => 1,
269 'default_sortby' => 'ORDER BY admin, username',
270 'enablecolumns' => Array (
271 'disabled' => 'disable',
272 'starttime' => 'starttime',
273 'endtime' => 'endtime'
274 ),
275 'type' => 'admin',
276 'typeicon_column' => 'admin',
277 'typeicons' => Array (
278 '0' => 'be_users.gif',
279 '1' => 'be_users_admin.gif'
280 ),
281 'mainpalette' => '1',
282 'useColumnsForDefaultValues' => 'usergroup,lockToDomain,options,db_mountpoints,file_mountpoints,fileoper_perms,userMods',
283 'dynamicConfigFile' => 'T3LIB:tbl_be.php'
284 )
285 );
286
287 /**
288 * Table "be_groups":
289 * Backend Usergroups for TYPO3.
290 * This is only the 'header' part (ctrl). The full configuration is found in t3lib/stddb/tbl_be.php
291 */
292 $TCA['be_groups'] = Array (
293 'ctrl' => Array (
294 'label' => 'title',
295 'tstamp' => 'tstamp',
296 'crdate' => 'crdate',
297 'cruser_id' => 'cruser_id',
298 'delete' => 'deleted',
299 'default_sortby' => 'ORDER BY title',
300 'prependAtCopy' => 'LLL:EXT:lang/locallang_general.php:LGL.prependAtCopy',
301 'adminOnly' => 1,
302 'rootLevel' => 1,
303 'type' => 'inc_access_lists',
304 'typeicon_column' => 'inc_access_lists',
305 'typeicons' => Array (
306 '1' => 'be_groups_lists.gif'
307 ),
308 'enablecolumns' => Array (
309 'disabled' => 'hidden'
310 ),
311 'title' => 'LLL:EXT:lang/locallang_tca.php:be_groups',
312 'useColumnsForDefaultValues' => 'lockToDomain',
313 'dynamicConfigFile' => 'T3LIB:tbl_be.php'
314 )
315 );
316
317 /**
318 * Table "sys_filemounts":
319 * Defines filepaths on the server which can be mounted for users so they can upload and manage files online by eg. the Filelist module
320 * This is only the 'header' part (ctrl). The full configuration is found in t3lib/stddb/tbl_be.php
321 */
322 $TCA['sys_filemounts'] = Array (
323 'ctrl' => Array (
324 'label' => 'title',
325 'tstamp' => 'tstamp',
326 'prependAtCopy' => 'LLL:EXT:lang/locallang_general.php:LGL.prependAtCopy',
327 'title' => 'LLL:EXT:lang/locallang_tca.php:sys_filemounts',
328 'adminOnly' => 1,
329 'rootLevel' => 1,
330 'delete' => 'deleted',
331 'enablecolumns' => Array (
332 'disabled' => 'hidden'
333 ),
334 'iconfile' => '_icon_ftp.gif',
335 'useColumnsForDefaultValues' => 'path,base',
336 'dynamicConfigFile' => 'T3LIB:tbl_be.php'
337 )
338 );
339
340 /**
341 * Table "sys_languages":
342 * Defines possible languages used for translation of records in the system
343 * This is only the 'header' part (ctrl). The full configuration is found in t3lib/stddb/tbl_be.php
344 */
345 $TCA['sys_language'] = Array (
346 'ctrl' => Array (
347 'label' => 'title',
348 'tstamp' => 'tstamp',
349 'default_sortby' => 'ORDER BY title',
350 'title' => 'LLL:EXT:lang/locallang_tca.php:sys_language',
351 'adminOnly' => 1,
352 'rootLevel' => 1,
353 'enablecolumns' => Array (
354 'disabled' => 'hidden'
355 ),
356 'dynamicConfigFile' => 'T3LIB:tbl_be.php'
357 )
358 );
359
360
361
362
363
364
365
366
367
368
369
370
371 /**
372 * $TBE_MODULES contains the structure of the backend modules as they are arranged in main- and sub-modules.
373 * Every entry in this array represents a menu item on either first (key) or second level (value from list) in the left menu in the TYPO3 backend
374 * For information about adding modules to TYPO3 you should consult the documentation found in "Inside TYPO3"
375 */
376 $TBE_MODULES = Array (
377 'web' => 'list,info,perm,func',
378 'file' => 'list',
379 'txdamM1' => '',
380 'doc' => '', // This should always be empty!
381 'user' => '',
382 'tools' => 'em',
383 'help' => 'about,cshmanual'
384 );
385
386
387 /**
388 * $TBE_STYLES configures backend styles and colors; Basically this contains all the values that can be used to create new skins for TYPO3.
389 * For information about making skins to TYPO3 you should consult the documentation found in "Inside TYPO3"
390 */
391 $TBE_STYLES = array(
392 'colorschemes' => Array (
393 '0' => '#E4E0DB,#CBC7C3,#EDE9E5',
394 ),
395 'borderschemes' => Array (
396 '0' => array('border:solid 1px black;',5)
397 )
398 );
399
400
401 /**
402 * Setting up $TCA_DESCR - Context Sensitive Help (CSH)
403 * For information about using the CSH API in TYPO3 you should consult the documentation found in "Inside TYPO3"
404 */
405 t3lib_extMgm::addLLrefForTCAdescr('pages','EXT:lang/locallang_csh_pages.xml');
406 t3lib_extMgm::addLLrefForTCAdescr('be_users','EXT:lang/locallang_csh_be_users.xml');
407 t3lib_extMgm::addLLrefForTCAdescr('be_groups','EXT:lang/locallang_csh_be_groups.xml');
408 t3lib_extMgm::addLLrefForTCAdescr('sys_filemounts','EXT:lang/locallang_csh_sysfilem.xml');
409 t3lib_extMgm::addLLrefForTCAdescr('sys_language','EXT:lang/locallang_csh_syslang.xml');
410 t3lib_extMgm::addLLrefForTCAdescr('xMOD_csh_corebe','EXT:lang/locallang_csh_corebe.xml'); // General Core
411 t3lib_extMgm::addLLrefForTCAdescr('_MOD_tools_em','EXT:lang/locallang_csh_em.xml'); // Extension manager
412 t3lib_extMgm::addLLrefForTCAdescr('_MOD_web_info','EXT:lang/locallang_csh_web_info.xml'); // Web > Info
413 t3lib_extMgm::addLLrefForTCAdescr('_MOD_web_func','EXT:lang/locallang_csh_web_func.xml'); // Web > Func
414
415
416 /**
417 * $FILEICONS defines icons for the various file-formats
418 */
419 $FILEICONS = Array (
420 'txt' => 'txt.gif',
421 'pdf' => 'pdf.gif',
422 'doc' => 'doc.gif',
423 'ai' => 'ai.gif',
424 'bmp' => 'bmp.gif',
425 'tif' => 'tif.gif',
426 'htm' => 'htm.gif',
427 'html' => 'html.gif',
428 'pcd' => 'pcd.gif',
429 'gif' => 'gif.gif',
430 'jpg' => 'jpg.gif',
431 'jpeg' => 'jpg.gif',
432 'mpg' => 'mpg.gif',
433 'mpeg' => 'mpeg.gif',
434 'exe' => 'exe.gif',
435 'com' => 'exe.gif',
436 'zip' => 'zip.gif',
437 'tgz' => 'zip.gif',
438 'gz' => 'zip.gif',
439 'php3' => 'php3.gif',
440 'php' => 'php3.gif',
441 'ttf' => 'ttf.gif',
442 'pcx' => 'pcx.gif',
443 'png' => 'png.gif',
444 'tga' => 'tga.gif',
445 'class' => 'java.gif',
446 'sxc' => 'sxc.gif',
447 'sxw' => 'sxw.gif',
448 'xls' => 'xls.gif',
449 'swf' => 'swf.gif',
450 'swa' => 'flash.gif',
451 'dcr' => 'flash.gif',
452 'wav' => 'wav.gif',
453 'mp3' => 'wav.gif',
454 'avi' => 'avi.gif',
455 'au' => 'au.gif',
456 'mov' => 'mov.gif',
457 '3ds' => '3ds.gif',
458 'csv' => 'csv.gif',
459 'ico' => 'ico.gif',
460 'max' => 'max.gif',
461 'ps' => 'ps.gif',
462 'tmpl' => 'tmpl.gif',
463 'xls' => 'xls.gif',
464 'fh3' => 'fh3.gif',
465 'inc' => 'inc.gif',
466 'mid' => 'mid.gif',
467 'psd' => 'psd.gif',
468 'xml' => 'xml.gif',
469 'rtf' => 'rtf.gif',
470 't3x' => 't3x.gif',
471 't3d' => 't3d.gif',
472 'cdr' => 'cdr.gif',
473 'dtd' => 'dtd.gif',
474 'sgml' => 'sgml.gif',
475 'ani' => 'ani.gif',
476 'css' => 'css.gif',
477 'eps' => 'eps.gif',
478 'js' => 'js.gif',
479 'wrl' => 'wrl.gif',
480 'default' => 'default.gif'
481 );
482
483
484
485
486 ?>