diff options
Diffstat (limited to 'lib/plugins')
-rw-r--r-- | lib/plugins/authmysql/lang/de/lang.php | 8 | ||||
-rw-r--r-- | lib/plugins/config/settings/config.class.php | 4 | ||||
-rw-r--r-- | lib/plugins/config/settings/extra.class.php | 2 | ||||
-rw-r--r-- | lib/plugins/extension/_test/extension.test.php | 2 | ||||
-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 | ||||
-rw-r--r-- | lib/plugins/extension/lang/de/lang.php | 4 | ||||
-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 | ||||
-rw-r--r-- | lib/plugins/popularity/action.php | 2 | ||||
-rw-r--r-- | lib/plugins/popularity/admin.php | 2 | ||||
-rw-r--r-- | lib/plugins/popularity/helper.php | 2 | ||||
-rw-r--r-- | lib/plugins/revert/admin.php | 2 | ||||
-rw-r--r-- | lib/plugins/usermanager/admin.php | 2 |
16 files changed, 77 insertions, 31 deletions
diff --git a/lib/plugins/authmysql/lang/de/lang.php b/lib/plugins/authmysql/lang/de/lang.php new file mode 100644 index 000000000..6160f60ea --- /dev/null +++ b/lib/plugins/authmysql/lang/de/lang.php @@ -0,0 +1,8 @@ +<?php + +/** + * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) + * + * @author Noel Tilliot <noeltilliot@byom.de> + */ +$lang['usernotexists'] = 'Sorry, dieser Nutzer existiert nicht.'; diff --git a/lib/plugins/config/settings/config.class.php b/lib/plugins/config/settings/config.class.php index 316cc2c59..f2d43bff6 100644 --- a/lib/plugins/config/settings/config.class.php +++ b/lib/plugins/config/settings/config.class.php @@ -37,7 +37,7 @@ if (!class_exists('configuration')) { * * @param string $datafile path to config metadata file */ - public function configuration($datafile) { + public function __construct($datafile) { global $conf, $config_cascade; if (!file_exists($datafile)) { @@ -434,7 +434,7 @@ if (!class_exists('setting')) { * @param string $key * @param array|null $params array with metadata of setting */ - public function setting($key, $params=null) { + public function __construct($key, $params=null) { $this->_key = $key; if (is_array($params)) { diff --git a/lib/plugins/config/settings/extra.class.php b/lib/plugins/config/settings/extra.class.php index fd3a90e28..c6a3f9dae 100644 --- a/lib/plugins/config/settings/extra.class.php +++ b/lib/plugins/config/settings/extra.class.php @@ -20,7 +20,7 @@ if (!class_exists('setting_sepchar')) { for ($i=0;$i<strlen($str);$i++) $this->_choices[] = $str{$i}; // call foundation class constructor - $this->setting($key,$param); + parent::__construct($key,$param); } } } diff --git a/lib/plugins/extension/_test/extension.test.php b/lib/plugins/extension/_test/extension.test.php index 453b95e79..d4f13201d 100644 --- a/lib/plugins/extension/_test/extension.test.php +++ b/lib/plugins/extension/_test/extension.test.php @@ -14,7 +14,9 @@ class mock_helper_plugin_extension_extension extends helper_plugin_extension_ext /** * @group plugin_extension + * @group admin_plugins * @group plugins + * @group bundled_plugins */ class helper_plugin_extension_extension_test extends DokuWikiTest { 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'; diff --git a/lib/plugins/extension/lang/de/lang.php b/lib/plugins/extension/lang/de/lang.php index ce5495e24..ef3197513 100644 --- a/lib/plugins/extension/lang/de/lang.php +++ b/lib/plugins/extension/lang/de/lang.php @@ -8,6 +8,7 @@ * @author Simon <st103267@stud.uni-stuttgart.de> * @author Hoisl <hoisl@gmx.at> * @author Dominik Mahr <drache.mahr@gmx.de> + * @author Noel Tilliot <noeltilliot@byom.de> */ $lang['menu'] = 'Erweiterungen verwalten'; $lang['tab_plugins'] = 'Installierte Plugins'; @@ -29,6 +30,9 @@ $lang['btn_disable'] = 'Deaktivieren'; $lang['btn_install'] = 'Installieren'; $lang['btn_reinstall'] = 'Neu installieren'; $lang['js']['reallydel'] = 'Wollen Sie diese Erweiterung wirklich löschen?'; +$lang['js']['display_viewoptions'] = 'Optionen anzeigen'; +$lang['js']['display_enabled'] = 'aktiviert'; +$lang['js']['display_disabled'] = 'deaktiviert'; $lang['search_for'] = 'Erweiterung suchen:'; $lang['search'] = 'Suchen'; $lang['extensionby'] = '<strong>%s</strong> von %s'; 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; +} diff --git a/lib/plugins/popularity/action.php b/lib/plugins/popularity/action.php index 9e2e78d11..d5ec0f5c5 100644 --- a/lib/plugins/popularity/action.php +++ b/lib/plugins/popularity/action.php @@ -15,7 +15,7 @@ class action_plugin_popularity extends Dokuwiki_Action_Plugin { */ var $helper; - function action_plugin_popularity(){ + function __construct(){ $this->helper = $this->loadHelper('popularity', false); } diff --git a/lib/plugins/popularity/admin.php b/lib/plugins/popularity/admin.php index ab569b8b4..a2c3c6c8b 100644 --- a/lib/plugins/popularity/admin.php +++ b/lib/plugins/popularity/admin.php @@ -20,7 +20,7 @@ class admin_plugin_popularity extends DokuWiki_Admin_Plugin { var $helper; var $sentStatus = null; - function admin_plugin_popularity(){ + function __construct(){ $this->helper = $this->loadHelper('popularity', false); } diff --git a/lib/plugins/popularity/helper.php b/lib/plugins/popularity/helper.php index 55264010f..27755b0ed 100644 --- a/lib/plugins/popularity/helper.php +++ b/lib/plugins/popularity/helper.php @@ -30,7 +30,7 @@ class helper_plugin_popularity extends Dokuwiki_Plugin { var $popularityLastSubmitFile; - function helper_plugin_popularity(){ + function __construct(){ global $conf; $this->autosubmitFile = $conf['cachedir'].'/autosubmit.txt'; $this->autosubmitErrorFile = $conf['cachedir'].'/autosubmitError.txt'; diff --git a/lib/plugins/revert/admin.php b/lib/plugins/revert/admin.php index 88d8cd93d..b61615d00 100644 --- a/lib/plugins/revert/admin.php +++ b/lib/plugins/revert/admin.php @@ -16,7 +16,7 @@ class admin_plugin_revert extends DokuWiki_Admin_Plugin { /** * Constructor */ - function admin_plugin_revert(){ + function __construct(){ $this->setupLocale(); } diff --git a/lib/plugins/usermanager/admin.php b/lib/plugins/usermanager/admin.php index 9cb9b0c40..0d92e5cc1 100644 --- a/lib/plugins/usermanager/admin.php +++ b/lib/plugins/usermanager/admin.php @@ -36,7 +36,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { /** * Constructor */ - public function admin_plugin_usermanager(){ + public function __construct(){ /** @var DokuWiki_Auth_Plugin $auth */ global $auth; |