aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-09 20:19:08 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-09 20:19:08 +0000
commit64045426f4eb5150c46dd2534058c3522bbe6ecf (patch)
treec9ebdf02326824eb0b940c2ebbe0bc333668ffad /actions
parent4886371c1709f5b098226e362986796b960f4e54 (diff)
downloadelgg-64045426f4eb5150c46dd2534058c3522bbe6ecf.tar.gz
elgg-64045426f4eb5150c46dd2534058c3522bbe6ecf.tar.bz2
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
Diffstat (limited to 'actions')
-rw-r--r--actions/admin/plugins/activate_all.php20
-rw-r--r--actions/admin/plugins/deactivate_all.php20
2 files changed, 24 insertions, 16 deletions
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 @@
<?php
/**
- * Activates all installed and inactive plugins.
+ * Activates all specified installed and inactive plugins.
*
- * All plugins in the mod/ directory are that aren't active are activated and the views
+ * All specified plugins in the mod/ directory are that aren't active are activated and the views
* cache and simplecache are invalidated.
*
* @package Elgg.Core
* @subpackage Administration.Plugins
*/
-$plugins = elgg_get_plugins('inactive');
+$guids = get_input('guids');
+$guids = explode(',', $guids);
-foreach ($plugins as $plugin) {
- 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())));
+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 @@
<?php
/**
- * Disable all installed plugins.
+ * Disable all specified installed plugins.
*
- * All plugins in the mod/ directory are disabled and the views cache and simplecache
+ * Specified plugins in the mod/ directory are disabled and the views cache and simplecache
* are reset.
*
* @package Elgg.Core
* @subpackage Administration.Plugins
*/
-$plugins = elgg_get_plugins('active');
+$guids = get_input('guids');
+$guids = explode(',', $guids);
-foreach ($plugins as $plugin) {
- if ($plugin->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())));
+ }
}
}