xref: /dokuwiki/lib/plugins/config/settings/config.metadata.php (revision 306ca8aa54954ea2623d9e4927a2c07b9efdfea3)
1<?php
2/**
3 * Metadata for configuration manager plugin
4 *
5 * Note:  This file should be included within a function to ensure it
6 *        doesn't clash with the settings it is describing.
7 *
8 * Format:
9 *   $meta[<setting name>] = array(<handler class id>,<param name> => <param value>);
10 *
11 *   <handler class id>  is the handler class name without the "setting_" prefix
12 *
13 * Defined classes:
14 *   Generic (source: settings/config.class.php)
15 *   -------------------------------------------
16 *   ''             - default class ('setting'), textarea, minimal input validation, setting output in quotes
17 *   'string'       - single line text input, minimal input validation, setting output in quotes
18 *   'numeric'      - text input, accepts numbers and arithmetic operators, setting output without quotes
19 *   'onoff'        - checkbox input, setting output  0|1
20 *   'multichoice'  - select input (single choice), setting output with quotes, required _choices parameter
21 *   'email'        - text input, input must conform to email address format, setting output in quotes
22 *   'password'     - password input, minimal input validation, setting output plain text in quotes
23 *   'dirchoice'    - as multichoice, selection choices based on folders found at location specified in _dir
24 *                    parameter (required)
25 *   'multicheckbox'- a checkbox for each choice plus an "other" string input, config file setting is a comma
26 *                    separated list of checked choices
27 *   'fieldset'     - used to group configuration settings, but is not itself a setting. To make this clear in
28 *                    the language files the keys for this type should start with '_'.
29 *
30 *  Single Setting (source: settings/extra.class.php)
31 *  -------------------------------------------------
32 *   'savedir'     - as 'setting', input tested against initpath() (inc/init.php)
33 *   'sepchar'     - as multichoice, selection constructed from string of valid values
34 *   'authtype'    - as 'setting', input validated against a valid php file at expected location for auth files
35 *   'im_convert'  - as 'setting', input must exist and be an im_convert module
36 *   'disableactions' - as 'setting'
37 *
38 *  Any setting commented or missing will use 'setting' class - text input, minimal validation, quoted output
39 *
40 * Defined parameters:
41 *   '_pattern'    - string, a preg pattern. input is tested against this pattern before being accepted
42 *                   optional all classes, except onoff, multichoice & dirchoice which ignore it
43 *   '_choices'    - array of choices. used to populate a selection box. choice will be replaced by a localised
44 *                   language string, indexed by  <setting name>_o_<choice>, if one exists
45 *                   required by 'multichoice' & 'multicheckbox' classes, ignored by others
46 *   '_dir'        - location of directory to be used to populate choice list
47 *                   required by 'dirchoice' class, ignored by other classes
48 *   '_combine'    - complimentary output setting values which can be combined into a single display checkbox
49 *                   optional for 'multicheckbox', ignored by other classes
50 *
51 * @author    Chris Smith <chris@jalakai.co.uk>
52 */
53// ---------------[ settings for settings ]------------------------------
54$config['format']  = 'php';      // format of setting files, supported formats: php
55$config['varname'] = 'conf';     // name of the config variable, sans $
56
57// this string is written at the top of the rewritten settings file,
58// !! do not include any comment indicators !!
59// this value can be overriden when calling save_settings() method
60$config['heading'] = 'Dokuwiki\'s Main Configuration File - Local Settings';
61
62// ---------------[ setting files ]--------------------------------------
63// these values can be string expressions, they will be eval'd before use
64$file['local']     = "DOKU_CONF.'local.php'";            // mandatory (file doesn't have to exist)
65$file['default']   = "DOKU_CONF.'dokuwiki.php'";         // optional
66$file['protected'] = "DOKU_CONF.'local.protected.php'";  // optional
67
68// test value (FIXME, remove before publishing)
69//$meta['test']     = array('multichoice','_choices' => array(''));
70
71// --------------[ setting metadata ]------------------------------------
72// - for description of format and fields see top of file
73// - order the settings in the order you wish them to appear
74// - any settings not mentioned will come after the last setting listed and
75//   will use the default class with no parameters
76
77$meta['_basic']   = array('fieldset');
78$meta['title']    = array('string');
79$meta['start']    = array('string');
80$meta['lang']     = array('dirchoice','_dir' => DOKU_INC.'inc/lang/');
81$meta['template'] = array('dirchoice','_dir' => DOKU_INC.'lib/tpl/');
82$meta['savedir']  = array('savedir');
83$meta['basedir']  = array('string');
84$meta['baseurl']  = array('string');
85$meta['dmode']    = array('numeric','_pattern' => '/0[0-7]{3}/');  // only accept octal representation
86$meta['fmode']    = array('numeric','_pattern' => '/0[0-7]{3}/');  // only accept octal representation
87$meta['allowdebug']  = array('onoff');
88
89$meta['_display']    = array('fieldset');
90$meta['recent']      = array('numeric');
91$meta['breadcrumbs'] = array('numeric');
92$meta['youarehere']  = array('onoff');
93$meta['fullpath']    = array('onoff');
94$meta['typography']  = array('onoff');
95$meta['dformat']     = array('string');
96$meta['signature']   = array('string');
97$meta['toptoclevel'] = array('multichoice','_choices' => array(1,2,3,4,5));   // 5 toc levels
98$meta['maxtoclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5));
99$meta['maxseclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5)); // 0 for no sec edit buttons
100$meta['camelcase']   = array('onoff');
101$meta['deaccent']    = array('multichoice','_choices' => array(0,1,2));
102$meta['useheading']  = array('onoff');
103$meta['refcheck']    = array('onoff');
104$meta['refshow']     = array('numeric');
105
106$meta['_authentication'] = array('fieldset');
107$meta['useacl']      = array('onoff');
108$meta['autopasswd']  = array('onoff');
109$meta['authtype']    = array('authtype');
110$meta['passcrypt']   = array('multichoice','_choices' => array('smd5','md5','sha1','ssha','crypt','mysql','my411'));
111$meta['defaultgroup']= array('string');
112$meta['superuser']   = array('string');
113$meta['profileconfirm'] = array('onoff');
114$meta['registernotify'] = array('email');
115$meta['disableactions'] = array('disableactions',
116                                '_choices' => array('backlink','index','recent','revisions','search','subscription','register','resendpwd','profile','edit','wikicode','check'),
117                                '_combine' => array('subscription' => array('subscribe','unsubscribe'), 'wikicode' => array('source','export_raw')));
118
119$meta['_anti_spam']  = array('fieldset');
120$meta['usewordblock']= array('onoff');
121$meta['relnofollow'] = array('onoff');
122$meta['indexdelay']  = array('numeric');
123$meta['mailguard']   = array('multichoice','_choices' => array('visible','hex','none'));
124
125$meta['_editing']    = array('fieldset');
126$meta['usedraft']    = array('onoff');
127$meta['spellchecker']= array('onoff');
128$meta['htmlok']      = array('onoff');
129$meta['phpok']       = array('onoff');
130$meta['notify']      = array('email');
131$meta['subscribers'] = array('onoff');
132$meta['purgeonadd']  = array('onoff');
133$meta['locktime']    = array('numeric');
134$meta['cachetime']   = array('numeric');
135
136$meta['_links']    = array('fieldset');
137$meta['target____wiki']      = array('string');
138$meta['target____interwiki'] = array('string');
139$meta['target____extern']    = array('string');
140$meta['target____media']     = array('string');
141$meta['target____windows']   = array('string');
142
143$meta['_media']      = array('fieldset');
144$meta['gdlib']       = array('multichoice','_choices' => array(0,1,2));
145$meta['im_convert']  = array('im_convert');
146$meta['jpg_quality'] = array('numeric','_pattern' => '/^100$|^[1-9]?[0-9]$/');  //(0-100)
147$meta['fetchsize']   = array('numeric');
148
149$meta['_advanced']   = array('fieldset');
150$meta['userewrite']  = array('multichoice','_choices' => array(0,1,2));
151$meta['useslash']    = array('onoff');
152$meta['sepchar']     = array('sepchar');
153$meta['canonical']   = array('onoff');
154$meta['autoplural']  = array('onoff');
155$meta['mailfrom']    = array('email');
156$meta['compress']    = array('onoff');
157$meta['gzip_output'] = array('onoff');
158$meta['hidepages']   = array('string');
159$meta['send404']     = array('onoff');
160$meta['usegzip']     = array('onoff');
161$meta['sitemap']     = array('numeric');
162$meta['rss_type']    = array('multichoice','_choices' => array('rss','rss1','rss2','atom'));
163$meta['rss_linkto']  = array('multichoice','_choices' => array('diff','page','rev','current'));
164$meta['rss_update']  = array('numeric');
165
166$meta['_network']    = array('fieldset');
167$meta['proxy____host'] = array('string','_pattern' => '#^[a-z0-9\-\.+]+?#i');
168$meta['proxy____port'] = array('numeric');
169$meta['proxy____user'] = array('string');
170$meta['proxy____pass'] = array('password');
171$meta['proxy____ssl']  = array('onoff');
172$meta['safemodehack'] = array('onoff');
173$meta['ftp____host']  = array('string','_pattern' => '#^[a-z0-9\-\.+]+?#i');
174$meta['ftp____port']  = array('numeric');
175$meta['ftp____user']  = array('string');
176$meta['ftp____pass']  = array('password');
177$meta['ftp____root']  = array('string');
178
179