xref: /dokuwiki/lib/plugins/config/settings/config.metadata.php (revision 467c14277e38168cb2f99ade7ae4bda5b3a20cb1)
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
83*467c1427SAndreas Gohr$meta['_basic'] = ['fieldset'];
84*467c1427SAndreas Gohr$meta['title'] = ['string'];
85*467c1427SAndreas Gohr$meta['start'] = ['string', '_caution' => 'warning', '_pattern' => '!^[^:;/]+$!']; // don't accept namespaces
86*467c1427SAndreas Gohr$meta['lang'] = ['dirchoice', '_dir' => DOKU_INC . 'inc/lang/'];
87*467c1427SAndreas Gohr$meta['template'] = ['dirchoice', '_dir' => DOKU_INC . 'lib/tpl/', '_pattern' => '/^[\w-]+$/'];
88*467c1427SAndreas Gohr$meta['tagline'] = ['string'];
89*467c1427SAndreas Gohr$meta['sidebar'] = ['string'];
90*467c1427SAndreas Gohr$meta['license'] = ['license'];
91*467c1427SAndreas Gohr$meta['savedir'] = ['savedir', '_caution' => 'danger'];
92*467c1427SAndreas Gohr$meta['basedir'] = ['string', '_caution' => 'danger'];
93*467c1427SAndreas Gohr$meta['baseurl'] = ['string', '_caution' => 'danger'];
94*467c1427SAndreas Gohr$meta['cookiedir'] = ['string', '_caution' => 'danger'];
95*467c1427SAndreas Gohr$meta['dmode'] = ['numeric', '_pattern' => '/0[0-7]{3,4}/']; // only accept octal representation
96*467c1427SAndreas Gohr$meta['fmode'] = ['numeric', '_pattern' => '/0[0-7]{3,4}/']; // only accept octal representation
97*467c1427SAndreas Gohr$meta['allowdebug'] = ['onoff', '_caution' => 'security'];
9810449332Schris
99*467c1427SAndreas Gohr$meta['_display'] = ['fieldset'];
100*467c1427SAndreas Gohr$meta['recent'] = ['numeric'];
101*467c1427SAndreas Gohr$meta['recent_days'] = ['numeric'];
102*467c1427SAndreas Gohr$meta['breadcrumbs'] = ['numeric', '_min' => 0];
103*467c1427SAndreas Gohr$meta['youarehere'] = ['onoff'];
104*467c1427SAndreas Gohr$meta['fullpath'] = ['onoff', '_caution' => 'security'];
105*467c1427SAndreas Gohr$meta['typography'] = ['multichoice', '_choices' => [0, 1, 2]];
106*467c1427SAndreas Gohr$meta['dformat'] = ['string'];
107*467c1427SAndreas Gohr$meta['signature'] = ['string'];
108*467c1427SAndreas Gohr$meta['showuseras'] = ['multichoice', '_choices' => ['loginname', 'username', 'username_link', 'email', 'email_link']];
109*467c1427SAndreas Gohr$meta['toptoclevel'] = ['multichoice', '_choices' => [1, 2, 3, 4, 5]];   // 5 toc levels
110*467c1427SAndreas Gohr$meta['tocminheads'] = ['multichoice', '_choices' => [0, 1, 2, 3, 4, 5, 10, 15, 20]];
111*467c1427SAndreas Gohr$meta['maxtoclevel'] = ['multichoice', '_choices' => [0, 1, 2, 3, 4, 5]];
112*467c1427SAndreas Gohr$meta['maxseclevel'] = ['multichoice', '_choices' => [0, 1, 2, 3, 4, 5]]; // 0 for no sec edit buttons
113*467c1427SAndreas Gohr$meta['camelcase'] = ['onoff', '_caution' => 'warning'];
114*467c1427SAndreas Gohr$meta['deaccent'] = ['multichoice', '_choices' => [0, 1, 2], '_caution' => 'warning'];
115*467c1427SAndreas Gohr$meta['useheading'] = ['multichoice', '_choices' => [0, 'navigation', 'content', 1]];
116*467c1427SAndreas Gohr$meta['sneaky_index'] = ['onoff'];
117*467c1427SAndreas Gohr$meta['hidepages'] = ['regex'];
11810449332Schris
119*467c1427SAndreas Gohr$meta['_authentication'] = ['fieldset'];
120*467c1427SAndreas Gohr$meta['useacl'] = ['onoff', '_caution' => 'danger'];
121*467c1427SAndreas Gohr$meta['autopasswd'] = ['onoff'];
122*467c1427SAndreas Gohr$meta['authtype'] = ['authtype', '_caution' => 'danger'];
123*467c1427SAndreas Gohr$meta['passcrypt'] = ['multichoice',
124*467c1427SAndreas Gohr    '_choices' => [
125*467c1427SAndreas Gohr        'smd5',
126*467c1427SAndreas Gohr        'md5',
127*467c1427SAndreas Gohr        'apr1',
128*467c1427SAndreas Gohr        'sha1',
129*467c1427SAndreas Gohr        'ssha',
130*467c1427SAndreas Gohr        'lsmd5',
131*467c1427SAndreas Gohr        'crypt',
132*467c1427SAndreas Gohr        'mysql',
133*467c1427SAndreas Gohr        'my411',
134*467c1427SAndreas Gohr        'kmd5',
135*467c1427SAndreas Gohr        'pmd5',
136*467c1427SAndreas Gohr        'hmd5',
137*467c1427SAndreas Gohr        'mediawiki',
138*467c1427SAndreas Gohr        'bcrypt',
139*467c1427SAndreas Gohr        'djangomd5',
140*467c1427SAndreas Gohr        'djangosha1',
141*467c1427SAndreas Gohr        'djangopbkdf2_sha1',
142*467c1427SAndreas Gohr        'djangopbkdf2_sha256',
143*467c1427SAndreas Gohr        'sha512',
144*467c1427SAndreas Gohr        'argon2i',
145*467c1427SAndreas Gohr        'argon2id']
146*467c1427SAndreas Gohr];
147*467c1427SAndreas Gohr$meta['defaultgroup'] = ['string'];
148*467c1427SAndreas Gohr$meta['superuser'] = ['string', '_caution' => 'danger'];
149*467c1427SAndreas Gohr$meta['manager'] = ['string'];
150*467c1427SAndreas Gohr$meta['profileconfirm'] = ['onoff'];
151*467c1427SAndreas Gohr$meta['rememberme'] = ['onoff'];
152*467c1427SAndreas Gohr$meta['disableactions'] = ['disableactions',
153*467c1427SAndreas Gohr    '_choices' => [
15464159a61SAndreas Gohr        'backlink',
15564159a61SAndreas Gohr        'index',
15664159a61SAndreas Gohr        'recent',
15764159a61SAndreas Gohr        'revisions',
15864159a61SAndreas Gohr        'search',
15964159a61SAndreas Gohr        'subscription',
16064159a61SAndreas Gohr        'register',
16164159a61SAndreas Gohr        'resendpwd',
16264159a61SAndreas Gohr        'profile',
16364159a61SAndreas Gohr        'profile_delete',
16464159a61SAndreas Gohr        'edit',
16564159a61SAndreas Gohr        'wikicode',
16664159a61SAndreas Gohr        'check',
16764159a61SAndreas Gohr        'rss'
168*467c1427SAndreas Gohr    ],
169*467c1427SAndreas Gohr    '_combine' => [
170*467c1427SAndreas Gohr        'subscription' => ['subscribe', 'unsubscribe'],
171*467c1427SAndreas Gohr        'wikicode' => ['source', 'export_raw']
172*467c1427SAndreas Gohr    ]
173*467c1427SAndreas Gohr];
174*467c1427SAndreas Gohr$meta['auth_security_timeout'] = ['numeric'];
175*467c1427SAndreas Gohr$meta['securecookie'] = ['onoff'];
176*467c1427SAndreas Gohr$meta['samesitecookie'] = ['multichoice', '_choices' => ['', 'Lax', 'Strict', 'None']];
177*467c1427SAndreas Gohr$meta['remote'] = ['onoff', '_caution' => 'security'];
178*467c1427SAndreas Gohr$meta['remoteuser'] = ['string'];
179*467c1427SAndreas Gohr$meta['remotecors'] = ['string', '_caution' => 'security'];
18010449332Schris
181*467c1427SAndreas Gohr$meta['_anti_spam'] = ['fieldset'];
182*467c1427SAndreas Gohr$meta['usewordblock'] = ['onoff'];
183*467c1427SAndreas Gohr$meta['relnofollow'] = ['onoff'];
184*467c1427SAndreas Gohr$meta['indexdelay'] = ['numeric'];
185*467c1427SAndreas Gohr$meta['mailguard'] = ['multichoice', '_choices' => ['visible', 'hex', 'none']];
186*467c1427SAndreas Gohr$meta['iexssprotect'] = ['onoff', '_caution' => 'security'];
1874fa2dffcSBen Coburn
188*467c1427SAndreas Gohr$meta['_editing'] = ['fieldset'];
189*467c1427SAndreas Gohr$meta['usedraft'] = ['onoff'];
190*467c1427SAndreas Gohr$meta['locktime'] = ['numeric'];
191*467c1427SAndreas Gohr$meta['cachetime'] = ['numeric'];
19210449332Schris
193*467c1427SAndreas Gohr$meta['_links'] = ['fieldset'];
194*467c1427SAndreas Gohr$meta['target____wiki'] = ['string'];
195*467c1427SAndreas Gohr$meta['target____interwiki'] = ['string'];
196*467c1427SAndreas Gohr$meta['target____extern'] = ['string'];
197*467c1427SAndreas Gohr$meta['target____media'] = ['string'];
198*467c1427SAndreas Gohr$meta['target____windows'] = ['string'];
19910449332Schris
200*467c1427SAndreas Gohr$meta['_media'] = ['fieldset'];
201*467c1427SAndreas Gohr$meta['mediarevisions'] = ['onoff'];
202*467c1427SAndreas Gohr$meta['gdlib'] = ['multichoice', '_choices' => [0, 1, 2]];
203*467c1427SAndreas Gohr$meta['im_convert'] = ['im_convert'];
204*467c1427SAndreas Gohr$meta['jpg_quality'] = ['numeric', '_pattern' => '/^100$|^[1-9]?\d$/'];  //(0-100)
205*467c1427SAndreas Gohr$meta['fetchsize'] = ['numeric'];
206*467c1427SAndreas Gohr$meta['refcheck'] = ['onoff'];
2077cd0713eSAndreas Gohr
208*467c1427SAndreas Gohr$meta['_notifications'] = ['fieldset'];
209*467c1427SAndreas Gohr$meta['subscribers'] = ['onoff'];
210*467c1427SAndreas Gohr$meta['subscribe_time'] = ['numeric'];
211*467c1427SAndreas Gohr$meta['notify'] = ['email', '_multiple' => true];
212*467c1427SAndreas Gohr$meta['registernotify'] = ['email', '_multiple' => true];
213*467c1427SAndreas Gohr$meta['mailfrom'] = ['email', '_placeholders' => true];
214*467c1427SAndreas Gohr$meta['mailreturnpath'] = ['email', '_placeholders' => true];
215*467c1427SAndreas Gohr$meta['mailprefix'] = ['string'];
216*467c1427SAndreas Gohr$meta['htmlmail'] = ['onoff'];
217*467c1427SAndreas Gohr$meta['dontlog'] = ['disableactions', '_choices' => ['error', 'debug', 'deprecated']];
2187cd0713eSAndreas Gohr
219*467c1427SAndreas Gohr$meta['_syndication'] = ['fieldset'];
220*467c1427SAndreas Gohr$meta['sitemap'] = ['numeric'];
221*467c1427SAndreas Gohr$meta['rss_type'] = ['multichoice', '_choices' => ['rss', 'rss1', 'rss2', 'atom', 'atom1']];
222*467c1427SAndreas Gohr$meta['rss_linkto'] = ['multichoice', '_choices' => ['diff', 'page', 'rev', 'current']];
223*467c1427SAndreas Gohr$meta['rss_content'] = ['multichoice', '_choices' => ['abstract', 'diff', 'htmldiff', 'html']];
224*467c1427SAndreas Gohr$meta['rss_media'] = ['multichoice', '_choices' => ['both', 'pages', 'media']];
225*467c1427SAndreas Gohr$meta['rss_update'] = ['numeric'];
226*467c1427SAndreas Gohr$meta['rss_show_summary'] = ['onoff'];
227*467c1427SAndreas Gohr$meta['rss_show_deleted'] = ['onoff'];
2282b03e74dSBen Coburn
229*467c1427SAndreas Gohr$meta['_advanced'] = ['fieldset'];
230*467c1427SAndreas Gohr$meta['updatecheck'] = ['onoff'];
231*467c1427SAndreas Gohr$meta['userewrite'] = ['multichoice', '_choices' => [0, 1, 2], '_caution' => 'danger'];
232*467c1427SAndreas Gohr$meta['useslash'] = ['onoff'];
233*467c1427SAndreas Gohr$meta['sepchar'] = ['sepchar', '_caution' => 'warning'];
234*467c1427SAndreas Gohr$meta['canonical'] = ['onoff'];
235*467c1427SAndreas Gohr$meta['fnencode'] = ['multichoice', '_choices' => ['url', 'safe', 'utf-8'], '_caution' => 'warning'];
236*467c1427SAndreas Gohr$meta['autoplural'] = ['onoff'];
237*467c1427SAndreas Gohr$meta['compress'] = ['onoff'];
238*467c1427SAndreas Gohr$meta['cssdatauri'] = ['numeric', '_pattern' => '/^\d+$/'];
239*467c1427SAndreas Gohr$meta['gzip_output'] = ['onoff'];
240*467c1427SAndreas Gohr$meta['send404'] = ['onoff'];
241*467c1427SAndreas Gohr$meta['compression'] = ['compression', '_caution' => 'warning'];
242*467c1427SAndreas Gohr$meta['broken_iua'] = ['onoff'];
243*467c1427SAndreas Gohr$meta['xsendfile'] = ['multichoice', '_choices' => [0, 1, 2, 3], '_caution' => 'warning'];
244*467c1427SAndreas Gohr$meta['renderer_xhtml'] = ['renderer', '_format' => 'xhtml', '_choices' => ['xhtml'], '_caution' => 'warning'];
245*467c1427SAndreas Gohr$meta['readdircache'] = ['numeric'];
246*467c1427SAndreas Gohr$meta['search_nslimit'] = ['numeric', '_min' => 0];
247*467c1427SAndreas Gohr$meta['search_fragment'] = ['multichoice', '_choices' => ['exact', 'starts_with', 'ends_with', 'contains']];
248*467c1427SAndreas Gohr$meta['trustedproxy'] = ['regex'];
2494fa2dffcSBen Coburn
250fc6b11d2SMichael Große$meta['_feature_flags'] = ['fieldset'];
251fc6b11d2SMichael Große$meta['defer_js'] = ['onoff'];
252be6462f4SAndreas Gohr$meta['hidewarnings'] = ['onoff'];
253fc6b11d2SMichael Große
254*467c1427SAndreas Gohr$meta['_network'] = ['fieldset'];
255*467c1427SAndreas Gohr$meta['dnslookups'] = ['onoff'];
256*467c1427SAndreas Gohr$meta['jquerycdn'] = ['multichoice', '_choices' => [0, 'jquery', 'cdnjs']];
257*467c1427SAndreas Gohr$meta['proxy____host'] = ['string', '_pattern' => '#^(|[a-z0-9\-\.+]+)$#i'];
258*467c1427SAndreas Gohr$meta['proxy____port'] = ['numericopt'];
259*467c1427SAndreas Gohr$meta['proxy____user'] = ['string'];
260*467c1427SAndreas Gohr$meta['proxy____pass'] = ['password', '_code' => 'base64'];
261*467c1427SAndreas Gohr$meta['proxy____ssl'] = ['onoff'];
262*467c1427SAndreas Gohr$meta['proxy____except'] = ['string'];
263