diff options
author | Christopher Smith <chris@jalakai.co.uk> | 2015-05-28 17:11:42 +0100 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2015-05-28 17:11:42 +0100 |
commit | 4b8290f563ad5ac84dd92fb8ca97ba5970c472b3 (patch) | |
tree | 7dca7c98013775628c2b4d1596e0be41d8d4bda2 /lib/plugins/extension/helper | |
parent | 9a734b7aaba1445e06c1ccb95e59f54e01688d45 (diff) | |
parent | 4286c64e98499b93056c09498c10709f8909befd (diff) | |
download | rpg-4b8290f563ad5ac84dd92fb8ca97ba5970c472b3.tar.gz rpg-4b8290f563ad5ac84dd92fb8ca97ba5970c472b3.tar.bz2 |
Merge branch 'master' into ioreplaceinfile
Diffstat (limited to 'lib/plugins/extension/helper')
-rw-r--r-- | lib/plugins/extension/helper/extension.php | 29 | ||||
-rw-r--r-- | lib/plugins/extension/helper/gui.php | 4 | ||||
-rw-r--r-- | lib/plugins/extension/helper/list.php | 1 |
3 files changed, 13 insertions, 21 deletions
diff --git a/lib/plugins/extension/helper/extension.php b/lib/plugins/extension/helper/extension.php index 6c0946b09..719249fbe 100644 --- a/lib/plugins/extension/helper/extension.php +++ b/lib/plugins/extension/helper/extension.php @@ -105,7 +105,7 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { */ public function isBundled() { if (!empty($this->remoteInfo['bundled'])) return $this->remoteInfo['bundled']; - return in_array($this->base, + return in_array($this->id, array( 'authad', 'authldap', 'authmysql', 'authpgsql', 'authplain', 'acl', 'info', 'extension', 'revert', 'popularity', 'config', 'safefnrecode', 'testing', 'template:dokuwiki' @@ -1035,33 +1035,24 @@ class helper_plugin_extension_extension extends DokuWiki_Plugin { $ext = $this->guess_archive($file); if(in_array($ext, array('tar', 'bz', 'gz'))) { - switch($ext) { - case 'bz': - $compress_type = Tar::COMPRESS_BZIP; - break; - case 'gz': - $compress_type = Tar::COMPRESS_GZIP; - break; - default: - $compress_type = Tar::COMPRESS_NONE; - } - $tar = new Tar(); try { - $tar->open($file, $compress_type); + $tar = new \splitbrain\PHPArchive\Tar(); + $tar->open($file); $tar->extract($target); - } catch (Exception $e) { + } catch (\splitbrain\PHPArchive\ArchiveIOException $e) { throw new Exception($this->getLang('error_decompress').' '.$e->getMessage()); } return true; } elseif($ext == 'zip') { - $zip = new ZipLib(); - $ok = $zip->Extract($file, $target); - - if($ok == -1){ - throw new Exception($this->getLang('error_decompress').' Error extracting the zip archive'); + try { + $zip = new \splitbrain\PHPArchive\Zip(); + $zip->open($file); + $zip->extract($target); + } catch (\splitbrain\PHPArchive\ArchiveIOException $e) { + throw new Exception($this->getLang('error_decompress').' '.$e->getMessage()); } return true; diff --git a/lib/plugins/extension/helper/gui.php b/lib/plugins/extension/helper/gui.php index 3a0f0c589..4ec6fec85 100644 --- a/lib/plugins/extension/helper/gui.php +++ b/lib/plugins/extension/helper/gui.php @@ -144,11 +144,11 @@ class helper_plugin_extension_gui extends DokuWiki_Plugin { foreach($this->tabs as $tab) { $url = $this->tabURL($tab); if($this->currentTab() == $tab) { - $class = 'class="active"'; + $class = ' active'; } else { $class = ''; } - echo '<li '.$class.'><a href="'.$url.'">'.$this->getLang('tab_'.$tab).'</a></li>'; + echo '<li class="'.$tab.$class.'"><a href="'.$url.'">'.$this->getLang('tab_'.$tab).'</a></li>'; } echo '</ul>'; } diff --git a/lib/plugins/extension/helper/list.php b/lib/plugins/extension/helper/list.php index 8bcd00ec6..11aea1d0e 100644 --- a/lib/plugins/extension/helper/list.php +++ b/lib/plugins/extension/helper/list.php @@ -151,6 +151,7 @@ class helper_plugin_extension_list extends DokuWiki_Plugin { if($extension->isInstalled()) { $class.=' installed'; $class.= ($extension->isEnabled()) ? ' enabled':' disabled'; + if($extension->updateAvailable()) $class .= ' updatable'; } if(!$extension->canModify()) $class.= ' notselect'; if($extension->isProtected()) $class.= ' protected'; |