Steps towards deleting dependencies when removing a plugin

This commit is contained in:
Flavio Copes
2016-03-05 18:46:41 +01:00
parent 33abe0d4ca
commit 382fd32916
6 changed files with 161 additions and 30 deletions

View File

@@ -249,15 +249,48 @@ class AdminController
}
/**
* Handle logout.
*
* @return bool True if the action was performed.
* Keep alive
*/
protected function taskKeepAlive()
{
exit();
}
/**
* Handle removing a plugin
*
* @return bool
*/
protected function taskRemovePlugin()
{
$data = $this->post;
$slug = isset($data['plugin']) ? $data['plugin'] : '';
error_log("Plugin $slug Removed");
//TODO: remove the plugin, return error if fail
$this->admin->json_response = ['status' => 'success'];
return true;
}
/**
* Handle getting a plugin dependencies
*
* @return bool
*/
protected function taskGetPluginDependencies()
{
$plugin = $this->grav['uri']->param('plugin');
error_log("Get dependencies of plugin $plugin");
$dependencies = $this->admin->dependenciesThatCanBeRemovedWhenRemoving($plugin);
$this->admin->json_response = ['status' => 'success', 'dependencies' => $dependencies];
return true;
}
/**
* Handle the email password recovery procedure.
*