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