diff options
author | Andreas Gohr <andi@splitbrain.org> | 2009-01-27 19:25:21 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2009-01-27 19:25:21 +0100 |
commit | a64eec16d2d0bb6f36960279324ff4c67887bfbb (patch) | |
tree | aedd4f489b874814bc6284bed4883d9c4accab66 /lib/plugins/plugin | |
parent | 8e790062800da9ede63ca6d3906c6c178beba5aa (diff) | |
download | rpg-a64eec16d2d0bb6f36960279324ff4c67887bfbb.tar.gz rpg-a64eec16d2d0bb6f36960279324ff4c67887bfbb.tar.bz2 |
reverted plugin disabling method back to old behaviour
Ignore-this: b5fadadeee9de8e52c41c056cf62be6d
With this patch plugins are now disabled by placing a disabled file in the
plugin directory again.
Even though renaming plugin directories is the method with the fewest disk
accesses it makes a lot of trouble with code revision control systems and,
more important, Linux package management systems.
Future versions of DokuWiki may use a central config file instead.
This patch also fixes the problem with the plugin manager not checking the
return values of the pugin_(dis|en)able functions correctly.
darcs-hash:20090127182521-7ad00-62018a546d49d57582d93298c8228fd71601a5e8.gz
Diffstat (limited to 'lib/plugins/plugin')
-rw-r--r-- | lib/plugins/plugin/admin.php | 17 | ||||
-rw-r--r-- | lib/plugins/plugin/lang/en/lang.php | 5 |
2 files changed, 17 insertions, 5 deletions
diff --git a/lib/plugins/plugin/admin.php b/lib/plugins/plugin/admin.php index ddd4081a5..c0918c70f 100644 --- a/lib/plugins/plugin/admin.php +++ b/lib/plugins/plugin/admin.php @@ -619,12 +619,20 @@ class ap_manage { switch ($new) { // enable plugin case true : - plugin_enable($plugin); - $count_enabled++; + if(plugin_enable($plugin)){ + msg(sprintf($this->lang['enabled'],$plugin),1); + $count_enabled++; + }else{ + msg(sprintf($this->lang['notenabled'],$plugin),-1); + } break; case false: - plugin_disable($plugin); - $count_disabled++; + if(plugin_disable($plugin)){ + msg(sprintf($this->lang['disabled'],$plugin),1); + $count_disabled++; + }else{ + msg(sprintf($this->lang['notdisabled'],$plugin),-1); + } break; } } @@ -632,7 +640,6 @@ class ap_manage { // refresh plugins, including expiring any dokuwiki cache(s) if ($count_enabled || $count_disabled) { - msg("Plugin state saved, $count_enabled plugins enabled, $count_disabled plugins disabled."); $this->refresh(); } } diff --git a/lib/plugins/plugin/lang/en/lang.php b/lib/plugins/plugin/lang/en/lang.php index 9414a36d5..e575d3d67 100644 --- a/lib/plugins/plugin/lang/en/lang.php +++ b/lib/plugins/plugin/lang/en/lang.php @@ -69,4 +69,9 @@ $lang['error_copy'] = 'There was a file copy error while attempting to ins $lang['error_delete'] = 'There was an error while attempting to delete plugin <em>%s</em>. '. 'The most probably cause is insufficient file or directory access permissions'; +$lang['enabled'] = 'Plugin %s enabled.'; +$lang['notenabled'] = 'Plugin %s could not be enabled, check file permissions.'; +$lang['disabled'] = 'Plugin %s disabled.'; +$lang['notdisabled'] = 'Plugin %s could not be disabled, check file permissions.'; + //Setup VIM: ex: et ts=4 enc=utf-8 : |