From 20e7ccb0f10f57918093f76e85ca7afe71efb3bf Mon Sep 17 00:00:00 2001 From: chris <chris@jalakai.co.uk> Date: Thu, 26 Jan 2006 02:13:42 +0100 Subject: [PATCH] config plugin update & removal of $conf['pluginmanager'] option darcs-hash:20060126011342-9b6ab-40d04573bef34fa4012edac74186355b9a7ff0d9.gz --- conf/dokuwiki.php | 1 - inc/pluginutils.php | 45 ------------------- lib/plugins/config/lang/en/lang.php | 6 +-- .../config/settings/config.metadata.php | 2 +- lib/plugins/config/settings/extra.class.php | 30 +++++-------- lib/plugins/plugin/admin.php | 2 +- 6 files changed, 15 insertions(+), 71 deletions(-) diff --git a/conf/dokuwiki.php b/conf/dokuwiki.php index 1e4ec61d5..2cbcf48b3 100644 --- a/conf/dokuwiki.php +++ b/conf/dokuwiki.php @@ -77,7 +77,6 @@ $conf['gdlib'] = 2; //the GDlib version (0, 1 or 2) 2 tries $conf['im_convert'] = ''; //path to ImageMagicks convert (will be used instead of GD) $conf['spellchecker']= 0; //enable Spellchecker (needs PHP >= 4.3.0 and aspell installed) $conf['subscribers'] = 0; //enable change notice subscription support -$conf['pluginmanager'] = 0; //enable automated plugin management (requires plugin) $conf['compress'] = 1; //Strip whitespaces and comments from Styles and JavaScript? 1|0 $conf['hidepages'] = ''; //Regexp for pages to be skipped from RSS, Search and Recent Changes $conf['send404'] = 0; //Send a HTTP 404 status for non existing pages? diff --git a/inc/pluginutils.php b/inc/pluginutils.php index 2b1dd4aa8..fe51e5f13 100644 --- a/inc/pluginutils.php +++ b/inc/pluginutils.php @@ -6,51 +6,6 @@ * @author Andreas Gohr <andi@splitbrain.org> */ -/** - * prints needed HTML to include plugin CSS and JS files - * - * @deprecated - now handled by the style and script loader in lib/exe - */ -function plugin_printCSSJS(){ - global $conf; - - if (isset($conf['pluginmanager']) && $conf['pluginmanager'] && - // implicit check that plugin manager has setup the aggregated files - it has styles of its own - @file_exists(DOKU_INC.'lib/plugins/plugin_style.css')) { - // individual plugin instances of the files swept into one file each - $dir = "lib/plugins/plugin_"; - if(@file_exists(DOKU_INC.$dir.'style.css')){ - print ' <link rel="stylesheet" type="text/css" href="'.DOKU_BASE.$dir.'style.css" />'."\n"; - } - if(@file_exists(DOKU_INC.$dir.'screen.css')){ - print ' <link rel="stylesheet" media="screen" type="text/css" href="'.DOKU_BASE.$dir.'screen.css" />'."\n"; - } - if(@file_exists(DOKU_INC.$dir.'print.css')){ - print ' <link rel="stylesheet" media="print" type="text/css" href="'.DOKU_BASE.$dir.'print.css" />'."\n"; - } - if(@file_exists(DOKU_INC.$dir.'script.js')){ - print ' <script type="text/javascript" charset="utf-8" src="'.DOKU_BASE.$dir.'script.js"></script>'."\n"; - } - } else { - // no plugin manager (or aggregate files not setup) so individual instances of these files for any plugin that uses them - $plugins = plugin_list(); - foreach ($plugins as $p){ - $dir = "lib/plugins/$p/"; - if(@file_exists(DOKU_INC.$dir.'style.css')){ - print ' <link rel="stylesheet" type="text/css" href="'.DOKU_BASE.$dir.'style.css" />'."\n"; - } - if(@file_exists(DOKU_INC.$dir.'screen.css')){ - print ' <link rel="stylesheet" media="screen" type="text/css" href="'.DOKU_BASE.$dir.'screen.css" />'."\n"; - } - if(@file_exists(DOKU_INC.$dir.'print.css')){ - print ' <link rel="stylesheet" media="print" type="text/css" href="'.DOKU_BASE.$dir.'print.css" />'."\n"; - } - if(@file_exists(DOKU_INC.$dir.'script.js')){ - print ' <script type="text/javascript" charset="utf-8" src="'.DOKU_BASE.$dir.'script.js"></script>'."\n"; - } - } - } -} /** * Returns a list of available plugins of given type diff --git a/lib/plugins/config/lang/en/lang.php b/lib/plugins/config/lang/en/lang.php index 8ca97640a..f897e9a61 100644 --- a/lib/plugins/config/lang/en/lang.php +++ b/lib/plugins/config/lang/en/lang.php @@ -47,10 +47,11 @@ $lang['deaccent'] = 'deaccent in pagenames'; //convert accented chars to u $lang['useheading'] = 'use first heading'; //use the first heading in a page as its name $lang['refcheck'] = 'media reference check'; //check for references before deleting media files $lang['refshow'] = 'media references to show'; //how many references should be shown, 5 is a good value +$lang['allowdebug'] = 'allow debug (disable!)'; //make debug possible, disable after install! 0|1 $lang['usewordblock']= 'block spam based on words'; //block spam based on words? 0|1 $lang['indexdelay'] = 'time delay before indexing'; //allow indexing after this time (seconds) default is 5 days -$lang['relnofollow'] = 'use rel no follow'; //use rel="nofollow" for external links? +$lang['relnofollow'] = 'use rel="nofollow"'; //use rel="nofollow" for external links? $lang['mailguard'] = 'obfuscate email addresses'; //obfuscate email addresses against spam harvesters? /* Authentication Options - read http://www.splitbrain.org/dokuwiki/wiki:acl */ @@ -79,7 +80,6 @@ $lang['gdlib'] = 'GD Lib version'; //the GDlib version (0, 1 $lang['im_convert'] = 'imagemagick path'; //path to ImageMagicks convert (will be used instead of GD) $lang['spellchecker']= 'enable spellchecker'; //enable Spellchecker (needs PHP >= 4.3.0 and aspell installed) $lang['subscribers'] = 'enable subscription support'; //enable change notice subscription support -$lang['pluginmanager'] = 'enable plugin manager'; //enable automated plugin management (requires plugin) $lang['compress'] = 'Compress CSS & javascript files'; //Strip whitespaces and comments from Styles and JavaScript? 1|0 $lang['hidepages'] = 'Hide matching pages (regex)'; //Regexp for pages to be skipped from RSS, Search and Recent Changes $lang['send404'] = 'Send "HTTP404/Page Not Found"'; //Send a HTTP 404 status for non existing pages? @@ -116,7 +116,7 @@ $lang['userewrite_o_1'] = 'htaccess'; $lang['userewrite_o_2'] = 'dokuwiki'; /* gdlib options */ -$lang['gdlib_o_0'] = 'version 0.x'; +$lang['gdlib_o_0'] = 'GD Lib not available'; $lang['gdlib_o_1'] = 'version 1.x'; $lang['gdlib_o_2'] = 'autodetect'; diff --git a/lib/plugins/config/settings/config.metadata.php b/lib/plugins/config/settings/config.metadata.php index ff38b6b2b..c69bb8f36 100644 --- a/lib/plugins/config/settings/config.metadata.php +++ b/lib/plugins/config/settings/config.metadata.php @@ -93,6 +93,7 @@ $meta['deaccent'] = array('onoff'); $meta['useheading'] = array('onoff'); $meta['refcheck'] = array('onoff'); $meta['refshow'] = array('numeric'); +$meta['allowdebug'] = array('onoff'); $meta['usewordblock']= array('onoff'); $meta['indexdelay'] = array('numeric'); @@ -123,7 +124,6 @@ $meta['gdlib'] = array('multichoice','_choices' => array(0,1,2)); $meta['im_convert'] = array('im_convert'); $meta['spellchecker']= array('onoff'); $meta['subscribers'] = array('onoff'); -$meta['pluginmanager'] = array('onoff'); $meta['compress'] = array('onoff'); $meta['hidepages'] = array(''); $meta['send404'] = array('onoff'); diff --git a/lib/plugins/config/settings/extra.class.php b/lib/plugins/config/settings/extra.class.php index 0c5d9866e..619df8618 100644 --- a/lib/plugins/config/settings/extra.class.php +++ b/lib/plugins/config/settings/extra.class.php @@ -40,28 +40,18 @@ if (!class_exists('setting_savedir')) { } if (!class_exists('setting_authtype')) { - class setting_authtype extends setting { - var $_pattern = '#^[a-zA-Z0-9_]*$#'; + class setting_authtype extends setting_multichoice { - function update($input) { - if ($this->is_protected()) return false; - - $input = trim($input); - - $value = is_null($this->_local) ? $this->_default : $this->_local; - if ($value == $input) return false; + function initialize($default,$local,$protected) { - if (preg_match($this->_pattern, $input)) { - if (@file_exists(DOKU_INC.'inc/auth/'.$input.'.class.php') || - @file_exists(DOKU_INC.'inc/auth/'.$input.'.php')) { - $this->_local = $input; - return true; - } - } - - $this->_error = true; - $this->_input = $input; - return false; + // populate $this->_choices with a list of available auth mechanisms + $authtypes = glob(DOKU_INC.'inc/auth/*.class.php'); + $authtypes = preg_replace('#^.*/([^/]*)\.class\.php$#i','$1', $authtypes); + sort($authtypes); + + $this->_choices = $authtypes; + + parent::initialize($default,$local,$protected); } } } diff --git a/lib/plugins/plugin/admin.php b/lib/plugins/plugin/admin.php index 0f25cbc85..4c6621c15 100644 --- a/lib/plugins/plugin/admin.php +++ b/lib/plugins/plugin/admin.php @@ -40,7 +40,7 @@ class admin_plugin_plugin extends DokuWiki_Admin_Plugin { function admin_plugin_plugin() { global $conf; - $this->disabled = (!isset($conf['pluginmanager']) || ($conf['pluginmanager'] == 0)); + $this->disabled = (isset($conf['pluginmanager']) && ($conf['pluginmanager'] == 0)); } /** -- GitLab