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