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.
This commit is contained in:
Jérémy Gaulin 2016-05-22 21:05:19 +02:00 committed by Samuel Georges
parent 09fd6ff74b
commit be9d65f372
2 changed files with 14 additions and 9 deletions

View File

@ -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
*/

View File

@ -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>
<?= e(trans('system::lang.plugins.remove')) ?>
</button>