[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

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

   1  <?php
   2  
   3  /**
   4   * Metadata for configuration manager plugin
   5   *
   6   * Note: This file is loaded in Loader::loadMeta().
   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 (see core/Setting/*):
  14   *   Generic
  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
  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   *   'authtype'    - as multichoice, selection constructed from the enabled auth plugins
  52   *
  53   *  Any setting commented or missing will use 'setting' class - text input, minimal validation, quoted output
  54   *
  55   * Defined parameters:
  56   *   '_caution'    - no value (default) or 'warning', 'danger', 'security'. display an alert along with the setting
  57   *   '_pattern'    - string, a preg pattern. input is tested against this pattern before being accepted
  58   *                   optional all classes, except onoff & multichoice which ignore it
  59   *   '_choices'    - array of choices. used to populate a selection box. choice will be replaced by a localised
  60   *                   language string, indexed by  <setting name>_o_<choice>, if one exists
  61   *                   required by 'multichoice' & 'multicheckbox' classes, ignored by others
  62   *   '_dir'        - location of directory to be used to populate choice list
  63   *                   required by 'dirchoice' class, ignored by other classes
  64   *   '_combine'    - complimentary output setting values which can be combined into a single display checkbox
  65   *                   optional for 'multicheckbox', ignored by other classes
  66   *   '_code'       - encoding method to use, accepted values: 'base64','uuencode','plain'.  defaults to plain.
  67   *   '_min'        - minimum numeric value, optional for 'numeric' and 'numericopt', ignored by others
  68   *   '_max'        - maximum numeric value, optional for 'numeric' and 'numericopt', ignored by others
  69   *   '_delimiter'  - string, default '/', a single character used as a delimiter for testing regex input values
  70   *   '_pregflags'  - string, default 'ui', valid preg pattern modifiers used when testing regex input values, for more
  71   *                   information see http://php.net/manual/en/reference.pcre.pattern.modifiers.php
  72   *   '_multiple'   - bool, allow multiple comma separated email values; optional for 'email', ignored by others
  73   *   '_other'      - how to handle other values (not listed in _choices). accepted values: 'always','exists','never'
  74   *                   default value 'always'. 'exists' only shows 'other' input field when the setting contains value(s)
  75   *                   not listed in choices (e.g. due to manual editing or update changing _choices).  This is safer than
  76   *                   'never' as it will not discard unknown/other values.
  77   *                   optional for 'multicheckbox', ignored by others
  78   *
  79   * The order of the settings influences the order in which they apppear in the config manager
  80   *
  81   * @author    Chris Smith <chris@jalakai.co.uk>
  82   */
  83  
  84  $meta['_basic'] = ['fieldset'];
  85  $meta['title'] = ['string'];
  86  $meta['start'] = ['string', '_caution' => 'warning', '_pattern' => '!^[^:;/]+$!']; // don't accept namespaces
  87  $meta['lang'] = ['dirchoice', '_dir' => DOKU_INC . 'inc/lang/'];
  88  $meta['template'] = ['dirchoice', '_dir' => DOKU_INC . 'lib/tpl/', '_pattern' => '/^[\w-]+$/'];
  89  $meta['tagline'] = ['string'];
  90  $meta['sidebar'] = ['string'];
  91  $meta['license'] = ['license'];
  92  $meta['savedir'] = ['savedir', '_caution' => 'danger'];
  93  $meta['basedir'] = ['string', '_caution' => 'danger'];
  94  $meta['baseurl'] = ['string', '_caution' => 'danger'];
  95  $meta['cookiedir'] = ['string', '_caution' => 'danger'];
  96  $meta['dmode'] = ['numeric', '_pattern' => '/0[0-7]{3,4}/']; // only accept octal representation
  97  $meta['fmode'] = ['numeric', '_pattern' => '/0[0-7]{3,4}/']; // only accept octal representation
  98  $meta['allowdebug'] = ['onoff', '_caution' => 'security'];
  99  
 100  $meta['_display'] = ['fieldset'];
 101  $meta['recent'] = ['numeric'];
 102  $meta['recent_days'] = ['numeric'];
 103  $meta['breadcrumbs'] = ['numeric', '_min' => 0];
 104  $meta['youarehere'] = ['onoff'];
 105  $meta['fullpath'] = ['onoff', '_caution' => 'security'];
 106  $meta['typography'] = ['multichoice', '_choices' => [0, 1, 2]];
 107  $meta['dformat'] = ['string'];
 108  $meta['signature'] = ['string'];
 109  $meta['showuseras'] = ['multichoice', '_choices' => ['loginname', 'username', 'username_link', 'email', 'email_link']];
 110  $meta['toptoclevel'] = ['multichoice', '_choices' => [1, 2, 3, 4, 5]];   // 5 toc levels
 111  $meta['tocminheads'] = ['multichoice', '_choices' => [0, 1, 2, 3, 4, 5, 10, 15, 20]];
 112  $meta['maxtoclevel'] = ['multichoice', '_choices' => [0, 1, 2, 3, 4, 5]];
 113  $meta['maxseclevel'] = ['multichoice', '_choices' => [0, 1, 2, 3, 4, 5]]; // 0 for no sec edit buttons
 114  $meta['camelcase'] = ['onoff', '_caution' => 'warning'];
 115  $meta['deaccent'] = ['multichoice', '_choices' => [0, 1, 2], '_caution' => 'warning'];
 116  $meta['useheading'] = ['multichoice', '_choices' => [0, 'navigation', 'content', 1]];
 117  $meta['sneaky_index'] = ['onoff'];
 118  $meta['hidepages'] = ['regex'];
 119  
 120  $meta['_authentication'] = ['fieldset'];
 121  $meta['useacl'] = ['onoff', '_caution' => 'danger'];
 122  $meta['autopasswd'] = ['onoff'];
 123  $meta['authtype'] = ['authtype', '_caution' => 'danger'];
 124  $meta['passcrypt'] = ['multichoice',
 125      '_choices' => [
 126          'smd5',
 127          'md5',
 128          'apr1',
 129          'sha1',
 130          'ssha',
 131          'lsmd5',
 132          'crypt',
 133          'mysql',
 134          'my411',
 135          'kmd5',
 136          'pmd5',
 137          'hmd5',
 138          'mediawiki',
 139          'bcrypt',
 140          'djangomd5',
 141          'djangosha1',
 142          'djangopbkdf2_sha1',
 143          'djangopbkdf2_sha256',
 144          'sha512',
 145          'argon2i',
 146          'argon2id']
 147  ];
 148  $meta['defaultgroup'] = ['string'];
 149  $meta['superuser'] = ['string', '_caution' => 'danger'];
 150  $meta['manager'] = ['string'];
 151  $meta['profileconfirm'] = ['onoff'];
 152  $meta['rememberme'] = ['onoff'];
 153  $meta['disableactions'] = ['disableactions',
 154      '_choices' => [
 155          'backlink',
 156          'index',
 157          'recent',
 158          'revisions',
 159          'search',
 160          'subscription',
 161          'register',
 162          'resendpwd',
 163          'profile',
 164          'profile_delete',
 165          'edit',
 166          'wikicode',
 167          'check',
 168          'rss'
 169      ],
 170      '_combine' => [
 171          'subscription' => ['subscribe', 'unsubscribe'],
 172          'wikicode' => ['source', 'export_raw']
 173      ]
 174  ];
 175  $meta['auth_security_timeout'] = ['numeric'];
 176  $meta['securecookie'] = ['onoff'];
 177  $meta['samesitecookie'] = ['multichoice', '_choices' => ['', 'Lax', 'Strict', 'None']];
 178  $meta['remote'] = ['onoff', '_caution' => 'security'];
 179  $meta['remoteuser'] = ['string'];
 180  $meta['remotecors'] = ['string', '_caution' => 'security'];
 181  
 182  $meta['_anti_spam'] = ['fieldset'];
 183  $meta['usewordblock'] = ['onoff'];
 184  $meta['relnofollow'] = ['onoff'];
 185  $meta['indexdelay'] = ['numeric'];
 186  $meta['mailguard'] = ['multichoice', '_choices' => ['visible', 'hex', 'none']];
 187  $meta['iexssprotect'] = ['onoff', '_caution' => 'security'];
 188  
 189  $meta['_editing'] = ['fieldset'];
 190  $meta['usedraft'] = ['onoff'];
 191  $meta['locktime'] = ['numeric'];
 192  $meta['cachetime'] = ['numeric'];
 193  
 194  $meta['_links'] = ['fieldset'];
 195  $meta['target____wiki'] = ['string'];
 196  $meta['target____interwiki'] = ['string'];
 197  $meta['target____extern'] = ['string'];
 198  $meta['target____media'] = ['string'];
 199  $meta['target____windows'] = ['string'];
 200  
 201  $meta['_media'] = ['fieldset'];
 202  $meta['mediarevisions'] = ['onoff'];
 203  $meta['gdlib'] = ['multichoice', '_choices' => [0, 1, 2]];
 204  $meta['im_convert'] = ['im_convert'];
 205  $meta['jpg_quality'] = ['numeric', '_pattern' => '/^100$|^[1-9]?\d$/'];  //(0-100)
 206  $meta['fetchsize'] = ['numeric'];
 207  $meta['refcheck'] = ['onoff'];
 208  
 209  $meta['_notifications'] = ['fieldset'];
 210  $meta['subscribers'] = ['onoff'];
 211  $meta['subscribe_time'] = ['numeric'];
 212  $meta['notify'] = ['email', '_multiple' => true];
 213  $meta['registernotify'] = ['email', '_multiple' => true];
 214  $meta['mailfrom'] = ['email', '_placeholders' => true];
 215  $meta['mailreturnpath'] = ['email', '_placeholders' => true];
 216  $meta['mailprefix'] = ['string'];
 217  $meta['htmlmail'] = ['onoff'];
 218  $meta['dontlog'] = ['disableactions', '_choices' => ['error', 'debug', 'deprecated']];
 219  $meta['logretain'] = ['numeric', '_min' => 0, '_pattern' => '/^\d+$/'];
 220  
 221  $meta['_syndication'] = ['fieldset'];
 222  $meta['sitemap'] = ['numeric'];
 223  $meta['rss_type'] = ['multichoice', '_choices' => ['rss', 'rss1', 'rss2', 'atom', 'atom1']];
 224  $meta['rss_linkto'] = ['multichoice', '_choices' => ['diff', 'page', 'rev', 'current']];
 225  $meta['rss_content'] = ['multichoice', '_choices' => ['abstract', 'diff', 'htmldiff', 'html']];
 226  $meta['rss_media'] = ['multichoice', '_choices' => ['both', 'pages', 'media']];
 227  $meta['rss_update'] = ['numeric'];
 228  $meta['rss_show_summary'] = ['onoff'];
 229  $meta['rss_show_deleted'] = ['onoff'];
 230  
 231  $meta['_advanced'] = ['fieldset'];
 232  $meta['updatecheck'] = ['onoff'];
 233  $meta['userewrite'] = ['multichoice', '_choices' => [0, 1, 2], '_caution' => 'danger'];
 234  $meta['useslash'] = ['onoff'];
 235  $meta['sepchar'] = ['sepchar', '_caution' => 'warning'];
 236  $meta['canonical'] = ['onoff'];
 237  $meta['fnencode'] = ['multichoice', '_choices' => ['url', 'safe', 'utf-8'], '_caution' => 'warning'];
 238  $meta['autoplural'] = ['onoff'];
 239  $meta['compress'] = ['onoff'];
 240  $meta['cssdatauri'] = ['numeric', '_pattern' => '/^\d+$/'];
 241  $meta['gzip_output'] = ['onoff'];
 242  $meta['send404'] = ['onoff'];
 243  $meta['compression'] = ['compression', '_caution' => 'warning'];
 244  $meta['broken_iua'] = ['onoff'];
 245  $meta['xsendfile'] = ['multichoice', '_choices' => [0, 1, 2, 3], '_caution' => 'warning'];
 246  $meta['renderer_xhtml'] = ['renderer', '_format' => 'xhtml', '_choices' => ['xhtml'], '_caution' => 'warning'];
 247  $meta['readdircache'] = ['numeric'];
 248  $meta['search_nslimit'] = ['numeric', '_min' => 0];
 249  $meta['search_fragment'] = ['multichoice', '_choices' => ['exact', 'starts_with', 'ends_with', 'contains']];
 250  $meta['trustedproxy'] = ['regex'];
 251  
 252  $meta['_feature_flags'] = ['fieldset'];
 253  $meta['defer_js'] = ['onoff'];
 254  $meta['hidewarnings'] = ['onoff'];
 255  
 256  $meta['_network'] = ['fieldset'];
 257  $meta['dnslookups'] = ['onoff'];
 258  $meta['jquerycdn'] = ['multichoice', '_choices' => [0, 'jquery', 'cdnjs']];
 259  $meta['proxy____host'] = ['string', '_pattern' => '#^(|[a-z0-9\-\.+]+)$#i'];
 260  $meta['proxy____port'] = ['numericopt'];
 261  $meta['proxy____user'] = ['string'];
 262  $meta['proxy____pass'] = ['password', '_code' => 'base64'];
 263  $meta['proxy____ssl'] = ['onoff'];
 264  $meta['proxy____except'] = ['string'];