xref: /dokuwiki/lib/plugins/config/settings/config.metadata.php (revision f95ecbbf8b1de8bc1270d3cf91dfdf055ea5c78c)
1<?php
2/**
3 * Metadata for configuration manager plugin
4 *
5 * Note:  This file should be included within a function to ensure it
6 *        doesn't clash with the settings it is describing.
7 *
8 * Format:
9 *   $meta[<setting name>] = array(<handler class id>,<param name> => <param value>);
10 *
11 *   <handler class id>  is the handler class name without the "setting_" prefix
12 *
13 * Defined classes:
14 *   Generic (source: settings/config.class.php)
15 *   -------------------------------------------
16 *   ''             - default class ('setting'), textarea, minimal input validation, setting output in quotes
17 *   'string'       - single line text input, minimal input validation, setting output in quotes
18 *   'numeric'      - text input, accepts numbers and arithmetic operators, setting output without quotes
19 *                    if given the '_min' and '_max' parameters are used for validation
20 *   'numericopt'   - like above, but accepts empty values
21 *   'onoff'        - checkbox input, setting output  0|1
22 *   'multichoice'  - select input (single choice), setting output with quotes, required _choices parameter
23 *   'email'        - text input, input must conform to email address format, supports optional '_multiple'
24 *                    parameter for multiple comma separated email addresses
25 *   'password'     - password input, minimal input validation, setting output text in quotes, maybe encoded
26 *                    according to the _code parameter
27 *   'dirchoice'    - as multichoice, selection choices based on folders found at location specified in _dir
28 *                    parameter (required). A pattern can be used to restrict the folders to only those which
29 *                    match the pattern.
30 *   'multicheckbox'- a checkbox for each choice plus an "other" string input, config file setting is a comma
31 *                    separated list of checked choices
32 *   'fieldset'     - used to group configuration settings, but is not itself a setting. To make this clear in
33 *                    the language files the keys for this type should start with '_'.
34 *   'array'        - a simple (one dimensional) array of string values, shown as comma separated list in the
35 *                    config manager but saved as PHP array(). Values may not contain commas themselves.
36 *                    _pattern matching on the array values supported.
37 *   'regex'        - regular expression string, normally without delimiters; as for string, in addition tested
38 *                    to see if will compile & run as a regex.  in addition to _pattern, also accepts _delimiter
39 *                    (default '/') and _pregflags (default 'ui')
40 *
41 *  Single Setting (source: settings/extra.class.php)
42 *  -------------------------------------------------
43 *   'savedir'     - as 'setting', input tested against initpath() (inc/init.php)
44 *   'sepchar'     - as multichoice, selection constructed from string of valid values
45 *   'authtype'    - as 'setting', input validated against a valid php file at expected location for auth files
46 *   'im_convert'  - as 'setting', input must exist and be an im_convert module
47 *   'disableactions' - as 'setting'
48 *   'compression' - no additional parameters. checks php installation supports possible compression alternatives
49 *   'licence'     - as multichoice, selection constructed from licence strings in language files
50 *   'renderer'    - as multichoice, selection constructed from enabled renderer plugins which canRender()
51 *   'authtype'    - as multichoice, selection constructed from the enabled auth plugins
52 *
53 *  Any setting commented or missing will use 'setting' class - text input, minimal validation, quoted output
54 *
55 * Defined parameters:
56 *   '_caution'    - no value (default) or 'warning', 'danger', 'security'. display an alert along with the setting
57 *   '_pattern'    - string, a preg pattern. input is tested against this pattern before being accepted
58 *                   optional all classes, except onoff & multichoice which ignore it
59 *   '_choices'    - array of choices. used to populate a selection box. choice will be replaced by a localised
60 *                   language string, indexed by  <setting name>_o_<choice>, if one exists
61 *                   required by 'multichoice' & 'multicheckbox' classes, ignored by others
62 *   '_dir'        - location of directory to be used to populate choice list
63 *                   required by 'dirchoice' class, ignored by other classes
64 *   '_combine'    - complimentary output setting values which can be combined into a single display checkbox
65 *                   optional for 'multicheckbox', ignored by other classes
66 *   '_code'       - encoding method to use, accepted values: 'base64','uuencode','plain'.  defaults to plain.
67 *   '_min'        - minimum numeric value, optional for 'numeric' and 'numericopt', ignored by others
68 *   '_max'        - maximum numeric value, optional for 'numeric' and 'numericopt', ignored by others
69 *   '_delimiter'  - string, default '/', a single character used as a delimiter for testing regex input values
70 *   '_pregflags'  - string, default 'ui', valid preg pattern modifiers used when testing regex input values, for more
71 *                   information see http://uk1.php.net/manual/en/reference.pcre.pattern.modifiers.php
72 *   '_multiple'   - bool, allow multiple comma separated email values; optional for 'email', ignored by others
73 *
74 * @author    Chris Smith <chris@jalakai.co.uk>
75 */
76// ---------------[ settings for settings ]------------------------------
77$config['format']  = 'php';      // format of setting files, supported formats: php
78$config['varname'] = 'conf';     // name of the config variable, sans $
79
80// this string is written at the top of the rewritten settings file,
81// !! do not include any comment indicators !!
82// this value can be overriden when calling save_settings() method
83$config['heading'] = 'Dokuwiki\'s Main Configuration File - Local Settings';
84
85// test value (FIXME, remove before publishing)
86//$meta['test']     = array('multichoice','_choices' => array(''));
87
88// --------------[ setting metadata ]------------------------------------
89// - for description of format and fields see top of file
90// - order the settings in the order you wish them to appear
91// - any settings not mentioned will come after the last setting listed and
92//   will use the default class with no parameters
93
94$meta['_basic']   = array('fieldset');
95$meta['title']    = array('string');
96$meta['start']    = array('string','_caution' => 'warning','_pattern' => '!^[^:;/]+$!'); // don't accept namespaces
97$meta['lang']     = array('dirchoice','_dir' => DOKU_INC.'inc/lang/');
98$meta['template'] = array('dirchoice','_dir' => DOKU_INC.'lib/tpl/','_pattern' => '/^[\w-]+$/');
99$meta['tagline']  = array('string');
100$meta['sidebar']  = array('string');
101$meta['license']  = array('license');
102$meta['savedir']  = array('savedir','_caution' => 'danger');
103$meta['basedir']  = array('string','_caution' => 'danger');
104$meta['baseurl']  = array('string','_caution' => 'danger');
105$meta['cookiedir'] = array('string','_caution' => 'danger');
106$meta['dmode']    = array('numeric','_pattern' => '/0[0-7]{3,4}/'); // only accept octal representation
107$meta['fmode']    = array('numeric','_pattern' => '/0[0-7]{3,4}/'); // only accept octal representation
108$meta['allowdebug']  = array('onoff','_caution' => 'security');
109
110$meta['_display']    = array('fieldset');
111$meta['recent']      = array('numeric');
112$meta['recent_days'] = array('numeric');
113$meta['breadcrumbs'] = array('numeric','_min' => 0);
114$meta['youarehere']  = array('onoff');
115$meta['fullpath']    = array('onoff','_caution' => 'security');
116$meta['typography']  = array('multichoice','_choices' => array(0,1,2));
117$meta['dformat']     = array('string');
118$meta['signature']   = array('string');
119$meta['showuseras']  = array('multichoice','_choices' => array('loginname','username','username_link','email','email_link'));
120$meta['toptoclevel'] = array('multichoice','_choices' => array(1,2,3,4,5));   // 5 toc levels
121$meta['tocminheads'] = array('multichoice','_choices' => array(0,1,2,3,4,5,10,15,20));
122$meta['maxtoclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5));
123$meta['maxseclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5)); // 0 for no sec edit buttons
124$meta['camelcase']   = array('onoff','_caution' => 'warning');
125$meta['deaccent']    = array('multichoice','_choices' => array(0,1,2),'_caution' => 'warning');
126$meta['useheading']  = array('multichoice','_choices' => array(0,'navigation','content',1));
127$meta['sneaky_index'] = array('onoff');
128$meta['hidepages']   = array('regex');
129
130$meta['_authentication'] = array('fieldset');
131$meta['useacl']      = array('onoff','_caution' => 'danger');
132$meta['autopasswd']  = array('onoff');
133$meta['authtype']    = array('authtype','_caution' => 'danger');
134$meta['passcrypt']   = array('multichoice','_choices' => array('smd5','md5','apr1','sha1','ssha','lsmd5','crypt','mysql','my411','kmd5','pmd5','hmd5','mediawiki','bcrypt','djangomd5','djangosha1','sha512'));
135$meta['defaultgroup']= array('string');
136$meta['superuser']   = array('string','_caution' => 'danger');
137$meta['manager']     = array('string');
138$meta['profileconfirm'] = array('onoff');
139$meta['rememberme'] = array('onoff');
140$meta['disableactions'] = array('disableactions',
141                                '_choices' => array('backlink','index','recent','revisions','search','subscription','register','resendpwd','profile','profile_delete','edit','wikicode','check', 'rss'),
142                                '_combine' => array('subscription' => array('subscribe','unsubscribe'), 'wikicode' => array('source','export_raw')));
143$meta['auth_security_timeout'] = array('numeric');
144$meta['securecookie'] = array('onoff');
145$meta['remote']       = array('onoff','_caution' => 'security');
146$meta['remoteuser']   = array('string');
147
148$meta['_anti_spam']  = array('fieldset');
149$meta['usewordblock']= array('onoff');
150$meta['relnofollow'] = array('onoff');
151$meta['indexdelay']  = array('numeric');
152$meta['mailguard']   = array('multichoice','_choices' => array('visible','hex','none'));
153$meta['iexssprotect']= array('onoff','_caution' => 'security');
154
155$meta['_editing']    = array('fieldset');
156$meta['usedraft']    = array('onoff');
157$meta['htmlok']      = array('onoff','_caution' => 'security');
158$meta['phpok']       = array('onoff','_caution' => 'security');
159$meta['locktime']    = array('numeric');
160$meta['cachetime']   = array('numeric');
161
162$meta['_links']    = array('fieldset');
163$meta['target____wiki']      = array('string');
164$meta['target____interwiki'] = array('string');
165$meta['target____extern']    = array('string');
166$meta['target____media']     = array('string');
167$meta['target____windows']   = array('string');
168
169$meta['_media']      = array('fieldset');
170$meta['mediarevisions']  = array('onoff');
171$meta['gdlib']       = array('multichoice','_choices' => array(0,1,2));
172$meta['im_convert']  = array('im_convert');
173$meta['jpg_quality'] = array('numeric','_pattern' => '/^100$|^[1-9]?[0-9]$/');  //(0-100)
174$meta['fetchsize']   = array('numeric');
175$meta['refcheck']    = array('onoff');
176
177$meta['_notifications'] = array('fieldset');
178$meta['subscribers']    = array('onoff');
179$meta['subscribe_time'] = array('numeric');
180$meta['notify']         = array('email', '_multiple' => true);
181$meta['registernotify'] = array('email', '_multiple' => true);
182$meta['mailfrom']       = array('email', '_placeholders' => true);
183$meta['mailprefix']     = array('string');
184$meta['htmlmail']       = array('onoff');
185
186$meta['_syndication'] = array('fieldset');
187$meta['sitemap']     = array('numeric');
188$meta['rss_type']    = array('multichoice','_choices' => array('rss','rss1','rss2','atom','atom1'));
189$meta['rss_linkto']  = array('multichoice','_choices' => array('diff','page','rev','current'));
190$meta['rss_content'] = array('multichoice','_choices' => array('abstract','diff','htmldiff','html'));
191$meta['rss_media']   = array('multichoice','_choices' => array('both','pages','media'));
192$meta['rss_update']  = array('numeric');
193$meta['rss_show_summary'] = array('onoff');
194
195$meta['_advanced']   = array('fieldset');
196$meta['updatecheck'] = array('onoff');
197$meta['userewrite']  = array('multichoice','_choices' => array(0,1,2),'_caution' => 'danger');
198$meta['useslash']    = array('onoff');
199$meta['sepchar']     = array('sepchar','_caution' => 'warning');
200$meta['canonical']   = array('onoff');
201$meta['fnencode']    = array('multichoice','_choices' => array('url','safe','utf-8'),'_caution' => 'warning');
202$meta['autoplural']  = array('onoff');
203$meta['compress']    = array('onoff');
204$meta['cssdatauri']  = array('numeric','_pattern' => '/^\d+$/');
205$meta['gzip_output'] = array('onoff');
206$meta['send404']     = array('onoff');
207$meta['compression'] = array('compression','_caution' => 'warning');
208$meta['broken_iua']  = array('onoff');
209$meta['xsendfile']   = array('multichoice','_choices' => array(0,1,2,3),'_caution' => 'warning');
210$meta['renderer_xhtml'] = array('renderer','_format' => 'xhtml','_choices' => array('xhtml'),'_caution' => 'warning');
211$meta['readdircache'] = array('numeric');
212
213$meta['_network']    = array('fieldset');
214$meta['dnslookups']  = array('onoff');
215$meta['proxy____host'] = array('string','_pattern' => '#^(|[a-z0-9\-\.+]+)$#i');
216$meta['proxy____port'] = array('numericopt');
217$meta['proxy____user'] = array('string');
218$meta['proxy____pass'] = array('password','_code' => 'base64');
219$meta['proxy____ssl']  = array('onoff');
220$meta['proxy____except'] = array('string');
221$meta['safemodehack'] = array('onoff');
222$meta['ftp____host']  = array('string','_pattern' => '#^(|[a-z0-9\-\.+]+)$#i');
223$meta['ftp____port']  = array('numericopt');
224$meta['ftp____user']  = array('string');
225$meta['ftp____pass']  = array('password','_code' => 'base64');
226$meta['ftp____root']  = array('string');
227
228