xref: /dokuwiki/lib/plugins/config/settings/config.metadata.php (revision 4667676ba003110a7962f4c0611a71c0d627b581)
110449332Schris<?php
210449332Schris/**
310449332Schris * Metadata for configuration manager plugin
410449332Schris *
5*4667676bSAndreas 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 *
12*4667676bSAndreas Gohr * Defined classes (see core/Setting/*):
13*4667676bSAndreas 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 *
40*4667676bSAndreas 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 *
78*4667676bSAndreas 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',
128924cc11cSAndreas Gohr    'mediawiki','bcrypt','djangomd5','djangosha1','djangopbkdf2_sha1','djangopbkdf2_sha256','sha512'
129924cc11cSAndreas Gohr));
13091f04971SAndreas Gohr$meta['defaultgroup']= array('string');
1319dc3b8abSChristopher Smith$meta['superuser']   = array('string','_caution' => 'danger');
132f8cc712eSAndreas Gohr$meta['manager']     = array('string');
13310449332Schris$meta['profileconfirm'] = array('onoff');
1345430c4beSAndreas Gohr$meta['rememberme'] = array('onoff');
13564159a61SAndreas Gohr$meta['disableactions'] = array(
13664159a61SAndreas Gohr    'disableactions',
13764159a61SAndreas Gohr    '_choices' => array(
13864159a61SAndreas Gohr        'backlink',
13964159a61SAndreas Gohr        'index',
14064159a61SAndreas Gohr        'recent',
14164159a61SAndreas Gohr        'revisions',
14264159a61SAndreas Gohr        'search',
14364159a61SAndreas Gohr        'subscription',
14464159a61SAndreas Gohr        'register',
14564159a61SAndreas Gohr        'resendpwd',
14664159a61SAndreas Gohr        'profile',
14764159a61SAndreas Gohr        'profile_delete',
14864159a61SAndreas Gohr        'edit',
14964159a61SAndreas Gohr        'wikicode',
15064159a61SAndreas Gohr        'check',
15164159a61SAndreas Gohr        'rss'
15264159a61SAndreas Gohr    ),
15364159a61SAndreas Gohr    '_combine' => array(
15464159a61SAndreas Gohr        'subscription' => array('subscribe', 'unsubscribe'),
15564159a61SAndreas Gohr        'wikicode' => array('source', 'export_raw')
15664159a61SAndreas Gohr    )
15764159a61SAndreas Gohr);
1584c989037SChris Smith$meta['auth_security_timeout'] = array('numeric');
159f5c6743cSAndreas Gohr$meta['securecookie'] = array('onoff');
1609dc3b8abSChristopher Smith$meta['remote']       = array('onoff','_caution' => 'security');
161eb20307aSDominik Eckelmann$meta['remoteuser']   = array('string');
16210449332Schris
1634fa2dffcSBen Coburn$meta['_anti_spam']  = array('fieldset');
1644fa2dffcSBen Coburn$meta['usewordblock']= array('onoff');
1654fa2dffcSBen Coburn$meta['relnofollow'] = array('onoff');
1664fa2dffcSBen Coburn$meta['indexdelay']  = array('numeric');
1674fa2dffcSBen Coburn$meta['mailguard']   = array('multichoice','_choices' => array('visible','hex','none'));
1689dc3b8abSChristopher Smith$meta['iexssprotect']= array('onoff','_caution' => 'security');
1694fa2dffcSBen Coburn
1704fa2dffcSBen Coburn$meta['_editing']    = array('fieldset');
17117e7a281SBen Coburn$meta['usedraft']    = array('onoff');
1729dc3b8abSChristopher Smith$meta['htmlok']      = array('onoff','_caution' => 'security');
1739dc3b8abSChristopher Smith$meta['phpok']       = array('onoff','_caution' => 'security');
17410449332Schris$meta['locktime']    = array('numeric');
1754fa2dffcSBen Coburn$meta['cachetime']   = array('numeric');
17610449332Schris
1774fa2dffcSBen Coburn$meta['_links']    = array('fieldset');
17891f04971SAndreas Gohr$meta['target____wiki']      = array('string');
17991f04971SAndreas Gohr$meta['target____interwiki'] = array('string');
18091f04971SAndreas Gohr$meta['target____extern']    = array('string');
18191f04971SAndreas Gohr$meta['target____media']     = array('string');
18291f04971SAndreas Gohr$meta['target____windows']   = array('string');
18310449332Schris
1842b03e74dSBen Coburn$meta['_media']      = array('fieldset');
18537c23632SAndreas Gohr$meta['mediarevisions']  = array('onoff');
1862b03e74dSBen Coburn$meta['gdlib']       = array('multichoice','_choices' => array(0,1,2));
1872b03e74dSBen Coburn$meta['im_convert']  = array('im_convert');
1882b03e74dSBen Coburn$meta['jpg_quality'] = array('numeric','_pattern' => '/^100$|^[1-9]?[0-9]$/');  //(0-100)
1898a1f5d50SAndreas Gohr$meta['fetchsize']   = array('numeric');
1907cd0713eSAndreas Gohr$meta['refcheck']    = array('onoff');
1917cd0713eSAndreas Gohr
1927cd0713eSAndreas Gohr$meta['_notifications'] = array('fieldset');
1937cd0713eSAndreas Gohr$meta['subscribers']    = array('onoff');
1947cd0713eSAndreas Gohr$meta['subscribe_time'] = array('numeric');
1957cd0713eSAndreas Gohr$meta['notify']         = array('email', '_multiple' => true);
196a9b6a8b5SAndreas Gohr$meta['registernotify'] = array('email', '_multiple' => true);
197a9b6a8b5SAndreas Gohr$meta['mailfrom']       = array('email', '_placeholders' => true);
1985f43dcf4SLukas Rademacher$meta['mailreturnpath']       = array('email', '_placeholders' => true);
1997cd0713eSAndreas Gohr$meta['mailprefix']     = array('string');
2008aea6381SAndreas Gohr$meta['htmlmail']       = array('onoff');
2017cd0713eSAndreas Gohr
2027cd0713eSAndreas Gohr$meta['_syndication'] = array('fieldset');
2037cd0713eSAndreas Gohr$meta['sitemap']     = array('numeric');
2047cd0713eSAndreas Gohr$meta['rss_type']    = array('multichoice','_choices' => array('rss','rss1','rss2','atom','atom1'));
2057cd0713eSAndreas Gohr$meta['rss_linkto']  = array('multichoice','_choices' => array('diff','page','rev','current'));
2067cd0713eSAndreas Gohr$meta['rss_content'] = array('multichoice','_choices' => array('abstract','diff','htmldiff','html'));
2077cd0713eSAndreas Gohr$meta['rss_media']   = array('multichoice','_choices' => array('both','pages','media'));
2087cd0713eSAndreas Gohr$meta['rss_update']  = array('numeric');
2097cd0713eSAndreas Gohr$meta['rss_show_summary'] = array('onoff');
2102b03e74dSBen Coburn
2114fa2dffcSBen Coburn$meta['_advanced']   = array('fieldset');
212c29dc6e4SAndreas Gohr$meta['updatecheck'] = array('onoff');
2139dc3b8abSChristopher Smith$meta['userewrite']  = array('multichoice','_choices' => array(0,1,2),'_caution' => 'danger');
2144fa2dffcSBen Coburn$meta['useslash']    = array('onoff');
2159dc3b8abSChristopher Smith$meta['sepchar']     = array('sepchar','_caution' => 'warning');
2164fa2dffcSBen Coburn$meta['canonical']   = array('onoff');
2179dc3b8abSChristopher Smith$meta['fnencode']    = array('multichoice','_choices' => array('url','safe','utf-8'),'_caution' => 'warning');
2184fa2dffcSBen Coburn$meta['autoplural']  = array('onoff');
2194fa2dffcSBen Coburn$meta['compress']    = array('onoff');
22028f4004cSAndreas Gohr$meta['cssdatauri']  = array('numeric','_pattern' => '/^\d+$/');
221524be65dSBen Coburn$meta['gzip_output'] = array('onoff');
2224fa2dffcSBen Coburn$meta['send404']     = array('onoff');
2239dc3b8abSChristopher Smith$meta['compression'] = array('compression','_caution' => 'warning');
224cde6a01bSAndreas Gohr$meta['broken_iua']  = array('onoff');
2259dc3b8abSChristopher Smith$meta['xsendfile']   = array('multichoice','_choices' => array(0,1,2,3),'_caution' => 'warning');
2269dc3b8abSChristopher Smith$meta['renderer_xhtml'] = array('renderer','_format' => 'xhtml','_choices' => array('xhtml'),'_caution' => 'warning');
22722952965SYoBoY$meta['readdircache'] = array('numeric');
22813ce475dSAndreas Gohr$meta['search_nslimit'] = array('numeric', '_min' => 0);
22913ce475dSAndreas Gohr$meta['search_fragment'] = array('multichoice','_choices' => array('exact', 'starts_with', 'ends_with', 'contains'),);
2304fa2dffcSBen Coburn
2314fa2dffcSBen Coburn$meta['_network']    = array('fieldset');
23222ef1e32SAndreas Gohr$meta['dnslookups']  = array('onoff');
233fa078663SAndreas Gohr$meta['jquerycdn']   = array('multichoice', '_choices' => array(0,'jquery', 'cdnjs'));
23476ae5803SAndreas Gohr$meta['proxy____host'] = array('string','_pattern' => '#^(|[a-z0-9\-\.+]+)$#i');
23576ae5803SAndreas Gohr$meta['proxy____port'] = array('numericopt');
23691f04971SAndreas Gohr$meta['proxy____user'] = array('string');
2373994772aSChris Smith$meta['proxy____pass'] = array('password','_code' => 'base64');
23810449332Schris$meta['proxy____ssl']  = array('onoff');
2397aeda574SAndreas Gohr$meta['proxy____except'] = array('string');
24010449332Schris$meta['safemodehack'] = array('onoff');
24176ae5803SAndreas Gohr$meta['ftp____host']  = array('string','_pattern' => '#^(|[a-z0-9\-\.+]+)$#i');
24276ae5803SAndreas Gohr$meta['ftp____port']  = array('numericopt');
24391f04971SAndreas Gohr$meta['ftp____user']  = array('string');
2443994772aSChris Smith$meta['ftp____pass']  = array('password','_code' => 'base64');
24591f04971SAndreas Gohr$meta['ftp____root']  = array('string');
24610449332Schris
247