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