From 2c2b3c89f8b69b42220c19a811feb6a7b85e989f Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Wed, 1 Feb 2012 21:49:39 +0100 Subject: Plugin deletion can now be enforced. This will skip the RatatoeskrPlugin::delete() part and will not load the plugin before deletion, so you can delete a plugin if it contained syntax errors without disabling plugins in config.php --- ratatoeskr/backend.php | 13 ++++++++----- ratatoeskr/templates/src/systemtemplates/pluginlist.html | 1 + ratatoeskr/translations/de.php | 3 ++- ratatoeskr/translations/en.php | 1 + 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ratatoeskr/backend.php b/ratatoeskr/backend.php index 0f010d1..406219e 100644 --- a/ratatoeskr/backend.php +++ b/ratatoeskr/backend.php @@ -1649,19 +1649,22 @@ $backend_subactions = url_action_subactions(array( $ste->vars["pagetitle"] = $translation["menu_pluginlist"]; /* Delete plugins? */ - if(isset($_POST["delete"]) and ($_POST["really_delete"] == "yes") and (!empty($_POST["plugins_multiselect"]))) + if(isset($_POST["delete"]) and (($_POST["really_delete"] == "yes") or ($_POST["really_delete"] == "force")) and (!empty($_POST["plugins_multiselect"]))) { foreach($_POST["plugins_multiselect"] as $pid) { try { $plugin = Plugin::by_id($pid); - if(!isset($plugin_objs[$pid])) + if($_POST["really_delete"] != "force") { - eval($plugin->code); - $plugin_objs[$pid] = new $plugin->classname($pid); + if(!isset($plugin_objs[$pid])) + { + eval($plugin->code); + $plugin_objs[$pid] = new $plugin->classname($pid); + } + $plugin_objs[$pid]->uninstall(); } - $plugin_objs[$pid]->uninstall(); $plugin->delete(); } catch(DoesNotExistError $e) diff --git a/ratatoeskr/templates/src/systemtemplates/pluginlist.html b/ratatoeskr/templates/src/systemtemplates/pluginlist.html index 9c64ed1..e51c769 100644 --- a/ratatoeskr/templates/src/systemtemplates/pluginlist.html +++ b/ratatoeskr/templates/src/systemtemplates/pluginlist.html @@ -46,6 +46,7 @@ | diff --git a/ratatoeskr/translations/de.php b/ratatoeskr/translations/de.php index 5eba112..e75ec05 100644 --- a/ratatoeskr/translations/de.php +++ b/ratatoeskr/translations/de.php @@ -216,7 +216,7 @@ $translation = array( "install_from_package" => "Aus Paket installieren", "invalid_package" => "Ungültiges Paket", "incompatible_plugin" => "Dieses Plugin ist nicht mit dieser Version von Ratatöskr kompatibel. Es benötigt die API Version [[API]] oder eine kompatible.", - "plugin_safety_warning" => "Installiere niemals ein Plugin, dem du nicht vertraust! Plugins sind sehr mächtig und könnten potentiell diene Ratatöskr Installation zerstören!", + "plugin_safety_warning" => "Installiere niemals ein Plugin, dem du nicht vertraust! Plugins sind sehr mächtig und könnten potentiell deine Ratatöskr Installation zerstören!", "plugin_src" => "Sourcecode", "license" => "Lizenz", "plugin_installed_successfully" => "Plugin erfolgreich installiert.", @@ -258,6 +258,7 @@ $translation = array( "setup_link_yourpage" => "Deine neuen Webpage", "setup_link_backend" => "Das Backend deiner Webpage", "admin_data_must_be_filled_out" => "Administrator Daten müssen ausgefüllt sein", + "enforce" => "Erzwingen", /* Very long texts here */ "linking_back_hint" => <<Verlinken auf die Seitenwurzel diff --git a/ratatoeskr/translations/en.php b/ratatoeskr/translations/en.php index ca015d3..05348ee 100644 --- a/ratatoeskr/translations/en.php +++ b/ratatoeskr/translations/en.php @@ -258,6 +258,7 @@ $translation = array( "setup_link_yourpage" => "Your new Webpage", "setup_link_backend" => "The backend of your Webpage", "admin_data_must_be_filled_out" => "Administrator data must be filled out", + "enforce" => "Enforce", /* Very long texts here */ "linking_back_hint" => <<Linking back -- cgit v1.2.3-70-g09d2