xref: /dokuwiki/lib/plugins/config/settings/config.metadata.php (revision be6462f4bb18e8b92e47ced9cfc4141997d0687a)
110449332Schris<?php
210449332Schris/**
310449332Schris * Metadata for configuration manager plugin
410449332Schris *
54667676bSAndreas Gohr * Note: This file is loaded in Loader::loadMeta().
610449332Schris *
710449332Schris * Format:
810449332Schris *   $meta[<setting name>] = array(<handler class id>,<param name> => <param value>);
910449332Schris *
1010449332Schris *   <handler class id>  is the handler class name without the "setting_" prefix
1110449332Schris *
124667676bSAndreas Gohr * Defined classes (see core/Setting/*):
134667676bSAndreas Gohr *   Generic
14306ca8aaSchris *   -------------------------------------------
15e8a6bae4Schris *   ''             - default class ('setting'), textarea, minimal input validation, setting output in quotes
16e8a6bae4Schris *   'string'       - single line text input, minimal input validation, setting output in quotes
1710449332Schris *   'numeric'      - text input, accepts numbers and arithmetic operators, setting output without quotes
1838dc5fa6SMichael Hamann *                    if given the '_min' and '_max' parameters are used for validation
1976ae5803SAndreas Gohr *   'numericopt'   - like above, but accepts empty values
2010449332Schris *   'onoff'        - checkbox input, setting output  0|1
2110449332Schris *   'multichoice'  - select input (single choice), setting output with quotes, required _choices parameter
2265f0aa62SChristopher Smith *   'email'        - text input, input must conform to email address format, supports optional '_multiple'
2365f0aa62SChristopher Smith *                    parameter for multiple comma separated email addresses
243994772aSChris Smith *   'password'     - password input, minimal input validation, setting output text in quotes, maybe encoded
253994772aSChris Smith *                    according to the _code parameter
2610449332Schris *   'dirchoice'    - as multichoice, selection choices based on folders found at location specified in _dir
27f7589b08SChris Smith *                    parameter (required). A pattern can be used to restrict the folders to only those which
28f7589b08SChris Smith *                    match the pattern.
29306ca8aaSchris *   'multicheckbox'- a checkbox for each choice plus an "other" string input, config file setting is a comma
30306ca8aaSchris *                    separated list of checked choices
314fa2dffcSBen Coburn *   'fieldset'     - used to group configuration settings, but is not itself a setting. To make this clear in
324fa2dffcSBen Coburn *                    the language files the keys for this type should start with '_'.
3360dd32d9SAndreas Gohr *   'array'        - a simple (one dimensional) array of string values, shown as comma separated list in the
3460dd32d9SAndreas Gohr *                    config manager but saved as PHP array(). Values may not contain commas themselves.
3560dd32d9SAndreas Gohr *                    _pattern matching on the array values supported.
36d110fb0dSChristopher Smith *   'regex'        - regular expression string, normally without delimiters; as for string, in addition tested
37d110fb0dSChristopher Smith *                    to see if will compile & run as a regex.  in addition to _pattern, also accepts _delimiter
38d110fb0dSChristopher Smith *                    (default '/') and _pregflags (default 'ui')
3910449332Schris *
404667676bSAndreas Gohr *  Single Setting
41306ca8aaSchris *  -------------------------------------------------
4210449332Schris *   'savedir'     - as 'setting', input tested against initpath() (inc/init.php)
4310449332Schris *   'sepchar'     - as multichoice, selection constructed from string of valid values
4410449332Schris *   'authtype'    - as 'setting', input validated against a valid php file at expected location for auth files
4510449332Schris *   'im_convert'  - as 'setting', input must exist and be an im_convert module
46306ca8aaSchris *   'disableactions' - as 'setting'
471b95bfdfSChris Smith *   'compression' - no additional parameters. checks php installation supports possible compression alternatives
4851de8ca1SChristopher Smith *   'licence'     - as multichoice, selection constructed from licence strings in language files
4951de8ca1SChristopher Smith *   'renderer'    - as multichoice, selection constructed from enabled renderer plugins which canRender()
5061e0b2f8SChristopher Smith *   'authtype'    - as multichoice, selection constructed from the enabled auth plugins
5110449332Schris *
5210449332Schris *  Any setting commented or missing will use 'setting' class - text input, minimal validation, quoted output
5310449332Schris *
5410449332Schris * Defined parameters:
559dc3b8abSChristopher Smith *   '_caution'    - no value (default) or 'warning', 'danger', 'security'. display an alert along with the setting
5610449332Schris *   '_pattern'    - string, a preg pattern. input is tested against this pattern before being accepted
57f7589b08SChris Smith *                   optional all classes, except onoff & multichoice which ignore it
5810449332Schris *   '_choices'    - array of choices. used to populate a selection box. choice will be replaced by a localised
5910449332Schris *                   language string, indexed by  <setting name>_o_<choice>, if one exists
60306ca8aaSchris *                   required by 'multichoice' & 'multicheckbox' classes, ignored by others
6110449332Schris *   '_dir'        - location of directory to be used to populate choice list
6210449332Schris *                   required by 'dirchoice' class, ignored by other classes
63306ca8aaSchris *   '_combine'    - complimentary output setting values which can be combined into a single display checkbox
64306ca8aaSchris *                   optional for 'multicheckbox', ignored by other classes
653994772aSChris Smith *   '_code'       - encoding method to use, accepted values: 'base64','uuencode','plain'.  defaults to plain.
6638dc5fa6SMichael Hamann *   '_min'        - minimum numeric value, optional for 'numeric' and 'numericopt', ignored by others
6738dc5fa6SMichael Hamann *   '_max'        - maximum numeric value, optional for 'numeric' and 'numericopt', ignored by others
68d110fb0dSChristopher Smith *   '_delimiter'  - string, default '/', a single character used as a delimiter for testing regex input values
69d110fb0dSChristopher Smith *   '_pregflags'  - string, default 'ui', valid preg pattern modifiers used when testing regex input values, for more
7059752844SAnders Sandblad *                   information see http://php.net/manual/en/reference.pcre.pattern.modifiers.php
7165f0aa62SChristopher Smith *   '_multiple'   - bool, allow multiple comma separated email values; optional for 'email', ignored by others
722d090c54SChristopher Smith *   '_other'      - how to handle other values (not listed in _choices). accepted values: 'always','exists','never'
732d090c54SChristopher Smith *                   default value 'always'. 'exists' only shows 'other' input field when the setting contains value(s)
742d090c54SChristopher Smith *                   not listed in choices (e.g. due to manual editing or update changing _choices).  This is safer than
752d090c54SChristopher Smith *                   'never' as it will not discard unknown/other values.
762d090c54SChristopher Smith *                   optional for 'multicheckbox', ignored by others
772d090c54SChristopher Smith *
784667676bSAndreas Gohr * The order of the settings influences the order in which they apppear in the config manager
7910449332Schris *
8010449332Schris * @author    Chris Smith <chris@jalakai.co.uk>
8110449332Schris */
8210449332Schris
834fa2dffcSBen Coburn$meta['_basic']   = array('fieldset');
8491f04971SAndreas Gohr$meta['title']    = array('string');
859dc3b8abSChristopher Smith$meta['start']    = array('string','_caution' => 'warning','_pattern' => '!^[^:;/]+$!'); // don't accept namespaces
8610449332Schris$meta['lang']     = array('dirchoice','_dir' => DOKU_INC.'inc/lang/');
87f7589b08SChris Smith$meta['template'] = array('dirchoice','_dir' => DOKU_INC.'lib/tpl/','_pattern' => '/^[\w-]+$/');
8891e90457SAnika Henke$meta['tagline']  = array('string');
8991e90457SAnika Henke$meta['sidebar']  = array('string');
90066fee30SAndreas Gohr$meta['license']  = array('license');
919dc3b8abSChristopher Smith$meta['savedir']  = array('savedir','_caution' => 'danger');
929dc3b8abSChristopher Smith$meta['basedir']  = array('string','_caution' => 'danger');
939dc3b8abSChristopher Smith$meta['baseurl']  = array('string','_caution' => 'danger');
949dc3b8abSChristopher Smith$meta['cookiedir'] = array('string','_caution' => 'danger');
952f97bef5Schris$meta['dmode']    = array('numeric','_pattern' => '/0[0-7]{3,4}/'); // only accept octal representation
962f97bef5Schris$meta['fmode']    = array('numeric','_pattern' => '/0[0-7]{3,4}/'); // only accept octal representation
979dc3b8abSChristopher Smith$meta['allowdebug']  = array('onoff','_caution' => 'security');
9810449332Schris
994fa2dffcSBen Coburn$meta['_display']    = array('fieldset');
10010449332Schris$meta['recent']      = array('numeric');
1017cd0713eSAndreas Gohr$meta['recent_days'] = array('numeric');
102359fab8bSMichael Hamann$meta['breadcrumbs'] = array('numeric','_min' => 0);
10391f04971SAndreas Gohr$meta['youarehere']  = array('onoff');
1049dc3b8abSChristopher Smith$meta['fullpath']    = array('onoff','_caution' => 'security');
1059426a41aSAndreas Gohr$meta['typography']  = array('multichoice','_choices' => array(0,1,2));
10691f04971SAndreas Gohr$meta['dformat']     = array('string');
10791f04971SAndreas Gohr$meta['signature']   = array('string');
10864159a61SAndreas Gohr$meta['showuseras'] = array(
10964159a61SAndreas Gohr    'multichoice',
11064159a61SAndreas Gohr    '_choices' => array('loginname', 'username', 'username_link', 'email', 'email_link')
11164159a61SAndreas Gohr);
11210449332Schris$meta['toptoclevel'] = array('multichoice','_choices' => array(1,2,3,4,5));   // 5 toc levels
113c69534d4SAnika Henke$meta['tocminheads'] = array('multichoice','_choices' => array(0,1,2,3,4,5,10,15,20));
114220c8709Schris$meta['maxtoclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5));
11510449332Schris$meta['maxseclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5)); // 0 for no sec edit buttons
1169dc3b8abSChristopher Smith$meta['camelcase']   = array('onoff','_caution' => 'warning');
1179dc3b8abSChristopher Smith$meta['deaccent']    = array('multichoice','_choices' => array(0,1,2),'_caution' => 'warning');
118fe9ec250SChris Smith$meta['useheading']  = array('multichoice','_choices' => array(0,'navigation','content',1));
1197cd0713eSAndreas Gohr$meta['sneaky_index'] = array('onoff');
120d110fb0dSChristopher Smith$meta['hidepages']   = array('regex');
12110449332Schris
1224fa2dffcSBen Coburn$meta['_authentication'] = array('fieldset');
1239dc3b8abSChristopher Smith$meta['useacl']      = array('onoff','_caution' => 'danger');
12410449332Schris$meta['autopasswd']  = array('onoff');
1259dc3b8abSChristopher Smith$meta['authtype']    = array('authtype','_caution' => 'danger');
126924cc11cSAndreas Gohr$meta['passcrypt']   = array('multichoice','_choices' => array(
127924cc11cSAndreas Gohr    'smd5','md5','apr1','sha1','ssha','lsmd5','crypt','mysql','my411','kmd5','pmd5','hmd5',
1286527515cSMichael Große    'mediawiki','bcrypt','djangomd5','djangosha1','djangopbkdf2_sha1','djangopbkdf2_sha256',
1296527515cSMichael Große    'sha512','argon2i','argon2id'
130924cc11cSAndreas Gohr));
13191f04971SAndreas Gohr$meta['defaultgroup']= array('string');
1329dc3b8abSChristopher Smith$meta['superuser']   = array('string','_caution' => 'danger');
133f8cc712eSAndreas Gohr$meta['manager']     = array('string');
13410449332Schris$meta['profileconfirm'] = array('onoff');
1355430c4beSAndreas Gohr$meta['rememberme'] = array('onoff');
13664159a61SAndreas Gohr$meta['disableactions'] = array(
13764159a61SAndreas Gohr    'disableactions',
13864159a61SAndreas Gohr    '_choices' => array(
13964159a61SAndreas Gohr        'backlink',
14064159a61SAndreas Gohr        'index',
14164159a61SAndreas Gohr        'recent',
14264159a61SAndreas Gohr        'revisions',
14364159a61SAndreas Gohr        'search',
14464159a61SAndreas Gohr        'subscription',
14564159a61SAndreas Gohr        'register',
14664159a61SAndreas Gohr        'resendpwd',
14764159a61SAndreas Gohr        'profile',
14864159a61SAndreas Gohr        'profile_delete',
14964159a61SAndreas Gohr        'edit',
15064159a61SAndreas Gohr        'wikicode',
15164159a61SAndreas Gohr        'check',
15264159a61SAndreas Gohr        'rss'
15364159a61SAndreas Gohr    ),
15464159a61SAndreas Gohr    '_combine' => array(
15564159a61SAndreas Gohr        'subscription' => array('subscribe', 'unsubscribe'),
15664159a61SAndreas Gohr        'wikicode' => array('source', 'export_raw')
15764159a61SAndreas Gohr    )
15864159a61SAndreas Gohr);
1594c989037SChris Smith$meta['auth_security_timeout'] = array('numeric');
160f5c6743cSAndreas Gohr$meta['securecookie'] = array('onoff');
1619dc3b8abSChristopher Smith$meta['remote']       = array('onoff','_caution' => 'security');
162eb20307aSDominik Eckelmann$meta['remoteuser']   = array('string');
1633df364a3STimo Richter$meta['remotecors']   = array('string', '_caution' => 'security');
16410449332Schris
1654fa2dffcSBen Coburn$meta['_anti_spam']  = array('fieldset');
1664fa2dffcSBen Coburn$meta['usewordblock']= array('onoff');
1674fa2dffcSBen Coburn$meta['relnofollow'] = array('onoff');
1684fa2dffcSBen Coburn$meta['indexdelay']  = array('numeric');
1694fa2dffcSBen Coburn$meta['mailguard']   = array('multichoice','_choices' => array('visible','hex','none'));
1709dc3b8abSChristopher Smith$meta['iexssprotect']= array('onoff','_caution' => 'security');
1714fa2dffcSBen Coburn
1724fa2dffcSBen Coburn$meta['_editing']    = array('fieldset');
17317e7a281SBen Coburn$meta['usedraft']    = array('onoff');
1749dc3b8abSChristopher Smith$meta['htmlok']      = array('onoff','_caution' => 'security');
1759dc3b8abSChristopher Smith$meta['phpok']       = array('onoff','_caution' => 'security');
17610449332Schris$meta['locktime']    = array('numeric');
1774fa2dffcSBen Coburn$meta['cachetime']   = array('numeric');
17810449332Schris
1794fa2dffcSBen Coburn$meta['_links']    = array('fieldset');
18091f04971SAndreas Gohr$meta['target____wiki']      = array('string');
18191f04971SAndreas Gohr$meta['target____interwiki'] = array('string');
18291f04971SAndreas Gohr$meta['target____extern']    = array('string');
18391f04971SAndreas Gohr$meta['target____media']     = array('string');
18491f04971SAndreas Gohr$meta['target____windows']   = array('string');
18510449332Schris
1862b03e74dSBen Coburn$meta['_media']      = array('fieldset');
18737c23632SAndreas Gohr$meta['mediarevisions']  = array('onoff');
1882b03e74dSBen Coburn$meta['gdlib']       = array('multichoice','_choices' => array(0,1,2));
1892b03e74dSBen Coburn$meta['im_convert']  = array('im_convert');
1902b03e74dSBen Coburn$meta['jpg_quality'] = array('numeric','_pattern' => '/^100$|^[1-9]?[0-9]$/');  //(0-100)
1918a1f5d50SAndreas Gohr$meta['fetchsize']   = array('numeric');
1927cd0713eSAndreas Gohr$meta['refcheck']    = array('onoff');
1937cd0713eSAndreas Gohr
1947cd0713eSAndreas Gohr$meta['_notifications'] = array('fieldset');
1957cd0713eSAndreas Gohr$meta['subscribers']    = array('onoff');
1967cd0713eSAndreas Gohr$meta['subscribe_time'] = array('numeric');
1977cd0713eSAndreas Gohr$meta['notify']         = array('email', '_multiple' => true);
198a9b6a8b5SAndreas Gohr$meta['registernotify'] = array('email', '_multiple' => true);
199a9b6a8b5SAndreas Gohr$meta['mailfrom']       = array('email', '_placeholders' => true);
2005f43dcf4SLukas Rademacher$meta['mailreturnpath']       = array('email', '_placeholders' => true);
2017cd0713eSAndreas Gohr$meta['mailprefix']     = array('string');
2028aea6381SAndreas Gohr$meta['htmlmail']       = array('onoff');
203cad4fbf6SAndreas Gohr$meta['dontlog'] = array(
204cad4fbf6SAndreas Gohr    'disableactions',
205cad4fbf6SAndreas Gohr    '_choices' => array(
206cad4fbf6SAndreas Gohr        'error',
207cad4fbf6SAndreas Gohr        'debug',
208cad4fbf6SAndreas Gohr        'deprecated',
209cad4fbf6SAndreas Gohr    ),
210cad4fbf6SAndreas Gohr);
2117cd0713eSAndreas Gohr
2127cd0713eSAndreas Gohr$meta['_syndication'] = array('fieldset');
2137cd0713eSAndreas Gohr$meta['sitemap']     = array('numeric');
2147cd0713eSAndreas Gohr$meta['rss_type']    = array('multichoice','_choices' => array('rss','rss1','rss2','atom','atom1'));
2157cd0713eSAndreas Gohr$meta['rss_linkto']  = array('multichoice','_choices' => array('diff','page','rev','current'));
2167cd0713eSAndreas Gohr$meta['rss_content'] = array('multichoice','_choices' => array('abstract','diff','htmldiff','html'));
2177cd0713eSAndreas Gohr$meta['rss_media']   = array('multichoice','_choices' => array('both','pages','media'));
2187cd0713eSAndreas Gohr$meta['rss_update']  = array('numeric');
2197cd0713eSAndreas Gohr$meta['rss_show_summary'] = array('onoff');
2207b299f22SAurélien Martin$meta['rss_show_deleted'] = array('onoff');
2212b03e74dSBen Coburn
2224fa2dffcSBen Coburn$meta['_advanced']   = array('fieldset');
223c29dc6e4SAndreas Gohr$meta['updatecheck'] = array('onoff');
2249dc3b8abSChristopher Smith$meta['userewrite']  = array('multichoice','_choices' => array(0,1,2),'_caution' => 'danger');
2254fa2dffcSBen Coburn$meta['useslash']    = array('onoff');
2269dc3b8abSChristopher Smith$meta['sepchar']     = array('sepchar','_caution' => 'warning');
2274fa2dffcSBen Coburn$meta['canonical']   = array('onoff');
2289dc3b8abSChristopher Smith$meta['fnencode']    = array('multichoice','_choices' => array('url','safe','utf-8'),'_caution' => 'warning');
2294fa2dffcSBen Coburn$meta['autoplural']  = array('onoff');
2304fa2dffcSBen Coburn$meta['compress']    = array('onoff');
23128f4004cSAndreas Gohr$meta['cssdatauri']  = array('numeric','_pattern' => '/^\d+$/');
232524be65dSBen Coburn$meta['gzip_output'] = array('onoff');
2334fa2dffcSBen Coburn$meta['send404']     = array('onoff');
2349dc3b8abSChristopher Smith$meta['compression'] = array('compression','_caution' => 'warning');
235cde6a01bSAndreas Gohr$meta['broken_iua']  = array('onoff');
2369dc3b8abSChristopher Smith$meta['xsendfile']   = array('multichoice','_choices' => array(0,1,2,3),'_caution' => 'warning');
2379dc3b8abSChristopher Smith$meta['renderer_xhtml'] = array('renderer','_format' => 'xhtml','_choices' => array('xhtml'),'_caution' => 'warning');
23822952965SYoBoY$meta['readdircache'] = array('numeric');
23913ce475dSAndreas Gohr$meta['search_nslimit'] = array('numeric', '_min' => 0);
24013ce475dSAndreas Gohr$meta['search_fragment'] = array('multichoice','_choices' => array('exact', 'starts_with', 'ends_with', 'contains'),);
241925105e8SPhy$meta['trustedproxy'] = array('regex');
2424fa2dffcSBen Coburn
243fc6b11d2SMichael Große$meta['_feature_flags'] = ['fieldset'];
244fc6b11d2SMichael Große$meta['defer_js']       = ['onoff'];
245*be6462f4SAndreas Gohr$meta['hidewarnings']   = ['onoff'];
246fc6b11d2SMichael Große
2474fa2dffcSBen Coburn$meta['_network']    = array('fieldset');
24822ef1e32SAndreas Gohr$meta['dnslookups']  = array('onoff');
249fa078663SAndreas Gohr$meta['jquerycdn']   = array('multichoice', '_choices' => array(0,'jquery', 'cdnjs'));
25076ae5803SAndreas Gohr$meta['proxy____host'] = array('string','_pattern' => '#^(|[a-z0-9\-\.+]+)$#i');
25176ae5803SAndreas Gohr$meta['proxy____port'] = array('numericopt');
25291f04971SAndreas Gohr$meta['proxy____user'] = array('string');
2533994772aSChris Smith$meta['proxy____pass'] = array('password','_code' => 'base64');
25410449332Schris$meta['proxy____ssl']  = array('onoff');
2557aeda574SAndreas Gohr$meta['proxy____except'] = array('string');
256