diff options
Diffstat (limited to 'lib/plugins/extension')
-rw-r--r-- | lib/plugins/extension/helper/extension.php | 27 | ||||
-rw-r--r-- | lib/plugins/extension/helper/gui.php | 4 | ||||
-rw-r--r-- | lib/plugins/extension/helper/list.php | 1 | ||||
-rw-r--r-- | lib/plugins/extension/lang/en/lang.php | 7 | ||||
-rw-r--r-- | lib/plugins/extension/script.js | 21 | ||||
-rw-r--r-- | lib/plugins/extension/style.less | 16 |
6 files changed, 54 insertions, 22 deletions
diff --git a/lib/plugins/extension/helper/extension.php b/lib/plugins/extension/helper/extension.php index 6c0946b09..d089245b5 100644 --- a/lib/plugins/extension/helper/extension.php +++ b/lib/plugins/extension/helper/extension.php @@ -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'; diff --git a/lib/plugins/extension/lang/en/lang.php b/lib/plugins/extension/lang/en/lang.php index f545b6da3..79f643629 100644 --- a/lib/plugins/extension/lang/en/lang.php +++ b/lib/plugins/extension/lang/en/lang.php @@ -101,4 +101,9 @@ $lang['install_url'] = 'Install from URL:'; $lang['install_upload'] = 'Upload Extension:'; $lang['repo_error'] = 'The plugin repository could not be contacted. Make sure your server is allowed to contact www.dokuwiki.org and check your proxy settings.'; -$lang['nossl'] = 'Your PHP seems to miss SSL support. Downloading will not work for many DokuWiki extensions.';
\ No newline at end of file +$lang['nossl'] = 'Your PHP seems to miss SSL support. Downloading will not work for many DokuWiki extensions.'; + +$lang['js']['display_viewoptions'] = 'View Options:'; +$lang['js']['display_enabled'] = 'enabled'; +$lang['js']['display_disabled'] = 'disabled'; +$lang['js']['display_updatable'] = 'updatable'; diff --git a/lib/plugins/extension/script.js b/lib/plugins/extension/script.js index fab88162d..bc1bf8b12 100644 --- a/lib/plugins/extension/script.js +++ b/lib/plugins/extension/script.js @@ -110,4 +110,23 @@ jQuery(function(){ ); }); -});
\ No newline at end of file + /** + Create section for enabling/disabling viewing options + */ + if ( $extmgr.find('.plugins, .templates').hasClass('active') ) { + var $displayOpts = jQuery('<p>', { id: 'extension__viewoptions'} ).appendTo($extmgr.find( '.panelHeader' )); + + $displayOpts.append(LANG.plugins.extension.display_viewoptions); + + var displayOptionsHandler = function(){ + jQuery('#extension__list').toggleClass( this.name ); + }; + + jQuery(['enabled', 'disabled', 'updatable']).each(function(index, chkName){ + + var $label = jQuery( '<label></label>' ).appendTo($displayOpts); + jQuery( '<input />', { type: 'checkbox', name: chkName }).change(displayOptionsHandler).appendTo($label).click(); + jQuery( '<span/>' ).append(LANG.plugins.extension['display_'+chkName]).appendTo($label); + }); + } +}); diff --git a/lib/plugins/extension/style.less b/lib/plugins/extension/style.less index d20689099..38b2d65d0 100644 --- a/lib/plugins/extension/style.less +++ b/lib/plugins/extension/style.less @@ -281,6 +281,18 @@ * Enabled/Disabled overrides */ #extension__list { + + .enabled, .disabled, + .updatable { + display: none; + } + + &.enabled .enabled, + &.disabled .disabled, + &.updatable .updatable { + display: block; + } + .enabled div.screenshot span { background: transparent url(images/enabled.png) no-repeat 2px 2px; } @@ -361,3 +373,7 @@ display: block; width: 60%; } + +#extension__viewoptions label { + margin-left: 1em; +} |