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