From 06d8000aa9e10b65a946d58d1cffe41aff987d2b Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sun, 5 Jan 2014 23:11:23 +0000 Subject: added status to info list of extension plugin --- lib/plugins/extension/helper/list.php | 39 ++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) (limited to 'lib/plugins/extension/helper/list.php') diff --git a/lib/plugins/extension/helper/list.php b/lib/plugins/extension/helper/list.php index 7a08655b7..ba3681ce4 100644 --- a/lib/plugins/extension/helper/list.php +++ b/lib/plugins/extension/helper/list.php @@ -252,14 +252,13 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { if ($extension->getBugtrackerURL()) { $return .= ' '.$this->getLang('bugs_features').' '; } - if($extension->getTags()){ + if ($extension->getTags()){ $first = true; - $return .= ''; - $return .= ''.$this->getLang('tags').' '; + $return .= ''.$this->getLang('tags').' '; foreach ($extension->getTags() as $tag) { - if(!$first){ + if (!$first){ $return .= ', '; - }else{ + } else { $first = false; } $url = $this->gui->tabURL('search', array('q' => 'tag:'.$tag)); @@ -345,6 +344,9 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { $default = $this->getLang('unknown'); $return = '
'; + $return .= '
'.$this->getLang('status').'
'; + $return .= '
'.$this->make_status($extension).'
'; + if ($extension->getDonationURL()) { $return .= '
'.$this->getLang('donate').'
'; $return .= '
'; @@ -352,7 +354,6 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { $return .= '
'; } - if (!$extension->isBundled()) { $return .= '
'.$this->getLang('downloadurl').'
'; $return .= '
'; @@ -513,7 +514,7 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { switch ($action) { case 'install': case 'reinstall': - $title = 'title="'.$extension->getDownloadURL().'"'; + $title = 'title="'.hsc($extension->getDownloadURL()).'"'; break; } @@ -522,4 +523,28 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { return ''; } + + /** + * Plugin/template status + * + * @param helper_plugin_extension_extension $extension The extension + * @return string The description of all relevant statusses + */ + function make_status(helper_plugin_extension_extension $extension) { + $return = ''; + if ($extension->isInstalled()) { + $return .= $this->getLang('status_installed').' '; + if ($extension->isProtected()) { + $return .= $this->getLang('status_protected').' '; + } else { + $return .= $extension->isEnabled() ? $this->getLang('status_enabled').' ' : $this->getLang('status_disabled').' '; + } + } else { + $return .= $this->getLang('status_not_installed').' '; + } + $return .= !$extension->canModify() ? $this->getLang('status_unmodifiable').' ' : ''; + $return .= $extension->isTemplate() ? $this->getLang('status_template') : $this->getLang('status_plugin'); + return $return; + } + } -- cgit v1.2.3