From 0809416694ef3fd418601c850c3ddec07c0216d8 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Thu, 3 Dec 2009 12:52:11 +0100 Subject: [PATCH] Option for setting default parameters --- conf/default.php | 1 + conf/metadata.php | 2 ++ lang/en/settings.php | 1 + syntax.php | 3 +++ 4 files changed, 7 insertions(+) diff --git a/conf/default.php b/conf/default.php index 66039c3..5515176 100644 --- a/conf/default.php +++ b/conf/default.php @@ -6,3 +6,4 @@ $conf['allow_in_comments'] = 0; $conf['allowed_absolute_paths'] = DOKU_INC; $conf['web_paths'] = DOKU_URL; +$conf['defaults'] = ''; diff --git a/conf/metadata.php b/conf/metadata.php index 40a415a..b746aaa 100644 --- a/conf/metadata.php +++ b/conf/metadata.php @@ -9,3 +9,5 @@ $meta['allow_in_comments'] = array('onoff'); $meta['allowed_absolute_paths'] = array(''); $meta['web_paths'] = array(''); +$meta['defaults'] = array('string'); + diff --git a/lang/en/settings.php b/lang/en/settings.php index e0d0d33..c47a5b1 100644 --- a/lang/en/settings.php +++ b/lang/en/settings.php @@ -3,3 +3,4 @@ $lang['allow_in_comments'] = 'Whether to allow the filelist syntax to be used in comments.'; $lang['allowed_absolute_paths'] = 'Comma-separated list of absolute paths allowed for globbing.'; $lang['web_paths'] = 'Comma-separated list of urls by which to reach the corresponding absolute path from the previous list. MUST have the exact same number of entries as allowed_absolute_paths.'; +$lang['defaults'] = 'Default options. Use the same syntax as in inline configuration'; diff --git a/syntax.php b/syntax.php index 0fa406b..f5455c4 100644 --- a/syntax.php +++ b/syntax.php @@ -77,6 +77,9 @@ class syntax_plugin_filelist extends DokuWiki_Syntax_Plugin { } } + // load default config options + $flags = $this->getConf('defaults').'&'.$flags; + $flags = split('&', $flags); $params = array( 'sort' => 'name',