xref: /dokuwiki/lib/plugins/config/settings/config.metadata.php (revision cd7fd4a2c78ff5083a121a441142649ab5f6acad)
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 class 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
15 *   -------------
16 *   ''             - default class ('setting'), text input, minimal input validation, setting output in quotes
17 *   'numeric'      - text input, accepts numbers and arithmetic operators, setting output without quotes
18 *   'onoff'        - checkbox input, setting output  0|1
19 *   'multichoice'  - select input (single choice), setting output with quotes, required _choices parameter
20 *   'email'        - text input, input must conform to email address format, setting output in quotes
21 *   'password'     - password input, minimal input validation, setting output plain text in quotes
22 *   'dirchoice'    - as multichoice, selection choices based on folders found at location specified in _dir
23 *                    parameter (required)
24 *
25 *  Single Setting
26 *  --------------
27 *   'savedir'     - as 'setting', input tested against initpath() (inc/init.php)
28 *   'sepchar'     - as multichoice, selection constructed from string of valid values
29 *   'authtype'    - as 'setting', input validated against a valid php file at expected location for auth files
30 *   'im_convert'  - as 'setting', input must exist and be an im_convert module
31 *
32 *  Any setting commented or missing will use 'setting' class - text input, minimal validation, quoted output
33 *
34 * Defined parameters:
35 *   '_pattern'    - string, a preg pattern. input is tested against this pattern before being accepted
36 *                   optional all classes, except onoff, multichoice & dirchoice which ignore it
37 *   '_choices'    - array of choices. used to populate a selection box. choice will be replaced by a localised
38 *                   language string, indexed by  <setting name>_o_<choice>, if one exists
39 *                   required by 'multichoice' class, ignored by other classes
40 *   '_dir'        - location of directory to be used to populate choice list
41 *                   required by 'dirchoice' class, ignored by other classes
42 *
43 * @author    Chris Smith <chris@jalakai.co.uk>
44 */
45// ---------------[ settings for settings ]------------------------------
46$config['format']  = 'php';      // format of setting files, supported formats: php
47$config['varname'] = 'conf';     // name of the config variable, sans $
48
49// this string is written at the top of the rewritten settings file,
50// !! do not include any comment indicators !!
51// this value can be overriden when calling save_settings() method
52$config['heading'] = 'Dokuwiki\'s Main Configuration File - Local Settings';
53
54// ---------------[ setting files ]--------------------------------------
55// these values can be string expressions, they will be eval'd before use
56$file['local']     = "DOKU_CONF.'local.php'";            // mandatory (file doesn't have to exist)
57$file['default']   = "DOKU_CONF.'dokuwiki.php'";         // optional
58$file['protected'] = "DOKU_CONF.'local.protected.php'";  // optional
59
60// test value (FIXME, remove before publishing)
61//$meta['test']     = array('multichoice','_choices' => array(''));
62
63// --------------[ setting metadata ]------------------------------------
64// - for description of format and fields see top of file
65// - order the settings in the order you wish them to appear
66// - any settings not mentioned will come after the last setting listed and
67//   will use the default class with no parameters
68
69$meta['title']    = array('string');
70$meta['start']    = array('string');
71$meta['savedir']  = array('savedir');
72$meta['lang']     = array('dirchoice','_dir' => DOKU_INC.'inc/lang/');
73$meta['template'] = array('dirchoice','_dir' => DOKU_INC.'lib/tpl/');
74
75$meta['dmode']    = array('numeric','_pattern' => '/0[0-7]{3}/');  // only accept octal representation
76$meta['fmode']    = array('numeric','_pattern' => '/0[0-7]{3}/');  // only accept octal representation
77$meta['basedir']  = array('string');
78$meta['baseurl']  = array('string');
79
80$meta['fullpath']    = array('onoff');
81$meta['recent']      = array('numeric');
82$meta['breadcrumbs'] = array('numeric');
83$meta['youarehere']  = array('onoff');
84$meta['typography']  = array('onoff');
85$meta['htmlok']      = array('onoff');
86$meta['phpok']       = array('onoff');
87$meta['dformat']     = array('string');
88$meta['signature']   = array('string');
89$meta['toptoclevel'] = array('multichoice','_choices' => array(1,2,3,4,5));   // 5 toc levels
90$meta['maxtoclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5));
91$meta['maxseclevel'] = array('multichoice','_choices' => array(0,1,2,3,4,5)); // 0 for no sec edit buttons
92$meta['camelcase']   = array('onoff');
93$meta['deaccent']    = array('multichoice','_choices' => array(0,1,2));
94$meta['useheading']  = array('onoff');
95$meta['refcheck']    = array('onoff');
96$meta['refshow']     = array('numeric');
97$meta['allowdebug']  = array('onoff');
98
99$meta['usewordblock']= array('onoff');
100$meta['indexdelay']  = array('numeric');
101$meta['relnofollow'] = array('onoff');
102$meta['mailguard']   = array('multichoice','_choices' => array('visible','hex','none'));
103
104$meta['useacl']      = array('onoff');
105$meta['openregister']= array('onoff');
106$meta['autopasswd']  = array('onoff');
107$meta['resendpasswd'] = array('onoff');
108$meta['authtype']    = array('authtype');
109$meta['passcrypt']   = array('multichoice','_choices' => array('smd5','md5','sha1','ssha','crypt','mysql','my411'));
110$meta['defaultgroup']= array('string');
111$meta['superuser']   = array('string');
112$meta['profileconfirm'] = array('onoff');
113
114$meta['userewrite']  = array('multichoice','_choices' => array(0,1,2));
115$meta['useslash']    = array('onoff');
116$meta['usedraft']    = array('onoff');
117$meta['sepchar']     = array('sepchar');
118$meta['canonical']   = array('onoff');
119$meta['autoplural']  = array('onoff');
120$meta['usegzip']     = array('onoff');
121$meta['cachetime']   = array('numeric');
122$meta['purgeonadd']  = array('onoff');
123$meta['locktime']    = array('numeric');
124$meta['notify']      = array('email');
125$meta['mailfrom']    = array('email');
126$meta['gdlib']       = array('multichoice','_choices' => array(0,1,2));
127$meta['im_convert']  = array('im_convert');
128$meta['spellchecker']= array('onoff');
129$meta['subscribers'] = array('onoff');
130$meta['compress']    = array('onoff');
131$meta['hidepages']   = array('string');
132$meta['send404']     = array('onoff');
133$meta['sitemap']     = array('numeric');
134
135$meta['rss_type']    = array('multichoice','_choices' => array('rss','rss1','rss2','atom'));
136$meta['rss_linkto']  = array('multichoice','_choices' => array('diff','page','rev','current'));
137$meta['rss_update']  = array('numeric');
138
139$meta['target____wiki']      = array('string');
140$meta['target____interwiki'] = array('string');
141$meta['target____extern']    = array('string');
142$meta['target____media']     = array('string');
143$meta['target____windows']   = array('string');
144
145$meta['proxy____host'] = array('string','_pattern' => '#^[a-z0-9\-\.+]+?#i');
146$meta['proxy____port'] = array('numeric');
147$meta['proxy____user'] = array('string');
148$meta['proxy____pass'] = array('password');
149$meta['proxy____ssl']  = array('onoff');
150
151$meta['safemodehack'] = array('onoff');
152$meta['ftp____host']  = array('string','_pattern' => '#^[a-z0-9\-\.+]+?#i');
153$meta['ftp____port']  = array('numeric');
154$meta['ftp____user']  = array('string');
155$meta['ftp____pass']  = array('password');
156$meta['ftp____root']  = array('string');
157
158