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