From 014ff8894b7a2aa49b4f0842c212683ea0c15293 Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 26 Feb 2009 17:03:18 +0000 Subject: enable/disable plugin actions now support arrays as parameters git-svn-id: https://code.elgg.org/elgg/trunk@2966 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/admin/plugins/disable.php | 17 +++++++++++------ actions/admin/plugins/enable.php | 17 +++++++++++------ 2 files changed, 22 insertions(+), 12 deletions(-) (limited to 'actions/admin/plugins') diff --git a/actions/admin/plugins/disable.php b/actions/admin/plugins/disable.php index 8724759a6..cbe75a665 100644 --- a/actions/admin/plugins/disable.php +++ b/actions/admin/plugins/disable.php @@ -18,14 +18,19 @@ // Validate the action action_gatekeeper(); - // Get the user + // Get the plugin $plugin = get_input('plugin'); + if (!is_array($plugin)) + $plugin = array($plugin); - // Disable - if (disable_plugin($plugin)) - system_message(sprintf(elgg_echo('admin:plugins:disable:yes'), $plugin)); - else - register_error(sprintf(elgg_echo('admin:plugins:disable:no'), $plugin)); + foreach ($plugin as $p) + { + // Disable + if (disable_plugin($p)) + system_message(sprintf(elgg_echo('admin:plugins:disable:yes'), $p)); + else + register_error(sprintf(elgg_echo('admin:plugins:disable:no'), $p)); + } elgg_view_regenerate_simplecache(); diff --git a/actions/admin/plugins/enable.php b/actions/admin/plugins/enable.php index 0a9086b91..072924eec 100644 --- a/actions/admin/plugins/enable.php +++ b/actions/admin/plugins/enable.php @@ -18,14 +18,19 @@ // Validate the action action_gatekeeper(); - // Get the user + // Get the plugin $plugin = get_input('plugin'); + if (!is_array($plugin)) + $plugin = array($plugin); - // Disable - if (enable_plugin($plugin)) - system_message(sprintf(elgg_echo('admin:plugins:enable:yes'), $plugin)); - else - register_error(sprintf(elgg_echo('admin:plugins:enable:no'), $plugin)); + foreach ($plugin as $p) + { + // Disable + if (enable_plugin($p)) + system_message(sprintf(elgg_echo('admin:plugins:enable:yes'), $p)); + else + register_error(sprintf(elgg_echo('admin:plugins:enable:no'), $p)); + } elgg_view_regenerate_simplecache(); -- cgit v1.2.3