From be9d65f372c24d275f29fa1c4564fbf002bae2ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Gaulin?= Date: Sun, 22 May 2016 21:05:19 +0200 Subject: [PATCH] Fix plugin management page - Ref #907 (#2034) * Disable activate/deactive and delete buttons after a successful AJAX delete request. * Allow to load disabled plugin language files for display. --- modules/system/classes/PluginManager.php | 22 +++++++++++-------- .../updates/_list_manage_toolbar.htm | 1 + 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/modules/system/classes/PluginManager.php b/modules/system/classes/PluginManager.php index 73fb84074..ac7367404 100644 --- a/modules/system/classes/PluginManager.php +++ b/modules/system/classes/PluginManager.php @@ -166,13 +166,25 @@ class PluginManager $pluginId = $this->getIdentifier($plugin); } - if (!$plugin || $plugin->disabled) { + if (!$plugin) { return; } $pluginPath = $this->getPluginPath($plugin); $pluginNamespace = strtolower($pluginId); + /* + * Register language namespaces + */ + $langPath = $pluginPath . '/lang'; + if (File::isDirectory($langPath)) { + Lang::addNamespace($pluginNamespace, $langPath); + } + + if ($plugin->disabled) { + return; + } + /* * Register plugin class autoloaders */ @@ -185,14 +197,6 @@ class PluginManager $plugin->register(); } - /* - * Register language namespaces - */ - $langPath = $pluginPath . '/lang'; - if (File::isDirectory($langPath)) { - Lang::addNamespace($pluginNamespace, $langPath); - } - /* * Register configuration path */ diff --git a/modules/system/controllers/updates/_list_manage_toolbar.htm b/modules/system/controllers/updates/_list_manage_toolbar.htm index 29a981773..8b0788a64 100644 --- a/modules/system/controllers/updates/_list_manage_toolbar.htm +++ b/modules/system/controllers/updates/_list_manage_toolbar.htm @@ -44,6 +44,7 @@ data-trigger-action="enable" data-trigger=".control-list input[type=checkbox]" data-trigger-condition="checked" + data-request-success="$(this).closest('.btn-group').find('button').prop('disabled', true)" data-stripe-load-indicator>