[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/lib/plugins/config/settings/ -> config.metadata.php (source)

   1  <?php
   2  /**
   3   * Metadata for configuration manager plugin
   4   *
   5   * Note: This file is loaded in Loader::loadMeta().
   6   *
   7   * Format:
   8   *   $meta[<setting name>] = array(<handler class id>,<param name> => <param value>);
   9   *
  10   *   <handler class id>  is the handler class name without the "setting_" prefix
  11   *
  12   * Defined classes (see core/Setting/*):
  13   *   Generic
  14   *   -------------------------------------------
  15   *   ''             - default class ('setting'), textarea, minimal input validation, setting output in quotes
  16   *   'string'       - single line text input, minimal input validation, setting output in quotes
  17   *   'numeric'      - text input, accepts numbers and arithmetic operators, setting output without quotes
  18   *                    if given the '_min' and '_max' parameters are used for validation
  19   *   'numericopt'   - like above, but accepts empty values
  20   *   'onoff'        - checkbox input, setting output  0|1
  21   *   'multichoice'  - select input (single choice), setting output with quotes, required _choices parameter
  22   *   'email'        - text input, input must conform to email address format, supports optional '_multiple'
  23   *                    parameter for multiple comma separated email addresses
  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   *   'regex'        - regular expression string, normally without delimiters; as for string, in addition tested
  37   *                    to see if will compile & run as a regex.  in addition to _pattern, also accepts _delimiter
  38   *                    (default '/') and _pregflags (default 'ui')
  39   *
  40   *  Single Setting
  41   *  -------------------------------------------------
  42   *   'savedir'     - as 'setting', input tested against initpath() (inc/init.php)
  43   *   'sepchar'     - as multichoice, selection constructed from string of valid values
  44   *   'authtype'    - as 'setting', input validated against a valid php file at expected location for auth files
  45   *   'im_convert'  - as 'setting', input must exist and be an im_convert module
  46   *   'disableactions' - as 'setting'
  47   *   'compression' - no additional parameters. checks php installation supports possible compression alternatives
  48   *   'licence'     - as multichoice, selection constructed from licence strings in language files
  49   *   'renderer'    - as multichoice, selection constructed from enabled renderer plugins which canRender()
  50   *   'authtype'    - as multichoice, selection constructed from the enabled auth plugins
  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://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   *   '_other'      - how to handle other values (not listed in _choices). accepted values: 'always','exists','never'
  73   *                   default value 'always'. 'exists' only shows 'other' input field when the setting contains value(s)
  74   *                   not listed in choices (e.g. due to manual editing or update changing _choices).  This is safer than
  75   *                   'never' as it will not discard unknown/other values.
  76   *                   optional for 'multicheckbox', ignored by others
  77   *
  78   * The order of the settings influences the order in which they apppear in the config manager
  79   *
  80   * @author    Chris Smith <chris@jalakai.co.uk>
  81   */
  82  
  83  $meta['_basic']   = array('fieldset');
  84  $meta['title']    = array('string');
  85  $meta['start']    = array('string','_caution' => 'warning','_pattern' => '!^[^:;/]+$!'); // don't accept namespaces
  86  $meta['lang']     = array('dirchoice','_dir' => DOKU_INC.'inc/lang/');
  87  $meta['template'] = array('dirchoice','_dir' => DOKU_INC.'lib/tpl/','_pattern' => '/^[\w-]+$/');
  88  $meta['tagline']  = array('string');
  89  $meta['sidebar']  = array('string');
  90  $meta['license']  = array('license');
  91  $meta['savedir']  = array('savedir','_caution' => 'danger');
  92  $meta['basedir']  = array('string','_caution' => 'danger');
  93  $meta['baseurl']  = array('string','_caution' => 'danger');
  94  $meta['cookiedir'] = array('string','_caution' => 'danger');
  95  $meta['dmode']    = array('numeric','_pattern' => '/0[0-7]{3,4}/'); // only accept octal representation
  96  $meta['fmode']    = array('numeric','_pattern' => '/0[0-7]{3,4}/'); // only accept octal representation
  97  $meta['allowdebug']  = array('onoff','_caution' => 'security');
  98  
  99  $meta['_display']    = array('fieldset');
 100  $meta['recent']      = array('numeric');
 101  $meta['recent_days'] = array('numeric');
 102  $meta['breadcrumbs'] = array('numeric','_min' => 0);
 103  $meta['youarehere']  = array('onoff');
 104  $meta['fullpath']    = array('onoff','_caution' => 'security');
 105  $meta['typography']  = array('multichoice','_choices' => array(0,1,2));
 106  $meta['dformat']     = array('string');
 107  $meta['signature']   = array('string');
 108  $meta['showuseras'] = array(
 109      'multichoice',
 110      '_choices' => array('loginname', 'username', 'username_link', 'email', 'email_link')
 111  );
 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','_caution' => 'warning');
 117  $meta['deaccent']    = array('multichoice','_choices' => array(0,1,2),'_caution' => 'warning');
 118  $meta['useheading']  = array('multichoice','_choices' => array(0,'navigation','content',1));
 119  $meta['sneaky_index'] = array('onoff');
 120  $meta['hidepages']   = array('regex');
 121  
 122  $meta['_authentication'] = array('fieldset');
 123  $meta['useacl']      = array('onoff','_caution' => 'danger');
 124  $meta['autopasswd']  = array('onoff');
 125  $meta['authtype']    = array('authtype','_caution' => 'danger');
 126  $meta['passcrypt']   = array('multichoice','_choices' => array(
 127      'smd5','md5','apr1','sha1','ssha','lsmd5','crypt','mysql','my411','kmd5','pmd5','hmd5',
 128      'mediawiki','bcrypt','djangomd5','djangosha1','djangopbkdf2_sha1','djangopbkdf2_sha256',
 129      'sha512','argon2i','argon2id'
 130  ));
 131  $meta['defaultgroup']= array('string');
 132  $meta['superuser']   = array('string','_caution' => 'danger');
 133  $meta['manager']     = array('string');
 134  $meta['profileconfirm'] = array('onoff');
 135  $meta['rememberme'] = array('onoff');
 136  $meta['disableactions'] = array(
 137      'disableactions',
 138      '_choices' => array(
 139          'backlink',
 140          'index',
 141          'recent',
 142          'revisions',
 143          'search',
 144          'subscription',
 145          'register',
 146          'resendpwd',
 147          'profile',
 148          'profile_delete',
 149          'edit',
 150          'wikicode',
 151          'check',
 152          'rss'
 153      ),
 154      '_combine' => array(
 155          'subscription' => array('subscribe', 'unsubscribe'),
 156          'wikicode' => array('source', 'export_raw')
 157      )
 158  );
 159  $meta['auth_security_timeout'] = array('numeric');
 160  $meta['securecookie'] = array('onoff');
 161  $meta['remote']       = array('onoff','_caution' => 'security');
 162  $meta['remoteuser']   = array('string');
 163  
 164  $meta['_anti_spam']  = array('fieldset');
 165  $meta['usewordblock']= array('onoff');
 166  $meta['relnofollow'] = array('onoff');
 167  $meta['indexdelay']  = array('numeric');
 168  $meta['mailguard']   = array('multichoice','_choices' => array('visible','hex','none'));
 169  $meta['iexssprotect']= array('onoff','_caution' => 'security');
 170  
 171  $meta['_editing']    = array('fieldset');
 172  $meta['usedraft']    = array('onoff');
 173  $meta['htmlok']      = array('onoff','_caution' => 'security');
 174  $meta['phpok']       = array('onoff','_caution' => 'security');
 175  $meta['locktime']    = array('numeric');
 176  $meta['cachetime']   = array('numeric');
 177  
 178  $meta['_links']    = array('fieldset');
 179  $meta['target____wiki']      = array('string');
 180  $meta['target____interwiki'] = array('string');
 181  $meta['target____extern']    = array('string');
 182  $meta['target____media']     = array('string');
 183  $meta['target____windows']   = array('string');
 184  
 185  $meta['_media']      = array('fieldset');
 186  $meta['mediarevisions']  = array('onoff');
 187  $meta['gdlib']       = array('multichoice','_choices' => array(0,1,2));
 188  $meta['im_convert']  = array('im_convert');
 189  $meta['jpg_quality'] = array('numeric','_pattern' => '/^100$|^[1-9]?[0-9]$/');  //(0-100)
 190  $meta['fetchsize']   = array('numeric');
 191  $meta['refcheck']    = array('onoff');
 192  
 193  $meta['_notifications'] = array('fieldset');
 194  $meta['subscribers']    = array('onoff');
 195  $meta['subscribe_time'] = array('numeric');
 196  $meta['notify']         = array('email', '_multiple' => true);
 197  $meta['registernotify'] = array('email', '_multiple' => true);
 198  $meta['mailfrom']       = array('email', '_placeholders' => true);
 199  $meta['mailreturnpath']       = array('email', '_placeholders' => true);
 200  $meta['mailprefix']     = array('string');
 201  $meta['htmlmail']       = array('onoff');
 202  
 203  $meta['_syndication'] = array('fieldset');
 204  $meta['sitemap']     = array('numeric');
 205  $meta['rss_type']    = array('multichoice','_choices' => array('rss','rss1','rss2','atom','atom1'));
 206  $meta['rss_linkto']  = array('multichoice','_choices' => array('diff','page','rev','current'));
 207  $meta['rss_content'] = array('multichoice','_choices' => array('abstract','diff','htmldiff','html'));
 208  $meta['rss_media']   = array('multichoice','_choices' => array('both','pages','media'));
 209  $meta['rss_update']  = array('numeric');
 210  $meta['rss_show_summary'] = array('onoff');
 211  $meta['rss_show_deleted'] = array('onoff');
 212  
 213  $meta['_advanced']   = array('fieldset');
 214  $meta['updatecheck'] = array('onoff');
 215  $meta['userewrite']  = array('multichoice','_choices' => array(0,1,2),'_caution' => 'danger');
 216  $meta['useslash']    = array('onoff');
 217  $meta['sepchar']     = array('sepchar','_caution' => 'warning');
 218  $meta['canonical']   = array('onoff');
 219  $meta['fnencode']    = array('multichoice','_choices' => array('url','safe','utf-8'),'_caution' => 'warning');
 220  $meta['autoplural']  = array('onoff');
 221  $meta['compress']    = array('onoff');
 222  $meta['cssdatauri']  = array('numeric','_pattern' => '/^\d+$/');
 223  $meta['gzip_output'] = array('onoff');
 224  $meta['send404']     = array('onoff');
 225  $meta['compression'] = array('compression','_caution' => 'warning');
 226  $meta['broken_iua']  = array('onoff');
 227  $meta['xsendfile']   = array('multichoice','_choices' => array(0,1,2,3),'_caution' => 'warning');
 228  $meta['renderer_xhtml'] = array('renderer','_format' => 'xhtml','_choices' => array('xhtml'),'_caution' => 'warning');
 229  $meta['readdircache'] = array('numeric');
 230  $meta['search_nslimit'] = array('numeric', '_min' => 0);
 231  $meta['search_fragment'] = array('multichoice','_choices' => array('exact', 'starts_with', 'ends_with', 'contains'),);
 232  $meta['trustedproxy'] = array('regex');
 233  
 234  $meta['_feature_flags'] = ['fieldset'];
 235  $meta['defer_js']       = ['onoff'];
 236  
 237  $meta['_network']    = array('fieldset');
 238  $meta['dnslookups']  = array('onoff');
 239  $meta['jquerycdn']   = array('multichoice', '_choices' => array(0,'jquery', 'cdnjs'));
 240  $meta['proxy____host'] = array('string','_pattern' => '#^(|[a-z0-9\-\.+]+)$#i');
 241  $meta['proxy____port'] = array('numericopt');
 242  $meta['proxy____user'] = array('string');
 243  $meta['proxy____pass'] = array('password','_code' => 'base64');
 244  $meta['proxy____ssl']  = array('onoff');
 245  $meta['proxy____except'] = array('string');