From 64045426f4eb5150c46dd2534058c3522bbe6ecf Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 9 Jun 2011 20:19:08 +0000 Subject: Fixes #2871 activate all/deactivate all now sensitive to filtering git-svn-id: http://code.elgg.org/elgg/trunk@9158 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/admin/plugins/activate_all.php | 20 ++++++++++++-------- actions/admin/plugins/deactivate_all.php | 20 ++++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) (limited to 'actions/admin/plugins') diff --git a/actions/admin/plugins/activate_all.php b/actions/admin/plugins/activate_all.php index 0f0352877..19eb82142 100644 --- a/actions/admin/plugins/activate_all.php +++ b/actions/admin/plugins/activate_all.php @@ -1,21 +1,25 @@ activate()) { - //system_message(elgg_echo('admin:plugins:activate:yes', array($plugin->getManifest()->getName()))); - } else { - register_error(elgg_echo('admin:plugins:activate:no', array($plugin->getManifest()->getName()))); +foreach ($guids as $guid) { + $plugin = get_entity($guid); + if (!$plugin->isActive()) { + if ($plugin->activate()) { + //system_message(elgg_echo('admin:plugins:activate:yes', array($plugin->getManifest()->getName()))); + } else { + register_error(elgg_echo('admin:plugins:activate:no', array($plugin->getManifest()->getName()))); + } } } diff --git a/actions/admin/plugins/deactivate_all.php b/actions/admin/plugins/deactivate_all.php index 446cad8c0..436a3ad30 100644 --- a/actions/admin/plugins/deactivate_all.php +++ b/actions/admin/plugins/deactivate_all.php @@ -1,21 +1,25 @@ deactivate()) { - //system_message(elgg_echo('admin:plugins:deactivate:yes', array($plugin->getManifest()->getName()))); - } else { - register_error(elgg_echo('admin:plugins:deactivate:no', array($plugin->getManifest()->getName()))); +foreach ($guids as $guid) { + $plugin = get_entity($guid); + if ($plugin->isActive()) { + if ($plugin->deactivate()) { + //system_message(elgg_echo('admin:plugins:activate:yes', array($plugin->getManifest()->getName()))); + } else { + register_error(elgg_echo('admin:plugins:deactivate:no', array($plugin->getManifest()->getName()))); + } } } -- cgit v1.2.3