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