From 3e217a362fe66ee0dba6351d0c748290cdbb992e Mon Sep 17 00:00:00 2001 From: Satoshi Sahara Date: Wed, 6 Aug 2014 21:41:02 +0900 Subject: Last Update Date info of extension fix This request makes "Your last update" of the extension info shown when clicking more info triangle mark. The first installed date of the extension may not be necessary for local site admin work. --- lib/plugins/extension/helper/list.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'lib/plugins/extension/helper') diff --git a/lib/plugins/extension/helper/list.php b/lib/plugins/extension/helper/list.php index 47edca8c1..9b1988d84 100644 --- a/lib/plugins/extension/helper/list.php +++ b/lib/plugins/extension/helper/list.php @@ -387,7 +387,8 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { $return .= '
'; $return .= hsc($extension->getInstalledVersion()); $return .= '
'; - } else { + } + if (!$extension->isBundled()) { $return .= '
'.$this->getLang('install_date').'
'; $return .= '
'; $return .= ($extension->getUpdateDate() ? hsc($extension->getUpdateDate()) : $this->getLang('unknown')); @@ -401,13 +402,6 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { $return .= '
'; } - if($extension->getInstallDate()) { - $return .= '
'.$this->getLang('installed').'
'; - $return .= '
'; - $return .= hsc($extension->getInstallDate()); - $return .= '
'; - } - $return .= '
'.$this->getLang('provides').'
'; $return .= '
'; $return .= ($extension->getTypes() ? hsc(implode(', ', $extension->getTypes())) : $default); -- cgit v1.2.3 From 253d4b48ec708eb42033862dc15c8576f44a48ed Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 1 Oct 2014 15:32:05 +0200 Subject: more PHPDocs, unused var, small bit code reformatting --- lib/plugins/extension/helper/extension.php | 8 ++++++-- lib/plugins/extension/helper/list.php | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/plugins/extension/helper') diff --git a/lib/plugins/extension/helper/extension.php b/lib/plugins/extension/helper/extension.php index 2aca0e218..dfa624907 100644 --- a/lib/plugins/extension/helper/extension.php +++ b/lib/plugins/extension/helper/extension.php @@ -799,7 +799,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * * The directory is registered for cleanup when the class is destroyed * - * @return bool|string + * @return false|string */ protected function mkTmpDir(){ $dir = io_mktmpdir(); @@ -1079,7 +1079,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { * * @author Andreas Gohr * @param string $file The file to analyze - * @return string|bool false if the file can't be read, otherwise an "extension" + * @return string|false false if the file can't be read, otherwise an "extension" */ private function guess_archive($file) { $fh = fopen($file, 'rb'); @@ -1095,6 +1095,10 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { /** * Copy with recursive sub-directory support + * + * @param string $src filename path to file + * @param string $dst filename path to file + * @return bool|int|string */ private function dircopy($src, $dst) { global $conf; diff --git a/lib/plugins/extension/helper/list.php b/lib/plugins/extension/helper/list.php index 9b1988d84..6fc8c63b1 100644 --- a/lib/plugins/extension/helper/list.php +++ b/lib/plugins/extension/helper/list.php @@ -333,7 +333,6 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { * Shortens the URL for display * * @param string $url - * * @return string HTML link */ function shortlink($url){ -- cgit v1.2.3 From 7e8500eea1e53b1de0e0f70400664afa442cd08d Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Thu, 2 Oct 2014 14:55:24 +0200 Subject: PHPDocs and some improvements --- lib/plugins/extension/helper/repository.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/plugins/extension/helper') diff --git a/lib/plugins/extension/helper/repository.php b/lib/plugins/extension/helper/repository.php index 6ffe89eb7..5dc2707cf 100644 --- a/lib/plugins/extension/helper/repository.php +++ b/lib/plugins/extension/helper/repository.php @@ -32,7 +32,7 @@ class helper_plugin_extension_repository extends DokuWiki_Plugin { $request_needed = false; foreach ($list as $name) { $cache = new cache('##extension_manager##'.$name, '.repo'); - $result = null; + if (!isset($this->loaded_extensions[$name]) && $this->hasAccess() && !$cache->useCache(array('age' => 3600 * 24))) { $this->loaded_extensions[$name] = true; $request_data['ext'][] = $name; @@ -64,7 +64,7 @@ class helper_plugin_extension_repository extends DokuWiki_Plugin { public function hasAccess() { if ($this->has_access === null) { $cache = new cache('##extension_manager###hasAccess', '.repo'); - $result = null; + if (!$cache->useCache(array('age' => 3600 * 24, 'purge'=>1))) { $httpclient = new DokuHTTPClient(); $httpclient->timeout = 5; @@ -91,7 +91,7 @@ class helper_plugin_extension_repository extends DokuWiki_Plugin { */ public function getData($name) { $cache = new cache('##extension_manager##'.$name, '.repo'); - $result = null; + if (!isset($this->loaded_extensions[$name]) && $this->hasAccess() && !$cache->useCache(array('age' => 3600 * 24))) { $this->loaded_extensions[$name] = true; $httpclient = new DokuHTTPClient(); -- cgit v1.2.3 From 48b5d5e92851161ee3b3ebc7bf5b6ae6d1f0914d Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 3 Dec 2014 16:50:16 +0100 Subject: warn about enabled, but not used auth plugins --- lib/plugins/extension/helper/list.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/plugins/extension/helper') diff --git a/lib/plugins/extension/helper/list.php b/lib/plugins/extension/helper/list.php index 9b1988d84..f7e6eb2ca 100644 --- a/lib/plugins/extension/helper/list.php +++ b/lib/plugins/extension/helper/list.php @@ -461,6 +461,7 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { * @return string The HTML code */ function make_actions(helper_plugin_extension_extension $extension) { + global $conf; $return = ''; $errors = ''; @@ -492,6 +493,10 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { $errors .= '

'.$this->getLang('git').'

'; } + if ($extension->isEnabled() && in_array('Auth', $extension->getTypes()) && $conf['auth'] != $extension->getID()) { + $errors .= '

'.$this->getLang('auth').'

'; + } + }else{ if (($canmod = $extension->canModify()) === true) { if ($extension->getDownloadURL()) { -- cgit v1.2.3