summaryrefslogtreecommitdiff
path: root/lib/plugins/extension/helper/list.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2013-08-11 11:19:34 +0200
committerAndreas Gohr <andi@splitbrain.org>2013-08-11 11:19:34 +0200
commite445eeb3b675b350b4cebeeea610d4f7cd2e8f19 (patch)
tree6cc295f40be60a5f41c8e74e359633b4c036735b /lib/plugins/extension/helper/list.php
parent347e1146ca6a08dc90247a3f7da31cbc3a409aa0 (diff)
downloadrpg-e445eeb3b675b350b4cebeeea610d4f7cd2e8f19.tar.gz
rpg-e445eeb3b675b350b4cebeeea610d4f7cd2e8f19.tar.bz2
fixed button logic
Diffstat (limited to 'lib/plugins/extension/helper/list.php')
-rw-r--r--lib/plugins/extension/helper/list.php26
1 files changed, 20 insertions, 6 deletions
diff --git a/lib/plugins/extension/helper/list.php b/lib/plugins/extension/helper/list.php
index 16ef71569..7ecd5b267 100644
--- a/lib/plugins/extension/helper/list.php
+++ b/lib/plugins/extension/helper/list.php
@@ -444,11 +444,13 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
*/
function make_actions(helper_plugin_extension_extension $extension) {
$return = '';
- if (!$extension->isInstalled() && $extension->canModify() === true) {
- $return .= $this->make_action('install', $extension);
- } elseif ($extension->canModify() === true) {
- if (!$extension->isBundled()) {
- $return .= $this->make_action('uninstall', $extension);
+ $errors = '';
+
+ if ($extension->isInstalled()) {
+ if (($canmod = $extension->canModify()) === true) {
+ if (!$extension->isProtected()) {
+ $return .= $this->make_action('uninstall', $extension);
+ }
if ($extension->getDownloadURL()) {
if ($extension->updateAvailable()) {
$return .= $this->make_action('update', $extension);
@@ -456,7 +458,10 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
$return .= $this->make_action('reinstall', $extension);
}
}
+ }else{
+ $errors .= '<p class="permerror">'.$this->getLang($canmod).'</p>';
}
+
if (!$extension->isProtected()) {
if ($extension->isEnabled()) {
if(!$extension->isTemplate()){ // templates can't be disabled, only another can be enabled
@@ -466,6 +471,15 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
$return .= $this->make_action('enable', $extension);
}
}
+
+ }else{
+ if (($canmod = $extension->canModify()) === true) {
+ if ($extension->getDownloadURL()) {
+ $return .= $this->make_action('install', $extension);
+ }
+ }else{
+ $errors .= '<div class="permerror">'.$this->getLang($canmod).'</div>';
+ }
}
if (!$extension->isInstalled()) {
@@ -473,7 +487,7 @@ class helper_plugin_extension_list extends DokuWiki_Plugin {
$return .= ($extension->getLastUpdate() ? hsc($extension->getLastUpdate()) : $this->getLang('unknown')).'</span>';
}
- return $return;
+ return $return.' '.$errors;
}
/**