xref: /dokuwiki/lib/plugins/config/settings/config.metadata.php (revision df9e4a18efc53e5e56b5d6771dc5d285cdf6f15e)
110449332Schris<?php
2d4f83172SAndreas Gohr
310449332Schris/**
410449332Schris * Metadata for configuration manager plugin
510449332Schris *
64667676bSAndreas Gohr * Note: This file is loaded in Loader::loadMeta().
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 *
134667676bSAndreas Gohr * Defined classes (see core/Setting/*):
144667676bSAndreas Gohr *   Generic
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 *
414667676bSAndreas Gohr *  Single Setting
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 *
794667676bSAndreas Gohr * The order of the settings influences the order in which they apppear in the config manager
8010449332Schris *
8110449332Schris * @author    Chris Smith <chris@jalakai.co.uk>
8210449332Schris */
8310449332Schris
84467c1427SAndreas Gohr$meta['_basic'] = ['fieldset'];
85467c1427SAndreas Gohr$meta['title'] = ['string'];
86467c1427SAndreas Gohr$meta['start'] = ['string', '_caution' => 'warning', '_pattern' => '!^[^:;/]+$!']; // don't accept namespaces
87467c1427SAndreas Gohr$meta['lang'] = ['dirchoice', '_dir' => DOKU_INC . 'inc/lang/'];
88467c1427SAndreas Gohr$meta['template'] = ['dirchoice', '_dir' => DOKU_INC . 'lib/tpl/', '_pattern' => '/^[\w-]+$/'];
89467c1427SAndreas Gohr$meta['tagline'] = ['string'];
90467c1427SAndreas Gohr$meta['sidebar'] = ['string'];
91467c1427SAndreas Gohr$meta['license'] = ['license'];
92467c1427SAndreas Gohr$meta['savedir'] = ['savedir', '_caution' => 'danger'];
93467c1427SAndreas Gohr$meta['basedir'] = ['string', '_caution' => 'danger'];
94467c1427SAndreas Gohr$meta['baseurl'] = ['string', '_caution' => 'danger'];
95467c1427SAndreas Gohr$meta['cookiedir'] = ['string', '_caution' => 'danger'];
96467c1427SAndreas Gohr$meta['dmode'] = ['numeric', '_pattern' => '/0[0-7]{3,4}/']; // only accept octal representation
97467c1427SAndreas Gohr$meta['fmode'] = ['numeric', '_pattern' => '/0[0-7]{3,4}/']; // only accept octal representation
98467c1427SAndreas Gohr$meta['allowdebug'] = ['onoff', '_caution' => 'security'];
9910449332Schris
100467c1427SAndreas Gohr$meta['_display'] = ['fieldset'];
101467c1427SAndreas Gohr$meta['recent'] = ['numeric'];
102467c1427SAndreas Gohr$meta['recent_days'] = ['numeric'];
103467c1427SAndreas Gohr$meta['breadcrumbs'] = ['numeric', '_min' => 0];
104467c1427SAndreas Gohr$meta['youarehere'] = ['onoff'];
105467c1427SAndreas Gohr$meta['fullpath'] = ['onoff', '_caution' => 'security'];
106467c1427SAndreas Gohr$meta['typography'] = ['multichoice', '_choices' => [0, 1, 2]];
107467c1427SAndreas Gohr$meta['dformat'] = ['string'];
108467c1427SAndreas Gohr$meta['signature'] = ['string'];
109467c1427SAndreas Gohr$meta['showuseras'] = ['multichoice', '_choices' => ['loginname', 'username', 'username_link', 'email', 'email_link']];
110467c1427SAndreas Gohr$meta['toptoclevel'] = ['multichoice', '_choices' => [1, 2, 3, 4, 5]];   // 5 toc levels
111467c1427SAndreas Gohr$meta['tocminheads'] = ['multichoice', '_choices' => [0, 1, 2, 3, 4, 5, 10, 15, 20]];
112467c1427SAndreas Gohr$meta['maxtoclevel'] = ['multichoice', '_choices' => [0, 1, 2, 3, 4, 5]];
113467c1427SAndreas Gohr$meta['maxseclevel'] = ['multichoice', '_choices' => [0, 1, 2, 3, 4, 5]]; // 0 for no sec edit buttons
114467c1427SAndreas Gohr$meta['camelcase'] = ['onoff', '_caution' => 'warning'];
115467c1427SAndreas Gohr$meta['deaccent'] = ['multichoice', '_choices' => [0, 1, 2], '_caution' => 'warning'];
116467c1427SAndreas Gohr$meta['useheading'] = ['multichoice', '_choices' => [0, 'navigation', 'content', 1]];
117467c1427SAndreas Gohr$meta['sneaky_index'] = ['onoff'];
118467c1427SAndreas Gohr$meta['hidepages'] = ['regex'];
11910449332Schris
120467c1427SAndreas Gohr$meta['_authentication'] = ['fieldset'];
121467c1427SAndreas Gohr$meta['useacl'] = ['onoff', '_caution' => 'danger'];
122467c1427SAndreas Gohr$meta['autopasswd'] = ['onoff'];
123467c1427SAndreas Gohr$meta['authtype'] = ['authtype', '_caution' => 'danger'];
124467c1427SAndreas Gohr$meta['passcrypt'] = ['multichoice',
125467c1427SAndreas Gohr    '_choices' => [
126467c1427SAndreas Gohr        'smd5',
127467c1427SAndreas Gohr        'md5',
128467c1427SAndreas Gohr        'apr1',
129467c1427SAndreas Gohr        'sha1',
130467c1427SAndreas Gohr        'ssha',
131467c1427SAndreas Gohr        'lsmd5',
132467c1427SAndreas Gohr        'crypt',
133467c1427SAndreas Gohr        'mysql',
134467c1427SAndreas Gohr        'my411',
135467c1427SAndreas Gohr        'kmd5',
136467c1427SAndreas Gohr        'pmd5',
137467c1427SAndreas Gohr        'hmd5',
138467c1427SAndreas Gohr        'mediawiki',
139467c1427SAndreas Gohr        'bcrypt',
140467c1427SAndreas Gohr        'djangomd5',
141467c1427SAndreas Gohr        'djangosha1',
142467c1427SAndreas Gohr        'djangopbkdf2_sha1',
143467c1427SAndreas Gohr        'djangopbkdf2_sha256',
144467c1427SAndreas Gohr        'sha512',
145467c1427SAndreas Gohr        'argon2i',
146467c1427SAndreas Gohr        'argon2id']
147467c1427SAndreas Gohr];
148467c1427SAndreas Gohr$meta['defaultgroup'] = ['string'];
149467c1427SAndreas Gohr$meta['superuser'] = ['string', '_caution' => 'danger'];
150467c1427SAndreas Gohr$meta['manager'] = ['string'];
151467c1427SAndreas Gohr$meta['profileconfirm'] = ['onoff'];
152467c1427SAndreas Gohr$meta['rememberme'] = ['onoff'];
153467c1427SAndreas Gohr$meta['disableactions'] = ['disableactions',
154467c1427SAndreas Gohr    '_choices' => [
15564159a61SAndreas Gohr        'backlink',
15664159a61SAndreas Gohr        'index',
15764159a61SAndreas Gohr        'recent',
15864159a61SAndreas Gohr        'revisions',
15964159a61SAndreas Gohr        'search',
16064159a61SAndreas Gohr        'subscription',
16164159a61SAndreas Gohr        'register',
16264159a61SAndreas Gohr        'resendpwd',
16364159a61SAndreas Gohr        'profile',
16464159a61SAndreas Gohr        'profile_delete',
16564159a61SAndreas Gohr        'edit',
16664159a61SAndreas Gohr        'wikicode',
16764159a61SAndreas Gohr        'check',
16864159a61SAndreas Gohr        'rss'
169467c1427SAndreas Gohr    ],
170467c1427SAndreas Gohr    '_combine' => [
171467c1427SAndreas Gohr        'subscription' => ['subscribe', 'unsubscribe'],
172467c1427SAndreas Gohr        'wikicode' => ['source', 'export_raw']
173467c1427SAndreas Gohr    ]
174467c1427SAndreas Gohr];
175467c1427SAndreas Gohr$meta['auth_security_timeout'] = ['numeric'];
176467c1427SAndreas Gohr$meta['securecookie'] = ['onoff'];
177467c1427SAndreas Gohr$meta['samesitecookie'] = ['multichoice', '_choices' => ['', 'Lax', 'Strict', 'None']];
178467c1427SAndreas Gohr$meta['remote'] = ['onoff', '_caution' => 'security'];
179467c1427SAndreas Gohr$meta['remoteuser'] = ['string'];
180467c1427SAndreas Gohr$meta['remotecors'] = ['string', '_caution' => 'security'];
18110449332Schris
182467c1427SAndreas Gohr$meta['_anti_spam'] = ['fieldset'];
183467c1427SAndreas Gohr$meta['usewordblock'] = ['onoff'];
184467c1427SAndreas Gohr$meta['relnofollow'] = ['onoff'];
185467c1427SAndreas Gohr$meta['indexdelay'] = ['numeric'];
186467c1427SAndreas Gohr$meta['mailguard'] = ['multichoice', '_choices' => ['visible', 'hex', 'none']];
187467c1427SAndreas Gohr$meta['iexssprotect'] = ['onoff', '_caution' => 'security'];
1884fa2dffcSBen Coburn
189467c1427SAndreas Gohr$meta['_editing'] = ['fieldset'];
190467c1427SAndreas Gohr$meta['usedraft'] = ['onoff'];
191467c1427SAndreas Gohr$meta['locktime'] = ['numeric'];
192467c1427SAndreas Gohr$meta['cachetime'] = ['numeric'];
19310449332Schris
194467c1427SAndreas Gohr$meta['_links'] = ['fieldset'];
195467c1427SAndreas Gohr$meta['target____wiki'] = ['string'];
196467c1427SAndreas Gohr$meta['target____interwiki'] = ['string'];
197467c1427SAndreas Gohr$meta['target____extern'] = ['string'];
198467c1427SAndreas Gohr$meta['target____media'] = ['string'];
199467c1427SAndreas Gohr$meta['target____windows'] = ['string'];
20010449332Schris
201467c1427SAndreas Gohr$meta['_media'] = ['fieldset'];
202467c1427SAndreas Gohr$meta['mediarevisions'] = ['onoff'];
203467c1427SAndreas Gohr$meta['gdlib'] = ['multichoice', '_choices' => [0, 1, 2]];
204467c1427SAndreas Gohr$meta['im_convert'] = ['im_convert'];
205467c1427SAndreas Gohr$meta['jpg_quality'] = ['numeric', '_pattern' => '/^100$|^[1-9]?\d$/'];  //(0-100)
206467c1427SAndreas Gohr$meta['fetchsize'] = ['numeric'];
207467c1427SAndreas Gohr$meta['refcheck'] = ['onoff'];
2087cd0713eSAndreas Gohr
209467c1427SAndreas Gohr$meta['_notifications'] = ['fieldset'];
210467c1427SAndreas Gohr$meta['subscribers'] = ['onoff'];
211467c1427SAndreas Gohr$meta['subscribe_time'] = ['numeric'];
212467c1427SAndreas Gohr$meta['notify'] = ['email', '_multiple' => true];
213467c1427SAndreas Gohr$meta['registernotify'] = ['email', '_multiple' => true];
214467c1427SAndreas Gohr$meta['mailfrom'] = ['email', '_placeholders' => true];
215467c1427SAndreas Gohr$meta['mailreturnpath'] = ['email', '_placeholders' => true];
216467c1427SAndreas Gohr$meta['mailprefix'] = ['string'];
217467c1427SAndreas Gohr$meta['htmlmail'] = ['onoff'];
218467c1427SAndreas Gohr$meta['dontlog'] = ['disableactions', '_choices' => ['error', 'debug', 'deprecated']];
219*df9e4a18SAndreas Gohr$meta['logretain'] = ['numeric', '_min' => 0, '_pattern' => '/^\d+$/'];
2207cd0713eSAndreas Gohr
221467c1427SAndreas Gohr$meta['_syndication'] = ['fieldset'];
222467c1427SAndreas Gohr$meta['sitemap'] = ['numeric'];
223467c1427SAndreas Gohr$meta['rss_type'] = ['multichoice', '_choices' => ['rss', 'rss1', 'rss2', 'atom', 'atom1']];
224467c1427SAndreas Gohr$meta['rss_linkto'] = ['multichoice', '_choices' => ['diff', 'page', 'rev', 'current']];
225467c1427SAndreas Gohr$meta['rss_content'] = ['multichoice', '_choices' => ['abstract', 'diff', 'htmldiff', 'html']];
226467c1427SAndreas Gohr$meta['rss_media'] = ['multichoice', '_choices' => ['both', 'pages', 'media']];
227467c1427SAndreas Gohr$meta['rss_update'] = ['numeric'];
228467c1427SAndreas Gohr$meta['rss_show_summary'] = ['onoff'];
229467c1427SAndreas Gohr$meta['rss_show_deleted'] = ['onoff'];
2302b03e74dSBen Coburn
231467c1427SAndreas Gohr$meta['_advanced'] = ['fieldset'];
232467c1427SAndreas Gohr$meta['updatecheck'] = ['onoff'];
233467c1427SAndreas Gohr$meta['userewrite'] = ['multichoice', '_choices' => [0, 1, 2], '_caution' => 'danger'];
234467c1427SAndreas Gohr$meta['useslash'] = ['onoff'];
235467c1427SAndreas Gohr$meta['sepchar'] = ['sepchar', '_caution' => 'warning'];
236467c1427SAndreas Gohr$meta['canonical'] = ['onoff'];
237467c1427SAndreas Gohr$meta['fnencode'] = ['multichoice', '_choices' => ['url', 'safe', 'utf-8'], '_caution' => 'warning'];
238467c1427SAndreas Gohr$meta['autoplural'] = ['onoff'];
239467c1427SAndreas Gohr$meta['compress'] = ['onoff'];
240467c1427SAndreas Gohr$meta['cssdatauri'] = ['numeric', '_pattern' => '/^\d+$/'];
241467c1427SAndreas Gohr$meta['gzip_output'] = ['onoff'];
242467c1427SAndreas Gohr$meta['send404'] = ['onoff'];
243467c1427SAndreas Gohr$meta['compression'] = ['compression', '_caution' => 'warning'];
244467c1427SAndreas Gohr$meta['broken_iua'] = ['onoff'];
245467c1427SAndreas Gohr$meta['xsendfile'] = ['multichoice', '_choices' => [0, 1, 2, 3], '_caution' => 'warning'];
246467c1427SAndreas Gohr$meta['renderer_xhtml'] = ['renderer', '_format' => 'xhtml', '_choices' => ['xhtml'], '_caution' => 'warning'];
247467c1427SAndreas Gohr$meta['readdircache'] = ['numeric'];
248467c1427SAndreas Gohr$meta['search_nslimit'] = ['numeric', '_min' => 0];
249467c1427SAndreas Gohr$meta['search_fragment'] = ['multichoice', '_choices' => ['exact', 'starts_with', 'ends_with', 'contains']];
250467c1427SAndreas Gohr$meta['trustedproxy'] = ['regex'];
2514fa2dffcSBen Coburn
252fc6b11d2SMichael Große$meta['_feature_flags'] = ['fieldset'];
253fc6b11d2SMichael Große$meta['defer_js'] = ['onoff'];
254be6462f4SAndreas Gohr$meta['hidewarnings'] = ['onoff'];
255fc6b11d2SMichael Große
256467c1427SAndreas Gohr$meta['_network'] = ['fieldset'];
257467c1427SAndreas Gohr$meta['dnslookups'] = ['onoff'];
258467c1427SAndreas Gohr$meta['jquerycdn'] = ['multichoice', '_choices' => [0, 'jquery', 'cdnjs']];
259467c1427SAndreas Gohr$meta['proxy____host'] = ['string', '_pattern' => '#^(|[a-z0-9\-\.+]+)$#i'];
260467c1427SAndreas Gohr$meta['proxy____port'] = ['numericopt'];
261467c1427SAndreas Gohr$meta['proxy____user'] = ['string'];
262467c1427SAndreas Gohr$meta['proxy____pass'] = ['password', '_code' => 'base64'];
263467c1427SAndreas Gohr$meta['proxy____ssl'] = ['onoff'];
264467c1427SAndreas Gohr$meta['proxy____except'] = ['string'];
265