Added $Id$ keywords, cleaned up comment tags
[Packages/TYPO3.CMS.git] / t3lib / stddb / tables.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2003 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 */
84 $ICON_TYPES = Array();
85
86
87 /**
88 * Commonly used language labels which can be used in the $TCA array and elsewhere.
89 * Obsolete - just use the values of each entry directly.
90 *
91 * @depreciated
92 */
93 $LANG_GENERAL_LABELS = array(
94 'endtime' => 'LLL:EXT:lang/locallang_general.php:LGL.endtime',
95 'hidden' => 'LLL:EXT:lang/locallang_general.php:LGL.hidden',
96 'starttime' => 'LLL:EXT:lang/locallang_general.php:LGL.starttime',
97 'fe_group' => 'LLL:EXT:lang/locallang_general.php:LGL.fe_group',
98 'hide_at_login' => 'LLL:EXT:lang/locallang_general.php:LGL.hide_at_login',
99 'any_login' => 'LLL:EXT:lang/locallang_general.php:LGL.any_login',
100 'usergroups' => 'LLL:EXT:lang/locallang_general.php:LGL.usergroups',
101 );
102
103
104
105
106
107
108
109
110
111
112
113
114 /**
115 * $TCA:
116 * This array configures TYPO3 to work with the tables from the database by assigning meta information about data types, relations etc.
117 * The global variable $TCA will contain the information needed to recognize and render each table in the backend
118 * See documentation 'Inside TYPO3' for the syntax and list of required tables/fields!
119 *
120 * 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.
121 * The SQL definitions of these tables (and some more which are not defined in $TCA) is found in the file "tables.sql"
122 * 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"
123 *
124 * 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]
125 * 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
126 */
127 $TCA = array();
128
129 /**
130 * Table "pages":
131 * The mandatory pages table. The backbone of the TYPO3 page tree structure.
132 * All other records configured in $TCA must have a field, "pid", which relates the record to a page record's "uid" field.
133 * Must be COMPLETELY configured in tables.php
134 */
135 $TCA['pages'] = Array (
136 'ctrl' => Array (
137 'label' => 'title',
138 'tstamp' => 'tstamp',
139 'sortby' => 'sorting',
140 'title' => 'LLL:EXT:lang/locallang_tca.php:pages',
141 'type' => 'doktype',
142 'delete' => 'deleted',
143 'crdate' => 'crdate',
144 'hideAtCopy' => 1,
145 'prependAtCopy' => 'LLL:EXT:lang/locallang_general.php:LGL.prependAtCopy',
146 'cruser_id' => 'cruser_id',
147 'useColumnsForDefaultValues' => 'doktype'
148 ),
149 'interface' => Array (
150 'showRecordFieldList' => 'doktype,title',
151 'maxDBListItems' => 30,
152 'maxSingleDBListItems' => 50
153 ),
154 'columns' => Array (
155 'doktype' => Array (
156 'exclude' => 1,
157 'label' => 'LLL:EXT:lang/locallang_general.php:LGL.type',
158 'config' => Array (
159 'type' => 'select',
160 'items' => Array (
161 Array('LLL:EXT:lang/locallang_tca.php:doktype.I.0', '1'),
162 Array('LLL:EXT:lang/locallang_tca.php:doktype.I.1', '254'),
163 Array('LLL:EXT:lang/locallang_tca.php:doktype.I.2', '255')
164 ),
165 'default' => '1'
166 )
167 ),
168 'title' => Array (
169 'label' => 'LLL:EXT:lang/locallang_tca.php:title',
170 'config' => Array (
171 'type' => 'input',
172 'size' => '30',
173 'max' => '256',
174 'eval' => 'required'
175 )
176 ),
177 'TSconfig' => Array (
178 'exclude' => 1,
179 'label' => 'TSconfig:',
180 'config' => Array (
181 'type' => 'text',
182 'cols' => '40',
183 'rows' => '5',
184 'wizards' => Array(
185 '_PADDING' => 4,
186 '0' => Array(
187 'type' => t3lib_extMgm::isLoaded('tsconfig_help')?'popup':'',
188 'title' => 'TSconfig QuickReference',
189 'script' => 'wizard_tsconfig.php?mode=page',
190 'icon' => 'wizard_tsconfig.gif',
191 'JSopenParams' => 'height=500,width=780,status=0,menubar=0,scrollbars=1',
192 )
193 )
194 )
195 ),
196 'php_tree_stop' => Array (
197 'exclude' => 1,
198 'label' => 'LLL:EXT:lang/locallang_tca.php:php_tree_stop',
199 'config' => Array (
200 'type' => 'check'
201 )
202 ),
203 'is_siteroot' => Array (
204 'exclude' => 1,
205 'label' => 'LLL:EXT:lang/locallang_tca.php:is_siteroot',
206 'config' => Array (
207 'type' => 'check'
208 )
209 ),
210 'storage_pid' => Array (
211 'exclude' => 1,
212 'label' => 'LLL:EXT:lang/locallang_tca.php:storage_pid',
213 'config' => Array (
214 'type' => 'group',
215 'internal_type' => 'db',
216 'allowed' => 'pages',
217 'size' => '1',
218 'maxitems' => '1',
219 'minitems' => '0',
220 'show_thumbs' => '1'
221 )
222 ),
223 'tx_impexp_origuid' => Array('config'=>array('type'=>'passthrough')),
224 ),
225 'types' => Array (
226 '1' => Array('showitem' => 'doktype, title, TSconfig;;6;nowrap, storage_pid;;7'),
227 '254' => Array('showitem' => 'doktype, title;LLL:EXT:lang/locallang_general.php:LGL.title, TSconfig;;6;nowrap, storage_pid;;7'),
228 '255' => Array('showitem' => 'doktype, title, TSconfig;;6;nowrap, storage_pid;;7')
229 ),
230 'palettes' => Array (
231 '6' => Array('showitem' => 'php_tree_stop'),
232 '7' => Array('showitem' => 'is_siteroot')
233 )
234 );
235
236 /**
237 * Table "be_users":
238 * Backend Users for TYPO3.
239 * This is only the 'header' part (ctrl). The full configuration is found in t3lib/stddb/tbl_be.php
240 */
241 $TCA['be_users'] = Array (
242 'ctrl' => Array (
243 'label' => 'username',
244 'tstamp' => 'tstamp',
245 'title' => 'LLL:EXT:lang/locallang_tca.php:be_users',
246 'crdate' => 'crdate',
247 'cruser_id' => 'cruser_id',
248 'delete' => 'deleted',
249 'adminOnly' => 1, // Only admin users can edit
250 'rootLevel' => 1,
251 'default_sortby' => 'ORDER BY admin, username',
252 'enablecolumns' => Array (
253 'disabled' => 'disable',
254 'starttime' => 'starttime',
255 'endtime' => 'endtime'
256 ),
257 'type' => 'admin',
258 'typeicon_column' => 'admin',
259 'typeicons' => Array (
260 '0' => 'be_users.gif',
261 '1' => 'be_users_admin.gif'
262 ),
263 'mainpalette' => '1',
264 'useColumnsForDefaultValues' => 'usergroup,lockToDomain,options,db_mountpoints,file_mountpoints,fileoper_perms,userMods',
265 'dynamicConfigFile' => 'T3LIB:tbl_be.php'
266 )
267 );
268
269 /**
270 * Table "be_groups":
271 * Backend Usergroups for TYPO3.
272 * This is only the 'header' part (ctrl). The full configuration is found in t3lib/stddb/tbl_be.php
273 */
274 $TCA['be_groups'] = Array (
275 'ctrl' => Array (
276 'label' => 'title',
277 'tstamp' => 'tstamp',
278 'crdate' => 'crdate',
279 'cruser_id' => 'cruser_id',
280 'delete' => 'deleted',
281 'default_sortby' => 'ORDER BY title',
282 'prependAtCopy' => 'LLL:EXT:lang/locallang_general.php:LGL.prependAtCopy',
283 'adminOnly' => 1,
284 'rootLevel' => 1,
285 'type' => 'inc_access_lists',
286 'typeicon_column' => 'inc_access_lists',
287 'typeicons' => Array (
288 '1' => 'be_groups_lists.gif'
289 ),
290 'enablecolumns' => Array (
291 'disabled' => 'hidden'
292 ),
293 'title' => 'LLL:EXT:lang/locallang_tca.php:be_groups',
294 'useColumnsForDefaultValues' => 'lockToDomain',
295 'dynamicConfigFile' => 'T3LIB:tbl_be.php'
296 )
297 );
298
299 /**
300 * Table "sys_filemounts":
301 * Defines filepaths on the server which can be mounted for users so they can upload and manage files online by eg. the Filelist module
302 * This is only the 'header' part (ctrl). The full configuration is found in t3lib/stddb/tbl_be.php
303 */
304 $TCA['sys_filemounts'] = Array (
305 'ctrl' => Array (
306 'label' => 'title',
307 'tstamp' => 'tstamp',
308 'prependAtCopy' => 'LLL:EXT:lang/locallang_general.php:LGL.prependAtCopy',
309 'title' => 'LLL:EXT:lang/locallang_tca.php:sys_filemounts',
310 'adminOnly' => 1,
311 'rootLevel' => 1,
312 'delete' => 'deleted',
313 'enablecolumns' => Array (
314 'disabled' => 'hidden'
315 ),
316 'iconfile' => '_icon_ftp.gif',
317 'useColumnsForDefaultValues' => 'path,base',
318 'dynamicConfigFile' => 'T3LIB:tbl_be.php'
319 )
320 );
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335 /**
336 * $TBE_MODULES contains the structure of the backend modules as they are arranged in main- and sub-modules.
337 * 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
338 * For information about adding modules to TYPO3 you should consult the documentation found in "Inside TYPO3"
339 */
340 $TBE_MODULES = Array (
341 'web' => 'list,info,perm,func',
342 'file' => 'list',
343 'doc' => '', // This should always be empty!
344 'user' => '',
345 'tools' => 'em',
346 'help' => 'about'
347 );
348
349
350 /**
351 * $TBE_STYLES configures backend styles and colors; Basically this contains all the values that can be used to create new skins for TYPO3.
352 * For information about making skins to TYPO3 you should consult the documentation found in "Inside TYPO3"
353 */
354 $TBE_STYLES = array(
355 'colorschemes' => Array (
356 '0' => '#E4E0DB,#CBC7C3,#EDE9E5',
357 ),
358 'borderschemes' => Array (
359 '0' => array('border:solid 1px black;',5)
360 )
361 );
362
363
364 /**
365 * Setting up $TCA_DESCR - Context Sensitive Help (CSH)
366 * For information about using the CSH API in TYPO3 you should consult the documentation found in "Inside TYPO3"
367 */
368 t3lib_extMgm::addLLrefForTCAdescr('pages','EXT:lang/locallang_csh_pages.php');
369 t3lib_extMgm::addLLrefForTCAdescr('be_users','EXT:lang/locallang_csh_be_users.php');
370 t3lib_extMgm::addLLrefForTCAdescr('be_groups','EXT:lang/locallang_csh_be_groups.php');
371 t3lib_extMgm::addLLrefForTCAdescr('sys_filemounts','EXT:lang/locallang_csh_sysfilem.php');
372 t3lib_extMgm::addLLrefForTCAdescr('_MOD_tools_em','EXT:lang/locallang_csh_em.php'); // Extension manager
373
374
375 /**
376 * $FILEICONS defines icons for the various file-formats
377 */
378 $FILEICONS = Array (
379 'txt' => 'txt.gif',
380 'pdf' => 'pdf.gif',
381 'doc' => 'doc.gif',
382 'ai' => 'ai.gif',
383 'bmp' => 'bmp.gif',
384 'tif' => 'tif.gif',
385 'htm' => 'html1.gif',
386 'html' => 'html1.gif',
387 'pcd' => 'pcd.gif',
388 'gif' => 'gif.gif',
389 'jpg' => 'jpg.gif',
390 'jpeg' => 'jpg.gif',
391 'mpg' => 'mpeg.gif',
392 'mpeg' => 'mpeg.gif',
393 'exe' => 'exe.gif',
394 'com' => 'exe.gif',
395 'zip' => 'zip.gif',
396 'tgz' => 'zip.gif',
397 'gz' => 'zip.gif',
398 'php3' => 'php3.gif',
399 'php' => 'php3.gif',
400 'ttf' => 'ttf.gif',
401 'pcx' => 'pcx.gif',
402 'png' => 'png.gif',
403 'tga' => 'tga.gif',
404 'class' => 'java.gif',
405 'sxc' => 'sxc.gif',
406 'sxw' => 'sxw.gif',
407 'xls' => 'xls.gif',
408 'swf' => 'flash.gif',
409 'swa' => 'flash.gif',
410 'dcr' => 'flash.gif',
411 'wav' => 'wav.gif',
412 'mp3' => 'wav.gif',
413 'avi' => 'avi.gif',
414 'au' => 'au.gif',
415 'mov' => 'mov.gif',
416 'default' => 'default.gif'
417 );
418
419 /**
420 * Init services array:
421 */
422 $T3_SERVICES = array();
423 ?>