diff options
author | Andreas Gohr <andi@splitbrain.org> | 2013-08-11 11:19:34 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2013-08-11 11:19:34 +0200 |
commit | e445eeb3b675b350b4cebeeea610d4f7cd2e8f19 (patch) | |
tree | 6cc295f40be60a5f41c8e74e359633b4c036735b /lib/plugins/extension/helper/extension.php | |
parent | 347e1146ca6a08dc90247a3f7da31cbc3a409aa0 (diff) | |
download | rpg-e445eeb3b675b350b4cebeeea610d4f7cd2e8f19.tar.gz rpg-e445eeb3b675b350b4cebeeea610d4f7cd2e8f19.tar.bz2 |
fixed button logic
Diffstat (limited to 'lib/plugins/extension/helper/extension.php')
-rw-r--r-- | lib/plugins/extension/helper/extension.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/plugins/extension/helper/extension.php b/lib/plugins/extension/helper/extension.php index d912a44c0..6136c3c9a 100644 --- a/lib/plugins/extension/helper/extension.php +++ b/lib/plugins/extension/helper/extension.php @@ -107,7 +107,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * @return bool if the extension is protected */ public function isProtected() { - return in_array($this->base, array('acl', 'config', 'info', 'plugin', 'revert', 'usermanager')); + return in_array($this->id, array('acl', 'config', 'info', 'plugin', 'revert', 'usermanager', 'template:dokuwiki')); } /** @@ -513,20 +513,21 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { /** * If the extension can probably be installed/updated or uninstalled * - * @return bool|string True or one of "nourl", "noparentperms" (template/plugin install path not writable), "noperms" (extension itself not writable) + * @return bool|string True or error string */ public function canModify() { - if ($this->isInstalled()) { - if (!is_writable($this->getInstallDir())) { + if($this->isInstalled()) { + if(!is_writable($this->getInstallDir())) { return 'noperms'; } } - $parent_path = ($this->isTemplate() ? DOKU_TPLLIB : DOKU_PLUGIN); - if (!is_writable($parent_path)) { - return 'noparentperms'; - } - if (!$this->getDownloadURL()) return 'nourl'; + if($this->isTemplate() && !is_writable(DOKU_TPLLIB)) { + return 'notplperms'; + + } elseif(!is_writable(DOKU_PLUGIN)) { + return 'nopluginperms'; + } return true; } |