xref: /dokuwiki/lib/plugins/config/settings/config.metadata.php (revision 64159a61e94d0ce680071c8890e144982c3a8cbe)
110449332Schris<?php
210449332Schris/**
310449332Schris * Metadata for configuration manager plugin
410449332Schris *
510449332Schris * Note:  This file should be included within a function to ensure it
6862763f2Schris *        doesn't clash with the settings it is describing.
710449332Schris *
810449332Schris * Format:
910449332Schris *   $meta[<setting name>] = array(<handler class id>,<param name> => <param value>);
1010449332Schris *
1110449332Schris *   <handler class id>  is the handler class name without the "setting_" prefix
1210449332Schris *
1310449332Schris * Defined classes:
14306ca8aaSchris *   Generic (source: settings/config.class.php)
15306ca8aaSchris *   -------------------------------------------
16e8a6bae4Schris *   ''             - default class ('setting'), textarea, minimal input validation, setting output in quotes
17e8a6bae4Schris *   'string'       - single line text input, minimal input validation, setting output in quotes
1810449332Schris *   'numeric'      - text input, accepts numbers and arithmetic operators, setting output without quotes
1938dc5fa6SMichael Hamann *                    if given the '_min' and '_max' parameters are used for validation
2076ae5803SAndreas Gohr *   'numericopt'   - like above, but accepts empty values
2110449332Schris *   'onoff'        - checkbox input, setting output  0|1
2210449332Schris *   'multichoice'  - select input (single choice), setting output with quotes, required _choices parameter
2365f0aa62SChristopher Smith *   'email'        - text input, input must conform to email address format, supports optional '_multiple'
2465f0aa62SChristopher Smith *                    parameter for multiple comma separated email addresses
253994772aSChris Smith *   'password'     - password input, minimal input validation, setting output text in quotes, maybe encoded
263994772aSChris Smith *                    according to the _code parameter
2710449332Schris *   'dirchoice'    - as multichoice, selection choices based on folders found at location specified in _dir
28f7589b08SChris Smith *                    parameter (required). A pattern can be used to restrict the folders to only those which
29f7589b08SChris Smith *                    match the pattern.
30306ca8aaSchris *   'multicheckbox'- a checkbox for each choice plus an "other" string input, config file setting is a comma
31306ca8aaSchris *                    separated list of checked choices
324fa2dffcSBen Coburn *   'fieldset'     - used to group configuration settings, but is not itself a setting. To make this clear in
334fa2dffcSBen Coburn *                    the language files the keys for this type should start with '_'.
3460dd32d9SAndreas Gohr *   'array'        - a simple (one dimensional) array of string values, shown as comma separated list in the
3560dd32d9SAndreas Gohr *                    config manager but saved as PHP array(). Values may not contain commas themselves.
3660dd32d9SAndreas Gohr *                    _pattern matching on the array values supported.
37d110fb0dSChristopher Smith *   'regex'        - regular expression string, normally without delimiters; as for string, in addition tested
38d110fb0dSChristopher Smith *                    to see if will compile & run as a regex.  in addition to _pattern, also accepts _delimiter
39d110fb0dSChristopher Smith *                    (default '/') and _pregflags (default 'ui')
4010449332Schris *
41306ca8aaSchris *  Single Setting (source: settings/extra.class.php)
42306ca8aaSchris *  -------------------------------------------------
4310449332Schris *   'savedir'     - as 'setting', input tested against initpath() (inc/init.php)
4410449332Schris *   'sepchar'     - as multichoice, selection constructed from string of valid values
4510449332Schris *   'authtype'    - as 'setting', input validated against a valid php file at expected location for auth files
4610449332Schris *   'im_convert'  - as 'setting', input must exist and be an im_convert module
47306ca8aaSchris *   'disableactions' - as 'setting'
481b95bfdfSChris Smith *   'compression' - no additional parameters. checks php installation supports possible compression alternatives
4951de8ca1SChristopher Smith *   'licence'     - as multichoice, selection constructed from licence strings in language files
5051de8ca1SChristopher Smith *   'renderer'    - as multichoice, selection constructed from enabled renderer plugins which canRender()
5161e0b2f8SChristopher Smith *   'authtype'    - as multichoice, selection constructed from the enabled auth plugins
5210449332Schris *
5310449332Schris *  Any setting commented or missing will use 'setting' class - text input, minimal validation, quoted output
5410449332Schris *
5510449332Schris * Defined parameters:
569dc3b8abSChristopher Smith *   '_caution'    - no value (default) or 'warning', 'danger', 'security'. display an alert along with the setting
5710449332Schris *   '_pattern'    - string, a preg pattern. input is tested against this pattern before being accepted
58f7589b08SChris Smith *                   optional all classes, except onoff & multichoice which ignore it
5910449332Schris *   '_choices'    - array of choices. used to populate a selection box. choice will be replaced by a localised
6010449332Schris *                   language string, indexed by  <setting name>_o_<choice>, if one exists
61306ca8aaSchris *                   required by 'multichoice' & 'multicheckbox' classes, ignored by others
6210449332Schris *   '_dir'        - location of directory to be used to populate choice list
6310449332Schris *                   required by 'dirchoice' class, ignored by other classes
64306ca8aaSchris *   '_combine'    - complimentary output setting values which can be combined into a single display checkbox
65306ca8aaSchris *                   optional for 'multicheckbox', ignored by other classes
663994772aSChris Smith *   '_code'       - encoding method to use, accepted values: 'base64','uuencode','plain'.  defaults to plain.
6738dc5fa6SMichael Hamann *   '_min'        - minimum numeric value, optional for 'numeric' and 'numericopt', ignored by others
6838dc5fa6SMichael Hamann *   '_max'        - maximum numeric value, optional for 'numeric' and 'numericopt', ignored by others
69d110fb0dSChristopher Smith *   '_delimiter'  - string, default '/', a single character used as a delimiter for testing regex input values
70d110fb0dSChristopher Smith *   '_pregflags'  - string, default 'ui', valid preg pattern modifiers used when testing regex input values, for more
7159752844SAnders Sandblad *                   information see http://php.net/manual/en/reference.pcre.pattern.modifiers.php
7265f0aa62SChristopher Smith *   '_multiple'   - bool, allow multiple comma separated email values; optional for 'email', ignored by others
732d090c54SChristopher Smith *   '_other'      - how to handle other values (not listed in _choices). accepted values: 'always','exists','never'
742d090c54SChristopher Smith *                   default value 'always'. 'exists' only shows 'other' input field when the setting contains value(s)
752d090c54SChristopher Smith *                   not listed in choices (e.g. due to manual editing or update changing _choices).  This is safer than
762d090c54SChristopher Smith *                   'never' as it will not discard unknown/other values.
772d090c54SChristopher Smith *                   optional for 'multicheckbox', ignored by others
782d090c54SChristopher Smith *
7910449332Schris *
8010449332Schris * @author    Chris Smith <chris@jalakai.co.uk>
8110449332Schris */
8210449332Schris// ---------------[ settings for settings ]------------------------------
8310449332Schris$config['format']  = 'php';      // format of setting files, supported formats: php
8410449332Schris$config['varname'] = 'conf';     // name of the config variable, sans $
8510449332Schris
8610449332Schris// this string is written at the top of the rewritten settings file,
8710449332Schris// !! do not include any comment indicators !!
8810449332Schris// this value can be overriden when calling save_settings() method
8910449332Schris$config['heading'] = 'Dokuwiki\'s Main Configuration File - Local Settings';
9010449332Schris
9110449332Schris// test value (FIXME, remove before publishing)
9210449332Schris//$meta['test']     = array('multichoice','_choices' => array(''));
9310449332Schris
9410449332Schris// --------------[ setting metadata ]------------------------------------
9510449332Schris// - for description of format and fields see top of file
9610449332Schris// - order the settings in the order you wish them to appear
9710449332Schris// - any settings not mentioned will come after the last setting listed and
9810449332Schris//   will use the default class with no parameters
9910449332Schris
1004fa2dffcSBen Coburn$meta['_basic']   = array('fieldset');
10191f04971SAndreas Gohr$meta['title']    = array('string');
1029dc3b8abSChristopher Smith$meta['start']    = array('string','_caution' => 'warning','_pattern' => '!^[^:;/]+$!'); // don't accept namespaces
10310449332Schris$meta['lang']     = array('dirchoice','_dir' => DOKU_INC.'inc/lang/');
104f7589b08SChris Smith$meta['template'] = array('dirchoice','_dir' => DOKU_INC.'lib/tpl/','_pattern' => '/^[\w-]+$/');
10591e90457SAnika Henke$meta['tagline']  = array('string');
10691e90457SAnika Henke$meta['sidebar']  = array('string');
107066fee30SAndreas Gohr$meta['license']  = array('license');
1089dc3b8abSChristopher Smith$meta['savedir']  = array('savedir','_caution' => 'danger');
1099dc3b8abSChristopher Smith$meta['basedir']  = array('string','_caution' => 'danger');
1109dc3b8abSChristopher Smith$meta['baseurl']  = array('string','_caution' => 'danger');
1119dc3b8abSChristopher Smith$meta['cookiedir'] = array('string','_caution' => 'danger');
1122f97bef5Schris$meta['dmode']    = array('numeric','_pattern' => '/0[0-7]{3,4}/'); // only accept octal representation
1132f97bef5Schris$meta['fmode']    = array('numeric','_pattern' => '/0[0-7]{3,4}/'); // only accept octal representation
1149dc3b8abSChristopher Smith$meta['allowdebug']  = array('onoff','_caution' => 'security');
11510449332Schris
1164fa2dffcSBen Coburn$meta['_display']    = array('fieldset');
11710449332Schris$meta['recent']      = array('numeric');
1187cd0713eSAndreas Gohr$meta['recent_days'] = array('numeric');
119359fab8bSMichael Hamann$meta['breadcrumbs'] = array('numeric','_min' => 0);
12091f04971SAndreas Gohr$meta['youarehere']  = array('onoff');
1219dc3b8abSChristopher Smith$meta['fullpath']    = array('onoff','_caution' => 'security');
1229426a41aSAndreas Gohr$meta['typography']  = array('multichoice','_choices' => array(0,1,2));
12391f04971SAndreas Gohr$meta['dformat']     = array('string');
12491f04971SAndreas Gohr$meta['signature']   = array('string');
125*64159a61SAndreas Gohr$meta['showuseras'] = array(
126*64159a61SAndreas Gohr    'multichoice',
127*64159a61SAndreas Gohr    '_choices' => array('loginname', 'username', 'username_link', 'email', 'email_link')
128*64159a61SAndreas Gohr);
12910449332Schris$meta['toptoclevel'] = array('multichoice','_choices' => array(1,2,3,4,5));   // 5 toc levels
130c69534d4SAnika Henke$meta['tocminheads'] = array('multichoice','_choices' => array(0,1,2,3,4,5,10,15,20));
131220c8709Schris$meta['maxtoclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5));
13210449332Schris$meta['maxseclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5)); // 0 for no sec edit buttons
1339dc3b8abSChristopher Smith$meta['camelcase']   = array('onoff','_caution' => 'warning');
1349dc3b8abSChristopher Smith$meta['deaccent']    = array('multichoice','_choices' => array(0,1,2),'_caution' => 'warning');
135fe9ec250SChris Smith$meta['useheading']  = array('multichoice','_choices' => array(0,'navigation','content',1));
1367cd0713eSAndreas Gohr$meta['sneaky_index'] = array('onoff');
137d110fb0dSChristopher Smith$meta['hidepages']   = array('regex');
13810449332Schris
1394fa2dffcSBen Coburn$meta['_authentication'] = array('fieldset');
1409dc3b8abSChristopher Smith$meta['useacl']      = array('onoff','_caution' => 'danger');
14110449332Schris$meta['autopasswd']  = array('onoff');
1429dc3b8abSChristopher Smith$meta['authtype']    = array('authtype','_caution' => 'danger');
143924cc11cSAndreas Gohr$meta['passcrypt']   = array('multichoice','_choices' => array(
144924cc11cSAndreas Gohr    'smd5','md5','apr1','sha1','ssha','lsmd5','crypt','mysql','my411','kmd5','pmd5','hmd5',
145924cc11cSAndreas Gohr    'mediawiki','bcrypt','djangomd5','djangosha1','djangopbkdf2_sha1','djangopbkdf2_sha256','sha512'
146924cc11cSAndreas Gohr));
14791f04971SAndreas Gohr$meta['defaultgroup']= array('string');
1489dc3b8abSChristopher Smith$meta['superuser']   = array('string','_caution' => 'danger');
149f8cc712eSAndreas Gohr$meta['manager']     = array('string');
15010449332Schris$meta['profileconfirm'] = array('onoff');
1515430c4beSAndreas Gohr$meta['rememberme'] = array('onoff');
152*64159a61SAndreas Gohr$meta['disableactions'] = array(
153*64159a61SAndreas Gohr    'disableactions',
154*64159a61SAndreas Gohr    '_choices' => array(
155*64159a61SAndreas Gohr        'backlink',
156*64159a61SAndreas Gohr        'index',
157*64159a61SAndreas Gohr        'recent',
158*64159a61SAndreas Gohr        'revisions',
159*64159a61SAndreas Gohr        'search',
160*64159a61SAndreas Gohr        'subscription',
161*64159a61SAndreas Gohr        'register',
162*64159a61SAndreas Gohr        'resendpwd',
163*64159a61SAndreas Gohr        'profile',
164*64159a61SAndreas Gohr        'profile_delete',
165*64159a61SAndreas Gohr        'edit',
166*64159a61SAndreas Gohr        'wikicode',
167*64159a61SAndreas Gohr        'check',
168*64159a61SAndreas Gohr        'rss'
169*64159a61SAndreas Gohr    ),
170*64159a61SAndreas Gohr    '_combine' => array(
171*64159a61SAndreas Gohr        'subscription' => array('subscribe', 'unsubscribe'),
172*64159a61SAndreas Gohr        'wikicode' => array('source', 'export_raw')
173*64159a61SAndreas Gohr    )
174*64159a61SAndreas Gohr);
1754c989037SChris Smith$meta['auth_security_timeout'] = array('numeric');
176f5c6743cSAndreas Gohr$meta['securecookie'] = array('onoff');
1779dc3b8abSChristopher Smith$meta['remote']       = array('onoff','_caution' => 'security');
178eb20307aSDominik Eckelmann$meta['remoteuser']   = array('string');
17910449332Schris
1804fa2dffcSBen Coburn$meta['_anti_spam']  = array('fieldset');
1814fa2dffcSBen Coburn$meta['usewordblock']= array('onoff');
1824fa2dffcSBen Coburn$meta['relnofollow'] = array('onoff');
1834fa2dffcSBen Coburn$meta['indexdelay']  = array('numeric');
1844fa2dffcSBen Coburn$meta['mailguard']   = array('multichoice','_choices' => array('visible','hex','none'));
1859dc3b8abSChristopher Smith$meta['iexssprotect']= array('onoff','_caution' => 'security');
1864fa2dffcSBen Coburn
1874fa2dffcSBen Coburn$meta['_editing']    = array('fieldset');
18817e7a281SBen Coburn$meta['usedraft']    = array('onoff');
1899dc3b8abSChristopher Smith$meta['htmlok']      = array('onoff','_caution' => 'security');
1909dc3b8abSChristopher Smith$meta['phpok']       = array('onoff','_caution' => 'security');
19110449332Schris$meta['locktime']    = array('numeric');
1924fa2dffcSBen Coburn$meta['cachetime']   = array('numeric');
19310449332Schris
1944fa2dffcSBen Coburn$meta['_links']    = array('fieldset');
19591f04971SAndreas Gohr$meta['target____wiki']      = array('string');
19691f04971SAndreas Gohr$meta['target____interwiki'] = array('string');
19791f04971SAndreas Gohr$meta['target____extern']    = array('string');
19891f04971SAndreas Gohr$meta['target____media']     = array('string');
19991f04971SAndreas Gohr$meta['target____windows']   = array('string');
20010449332Schris
2012b03e74dSBen Coburn$meta['_media']      = array('fieldset');
20237c23632SAndreas Gohr$meta['mediarevisions']  = array('onoff');
2032b03e74dSBen Coburn$meta['gdlib']       = array('multichoice','_choices' => array(0,1,2));
2042b03e74dSBen Coburn$meta['im_convert']  = array('im_convert');
2052b03e74dSBen Coburn$meta['jpg_quality'] = array('numeric','_pattern' => '/^100$|^[1-9]?[0-9]$/');  //(0-100)
2068a1f5d50SAndreas Gohr$meta['fetchsize']   = array('numeric');
2077cd0713eSAndreas Gohr$meta['refcheck']    = array('onoff');
2087cd0713eSAndreas Gohr
2097cd0713eSAndreas Gohr$meta['_notifications'] = array('fieldset');
2107cd0713eSAndreas Gohr$meta['subscribers']    = array('onoff');
2117cd0713eSAndreas Gohr$meta['subscribe_time'] = array('numeric');
2127cd0713eSAndreas Gohr$meta['notify']         = array('email', '_multiple' => true);
213a9b6a8b5SAndreas Gohr$meta['registernotify'] = array('email', '_multiple' => true);
214a9b6a8b5SAndreas Gohr$meta['mailfrom']       = array('email', '_placeholders' => true);
2155f43dcf4SLukas Rademacher$meta['mailreturnpath']       = array('email', '_placeholders' => true);
2167cd0713eSAndreas Gohr$meta['mailprefix']     = array('string');
2178aea6381SAndreas Gohr$meta['htmlmail']       = array('onoff');
2187cd0713eSAndreas Gohr
2197cd0713eSAndreas Gohr$meta['_syndication'] = array('fieldset');
2207cd0713eSAndreas Gohr$meta['sitemap']     = array('numeric');
2217cd0713eSAndreas Gohr$meta['rss_type']    = array('multichoice','_choices' => array('rss','rss1','rss2','atom','atom1'));
2227cd0713eSAndreas Gohr$meta['rss_linkto']  = array('multichoice','_choices' => array('diff','page','rev','current'));
2237cd0713eSAndreas Gohr$meta['rss_content'] = array('multichoice','_choices' => array('abstract','diff','htmldiff','html'));
2247cd0713eSAndreas Gohr$meta['rss_media']   = array('multichoice','_choices' => array('both','pages','media'));
2257cd0713eSAndreas Gohr$meta['rss_update']  = array('numeric');
2267cd0713eSAndreas Gohr$meta['rss_show_summary'] = array('onoff');
2272b03e74dSBen Coburn
2284fa2dffcSBen Coburn$meta['_advanced']   = array('fieldset');
229c29dc6e4SAndreas Gohr$meta['updatecheck'] = array('onoff');
2309dc3b8abSChristopher Smith$meta['userewrite']  = array('multichoice','_choices' => array(0,1,2),'_caution' => 'danger');
2314fa2dffcSBen Coburn$meta['useslash']    = array('onoff');
2329dc3b8abSChristopher Smith$meta['sepchar']     = array('sepchar','_caution' => 'warning');
2334fa2dffcSBen Coburn$meta['canonical']   = array('onoff');
2349dc3b8abSChristopher Smith$meta['fnencode']    = array('multichoice','_choices' => array('url','safe','utf-8'),'_caution' => 'warning');
2354fa2dffcSBen Coburn$meta['autoplural']  = array('onoff');
2364fa2dffcSBen Coburn$meta['compress']    = array('onoff');
23728f4004cSAndreas Gohr$meta['cssdatauri']  = array('numeric','_pattern' => '/^\d+$/');
238524be65dSBen Coburn$meta['gzip_output'] = array('onoff');
2394fa2dffcSBen Coburn$meta['send404']     = array('onoff');
2409dc3b8abSChristopher Smith$meta['compression'] = array('compression','_caution' => 'warning');
241cde6a01bSAndreas Gohr$meta['broken_iua']  = array('onoff');
2429dc3b8abSChristopher Smith$meta['xsendfile']   = array('multichoice','_choices' => array(0,1,2,3),'_caution' => 'warning');
2439dc3b8abSChristopher Smith$meta['renderer_xhtml'] = array('renderer','_format' => 'xhtml','_choices' => array('xhtml'),'_caution' => 'warning');
24422952965SYoBoY$meta['readdircache'] = array('numeric');
24513ce475dSAndreas Gohr$meta['search_nslimit'] = array('numeric', '_min' => 0);
24613ce475dSAndreas Gohr$meta['search_fragment'] = array('multichoice','_choices' => array('exact', 'starts_with', 'ends_with', 'contains'),);
2474fa2dffcSBen Coburn
2484fa2dffcSBen Coburn$meta['_network']    = array('fieldset');
24922ef1e32SAndreas Gohr$meta['dnslookups']  = array('onoff');
250fa078663SAndreas Gohr$meta['jquerycdn']   = array('multichoice', '_choices' => array(0,'jquery', 'cdnjs'));
25176ae5803SAndreas Gohr$meta['proxy____host'] = array('string','_pattern' => '#^(|[a-z0-9\-\.+]+)$#i');
25276ae5803SAndreas Gohr$meta['proxy____port'] = array('numericopt');
25391f04971SAndreas Gohr$meta['proxy____user'] = array('string');
2543994772aSChris Smith$meta['proxy____pass'] = array('password','_code' => 'base64');
25510449332Schris$meta['proxy____ssl']  = array('onoff');
2567aeda574SAndreas Gohr$meta['proxy____except'] = array('string');
25710449332Schris$meta['safemodehack'] = array('onoff');
25876ae5803SAndreas Gohr$meta['ftp____host']  = array('string','_pattern' => '#^(|[a-z0-9\-\.+]+)$#i');
25976ae5803SAndreas Gohr$meta['ftp____port']  = array('numericopt');
26091f04971SAndreas Gohr$meta['ftp____user']  = array('string');
2613994772aSChris Smith$meta['ftp____pass']  = array('password','_code' => 'base64');
26291f04971SAndreas Gohr$meta['ftp____root']  = array('string');
26310449332Schris
264