diff --git a/app/Http/Controllers/PluginController.php b/app/Http/Controllers/PluginController.php index e91065db..60e26004 100644 --- a/app/Http/Controllers/PluginController.php +++ b/app/Http/Controllers/PluginController.php @@ -17,24 +17,24 @@ class PluginController extends Controller public function manage(Request $request, PluginManager $plugins) { - if ($request->has('action') && $request->has('id')) { - $id = $request->get('id'); + if ($request->has('action') && $request->has('name')) { + $name = $request->get('name'); - if ($plugins->getPlugins()->has($id)) { - $plugin = $plugins->getPlugin($id); + if ($plugins->getPlugins()->has($name)) { + $plugin = $plugins->getPlugin($name); // pass the plugin title through the translator $plugin->title = trans($plugin->title); switch ($request->get('action')) { case 'enable': - $plugins->enable($id); + $plugins->enable($name); return json(trans('admin.plugins.operations.enabled', ['plugin' => $plugin->title]), 0); break; case 'disable': - $plugins->disable($id); + $plugins->disable($name); return json(trans('admin.plugins.operations.disabled', ['plugin' => $plugin->title]), 0); break; @@ -43,7 +43,7 @@ class PluginController extends Controller if ($request->isMethod('post')) { event(new Events\PluginWasDeleted($plugin)); - $plugins->uninstall($id); + $plugins->uninstall($name); return json(trans('admin.plugins.operations.deleted'), 0); } diff --git a/resources/assets/src/js/admin.js b/resources/assets/src/js/admin.js index fb58c3c8..c962923e 100644 --- a/resources/assets/src/js/admin.js +++ b/resources/assets/src/js/admin.js @@ -2,7 +2,7 @@ * @Author: printempw * @Date: 2016-07-22 14:02:44 * @Last Modified by: printempw - * @Last Modified time: 2017-01-02 15:30:42 + * @Last Modified time: 2017-01-08 16:07:24 */ 'use strict'; @@ -299,7 +299,7 @@ function deletePlayer(pid) { function enablePlugin(name) { $.ajax({ type: "POST", - url: "?action=enable&id=" + name, + url: "?action=enable&name=" + name, dataType: "json", success: function(json) { if (json.errno == 0) { @@ -317,7 +317,7 @@ function enablePlugin(name) { function disablePlugin(name) { $.ajax({ type: "POST", - url: "?action=disable&id=" + name, + url: "?action=disable&name=" + name, dataType: "json", success: function(json) { if (json.errno == 0) { @@ -340,7 +340,7 @@ function deletePlugin(name) { }).then(function() { $.ajax({ type: "POST", - url: "?action=delete&id=" + name, + url: "?action=delete&name=" + name, dataType: "json", success: function(json) { if (json.errno == 0) {