xref: /dokuwiki/lib/plugins/config/settings/config.metadata.php (revision a191bd2a8ef9a6cde5c9a80e84eef2369a247214)
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 *                    if given the '_min' and '_max' parameters are used for validation
20 *   'numericopt'   - like above, but accepts empty values
21 *   'onoff'        - checkbox input, setting output  0|1
22 *   'multichoice'  - select input (single choice), setting output with quotes, required _choices parameter
23 *   'email'        - text input, input must conform to email address format, supports optional '_multiple'
24 *                    parameter for multiple comma separated email addresses
25 *   'password'     - password input, minimal input validation, setting output text in quotes, maybe encoded
26 *                    according to the _code parameter
27 *   'dirchoice'    - as multichoice, selection choices based on folders found at location specified in _dir
28 *                    parameter (required). A pattern can be used to restrict the folders to only those which
29 *                    match the pattern.
30 *   'multicheckbox'- a checkbox for each choice plus an "other" string input, config file setting is a comma
31 *                    separated list of checked choices
32 *   'fieldset'     - used to group configuration settings, but is not itself a setting. To make this clear in
33 *                    the language files the keys for this type should start with '_'.
34 *   'array'        - a simple (one dimensional) array of string values, shown as comma separated list in the
35 *                    config manager but saved as PHP array(). Values may not contain commas themselves.
36 *                    _pattern matching on the array values supported.
37 *
38 *  Single Setting (source: settings/extra.class.php)
39 *  -------------------------------------------------
40 *   'savedir'     - as 'setting', input tested against initpath() (inc/init.php)
41 *   'sepchar'     - as multichoice, selection constructed from string of valid values
42 *   'authtype'    - as 'setting', input validated against a valid php file at expected location for auth files
43 *   'im_convert'  - as 'setting', input must exist and be an im_convert module
44 *   'disableactions' - as 'setting'
45 *   'compression' - no additional parameters. checks php installation supports possible compression alternatives
46 *
47 *  Any setting commented or missing will use 'setting' class - text input, minimal validation, quoted output
48 *
49 * Defined parameters:
50 *   '_pattern'    - string, a preg pattern. input is tested against this pattern before being accepted
51 *                   optional all classes, except onoff & multichoice which ignore it
52 *   '_choices'    - array of choices. used to populate a selection box. choice will be replaced by a localised
53 *                   language string, indexed by  <setting name>_o_<choice>, if one exists
54 *                   required by 'multichoice' & 'multicheckbox' classes, ignored by others
55 *   '_dir'        - location of directory to be used to populate choice list
56 *                   required by 'dirchoice' class, ignored by other classes
57 *   '_combine'    - complimentary output setting values which can be combined into a single display checkbox
58 *                   optional for 'multicheckbox', ignored by other classes
59 *   '_code'       - encoding method to use, accepted values: 'base64','uuencode','plain'.  defaults to plain.
60 *   '_min'        - minimum numeric value, optional for 'numeric' and 'numericopt', ignored by others
61 *   '_max'        - maximum numeric value, optional for 'numeric' and 'numericopt', ignored by others
62 *   '_multiple'   - bool, allow multiple comma separated email values; optional for 'email', ignored by others
63 *
64 * @author    Chris Smith <chris@jalakai.co.uk>
65 */
66// ---------------[ settings for settings ]------------------------------
67$config['format']  = 'php';      // format of setting files, supported formats: php
68$config['varname'] = 'conf';     // name of the config variable, sans $
69
70// this string is written at the top of the rewritten settings file,
71// !! do not include any comment indicators !!
72// this value can be overriden when calling save_settings() method
73$config['heading'] = 'Dokuwiki\'s Main Configuration File - Local Settings';
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['tagline']  = array('string');
90$meta['sidebar']  = array('string');
91$meta['license']  = array('license');
92$meta['savedir']  = array('savedir');
93$meta['basedir']  = array('string');
94$meta['baseurl']  = array('string');
95$meta['cookiedir'] = array('string');
96$meta['dmode']    = array('numeric','_pattern' => '/0[0-7]{3,4}/'); // only accept octal representation
97$meta['fmode']    = array('numeric','_pattern' => '/0[0-7]{3,4}/'); // only accept octal representation
98$meta['allowdebug']  = array('onoff');
99
100$meta['_display']    = array('fieldset');
101$meta['recent']      = array('numeric');
102$meta['recent_days'] = array('numeric');
103$meta['breadcrumbs'] = array('numeric','_min' => 0);
104$meta['youarehere']  = array('onoff');
105$meta['fullpath']    = array('onoff');
106$meta['typography']  = array('multichoice','_choices' => array(0,1,2));
107$meta['dformat']     = array('string');
108$meta['signature']   = array('string');
109$meta['showuseras']  = array('multichoice','_choices' => array('loginname','username','email','email_link'));
110$meta['toptoclevel'] = array('multichoice','_choices' => array(1,2,3,4,5));   // 5 toc levels
111$meta['tocminheads'] = array('multichoice','_choices' => array(0,1,2,3,4,5,10,15,20));
112$meta['maxtoclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5));
113$meta['maxseclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5)); // 0 for no sec edit buttons
114$meta['camelcase']   = array('onoff');
115$meta['deaccent']    = array('multichoice','_choices' => array(0,1,2));
116$meta['useheading']  = array('multichoice','_choices' => array(0,'navigation','content',1));
117$meta['sneaky_index'] = array('onoff');
118$meta['hidepages']   = array('string');
119
120$meta['_authentication'] = array('fieldset');
121$meta['useacl']      = array('onoff');
122$meta['autopasswd']  = array('onoff');
123$meta['authtype']    = array('authtype');
124$meta['passcrypt']   = array('multichoice','_choices' => array('smd5','md5','apr1','sha1','ssha','lsmd5','crypt','mysql','my411','kmd5','pmd5','hmd5','mediawiki','bcrypt','djangomd5','djangosha1','sha512'));
125$meta['defaultgroup']= array('string');
126$meta['superuser']   = array('string');
127$meta['manager']     = array('string');
128$meta['profileconfirm'] = array('onoff');
129$meta['rememberme'] = array('onoff');
130$meta['disableactions'] = array('disableactions',
131                                '_choices' => array('backlink','index','recent','revisions','search','subscription','register','resendpwd','profile','edit','wikicode','check'),
132                                '_combine' => array('subscription' => array('subscribe','unsubscribe'), 'wikicode' => array('source','export_raw')));
133$meta['auth_security_timeout'] = array('numeric');
134$meta['securecookie'] = array('onoff');
135$meta['remote']       = array('onoff');
136$meta['remoteuser']   = array('string');
137
138$meta['_anti_spam']  = array('fieldset');
139$meta['usewordblock']= array('onoff');
140$meta['relnofollow'] = array('onoff');
141$meta['indexdelay']  = array('numeric');
142$meta['mailguard']   = array('multichoice','_choices' => array('visible','hex','none'));
143$meta['iexssprotect']= array('onoff');
144
145$meta['_editing']    = array('fieldset');
146$meta['usedraft']    = array('onoff');
147$meta['htmlok']      = array('onoff');
148$meta['phpok']       = array('onoff');
149$meta['locktime']    = array('numeric');
150$meta['cachetime']   = array('numeric');
151
152$meta['_links']    = array('fieldset');
153$meta['target____wiki']      = array('string');
154$meta['target____interwiki'] = array('string');
155$meta['target____extern']    = array('string');
156$meta['target____media']     = array('string');
157$meta['target____windows']   = array('string');
158
159$meta['_media']      = array('fieldset');
160$meta['mediarevisions']  = array('onoff');
161$meta['gdlib']       = array('multichoice','_choices' => array(0,1,2));
162$meta['im_convert']  = array('im_convert');
163$meta['jpg_quality'] = array('numeric','_pattern' => '/^100$|^[1-9]?[0-9]$/');  //(0-100)
164$meta['fetchsize']   = array('numeric');
165$meta['refcheck']    = array('onoff');
166
167$meta['_notifications'] = array('fieldset');
168$meta['subscribers']    = array('onoff');
169$meta['subscribe_time'] = array('numeric');
170$meta['notify']         = array('email', '_multiple' => true);
171$meta['registernotify'] = array('email', '_multiple' => true);
172$meta['mailfrom']       = array('email', '_placeholders' => true);
173$meta['mailprefix']     = array('string');
174$meta['htmlmail']       = array('onoff');
175
176$meta['_syndication'] = array('fieldset');
177$meta['sitemap']     = array('numeric');
178$meta['rss_type']    = array('multichoice','_choices' => array('rss','rss1','rss2','atom','atom1'));
179$meta['rss_linkto']  = array('multichoice','_choices' => array('diff','page','rev','current'));
180$meta['rss_content'] = array('multichoice','_choices' => array('abstract','diff','htmldiff','html'));
181$meta['rss_media']   = array('multichoice','_choices' => array('both','pages','media'));
182$meta['rss_update']  = array('numeric');
183$meta['rss_show_summary'] = array('onoff');
184
185$meta['_advanced']   = array('fieldset');
186$meta['updatecheck'] = array('onoff');
187$meta['userewrite']  = array('multichoice','_choices' => array(0,1,2));
188$meta['useslash']    = array('onoff');
189$meta['sepchar']     = array('sepchar');
190$meta['canonical']   = array('onoff');
191$meta['fnencode']    = array('multichoice','_choices' => array('url','safe','utf-8'));
192$meta['autoplural']  = array('onoff');
193$meta['compress']    = array('onoff');
194$meta['cssdatauri']  = array('numeric','_pattern' => '/^\d+$/');
195$meta['gzip_output'] = array('onoff');
196$meta['send404']     = array('onoff');
197$meta['compression'] = array('compression');
198$meta['broken_iua']  = array('onoff');
199$meta['xsendfile']   = array('multichoice','_choices' => array(0,1,2,3));
200$meta['renderer_xhtml'] = array('renderer','_format' => 'xhtml','_choices' => array('xhtml'));
201$meta['readdircache'] = array('numeric');
202
203$meta['_network']    = array('fieldset');
204$meta['dnslookups']  = array('onoff');
205$meta['proxy____host'] = array('string','_pattern' => '#^(|[a-z0-9\-\.+]+)$#i');
206$meta['proxy____port'] = array('numericopt');
207$meta['proxy____user'] = array('string');
208$meta['proxy____pass'] = array('password','_code' => 'base64');
209$meta['proxy____ssl']  = array('onoff');
210$meta['proxy____except'] = array('string');
211$meta['safemodehack'] = array('onoff');
212$meta['ftp____host']  = array('string','_pattern' => '#^(|[a-z0-9\-\.+]+)$#i');
213$meta['ftp____port']  = array('numericopt');
214$meta['ftp____user']  = array('string');
215$meta['ftp____pass']  = array('password','_code' => 'base64');
216$meta['ftp____root']  = array('string');
217
218