aboutsummaryrefslogtreecommitdiff
path: root/actions/admin/plugins
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-05 19:14:48 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-05 19:14:48 +0000
commitff31226fdeb972aac2f37f0098240cb366a9bb26 (patch)
tree1f0caa75c9a340cf28ce9a81a4cbe3230d13abf3 /actions/admin/plugins
parent81ffac29fabc175eebdbf95578da046f4f00611b (diff)
downloadelgg-ff31226fdeb972aac2f37f0098240cb366a9bb26.tar.gz
elgg-ff31226fdeb972aac2f37f0098240cb366a9bb26.tar.bz2
Merged 18_new_admin branch to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@5977 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'actions/admin/plugins')
-rw-r--r--actions/admin/plugins/disable.php2
-rw-r--r--actions/admin/plugins/disableall.php2
-rw-r--r--actions/admin/plugins/enable.php6
-rw-r--r--actions/admin/plugins/enableall.php4
-rw-r--r--actions/admin/plugins/reorder.php5
-rw-r--r--actions/admin/plugins/simple_update_states.php41
6 files changed, 51 insertions, 9 deletions
diff --git a/actions/admin/plugins/disable.php b/actions/admin/plugins/disable.php
index d5042e2bf..ac80d46e3 100644
--- a/actions/admin/plugins/disable.php
+++ b/actions/admin/plugins/disable.php
@@ -21,6 +21,7 @@ foreach ($plugin as $p) {
// Disable
if (disable_plugin($p)) {
system_message(sprintf(elgg_echo('admin:plugins:disable:yes'), $p));
+ elgg_delete_admin_notice('first_installation_plugin_reminder');
} else {
register_error(sprintf(elgg_echo('admin:plugins:disable:no'), $p));
}
@@ -30,4 +31,3 @@ elgg_view_regenerate_simplecache();
elgg_filepath_cache_reset();
forward($_SERVER['HTTP_REFERER']);
-exit;
diff --git a/actions/admin/plugins/disableall.php b/actions/admin/plugins/disableall.php
index 70a945ee4..80553e9d1 100644
--- a/actions/admin/plugins/disableall.php
+++ b/actions/admin/plugins/disableall.php
@@ -16,6 +16,7 @@ $plugins = get_installed_plugins();
foreach ($plugins as $p => $data) {
// Disable
if (disable_plugin($p)) {
+ elgg_delete_admin_notice('first_installation_plugin_reminder');
system_message(sprintf(elgg_echo('admin:plugins:disable:yes'), $p));
} else {
register_error(sprintf(elgg_echo('admin:plugins:disable:no'), $p));
@@ -26,4 +27,3 @@ elgg_view_regenerate_simplecache();
elgg_filepath_cache_reset();
forward($_SERVER['HTTP_REFERER']);
-exit;
diff --git a/actions/admin/plugins/enable.php b/actions/admin/plugins/enable.php
index b5286336b..053fbc556 100644
--- a/actions/admin/plugins/enable.php
+++ b/actions/admin/plugins/enable.php
@@ -11,8 +11,8 @@
// block non-admin users
admin_gatekeeper();
-// Get the plugin
$plugin = get_input('plugin');
+
if (!is_array($plugin)) {
$plugin = array($plugin);
}
@@ -20,6 +20,7 @@ if (!is_array($plugin)) {
foreach ($plugin as $p) {
// Disable
if (enable_plugin($p)) {
+ elgg_delete_admin_notice('first_installation_plugin_reminder');
system_message(sprintf(elgg_echo('admin:plugins:enable:yes'), $p));
} else {
register_error(sprintf(elgg_echo('admin:plugins:enable:no'), $p));
@@ -29,5 +30,4 @@ foreach ($plugin as $p) {
elgg_view_regenerate_simplecache();
elgg_filepath_cache_reset();
-forward($_SERVER['HTTP_REFERER']);
-exit;
+forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
diff --git a/actions/admin/plugins/enableall.php b/actions/admin/plugins/enableall.php
index ea4b48f95..d1758a4b3 100644
--- a/actions/admin/plugins/enableall.php
+++ b/actions/admin/plugins/enableall.php
@@ -16,6 +16,7 @@ $plugins = get_installed_plugins();
foreach ($plugins as $p => $data) {
// Enable
if (enable_plugin($p)) {
+ elgg_delete_admin_notice('first_installation_plugin_reminder');
system_message(sprintf(elgg_echo('admin:plugins:enable:yes'), $p));
} else {
register_error(sprintf(elgg_echo('admin:plugins:enable:no'), $p));
@@ -26,5 +27,4 @@ foreach ($plugins as $p => $data) {
elgg_view_regenerate_simplecache();
elgg_filepath_cache_reset();
-forward($_SERVER['HTTP_REFERER']);
-exit;
+forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
diff --git a/actions/admin/plugins/reorder.php b/actions/admin/plugins/reorder.php
index 6050a585f..6423dc14c 100644
--- a/actions/admin/plugins/reorder.php
+++ b/actions/admin/plugins/reorder.php
@@ -13,8 +13,8 @@ admin_gatekeeper();
// Get the plugin
$mod = get_input('plugin');
-$mod = str_replace('.','',$mod);
-$mod = str_replace('/','',$mod);
+$mod = str_replace('.', '', $mod);
+$mod = str_replace('/', '', $mod);
// Get the new order
$order = (int) get_input('order');
@@ -35,6 +35,7 @@ if ($key = array_search($mod, $plugins)) {
// Disable
if (regenerate_plugin_list($plugins)) {
+ elgg_delete_admin_notice('first_installation_plugin_reminder');
system_message(sprintf(elgg_echo('admin:plugins:reorder:yes'), $plugin));
} else {
register_error(sprintf(elgg_echo('admin:plugins:reorder:no'), $plugin));
diff --git a/actions/admin/plugins/simple_update_states.php b/actions/admin/plugins/simple_update_states.php
new file mode 100644
index 000000000..197f183f9
--- /dev/null
+++ b/actions/admin/plugins/simple_update_states.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Elgg administration simple plugin bulk enable / disable
+ *
+ * Shows an alphabetical list of "simple" plugins.
+ *
+ * @package Elgg
+ * @subpackage Core
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+
+$installed_plugins = get_installed_plugins();
+$enabled_plugins = get_input('enabled_plugins', array());
+
+$success = TRUE;
+
+foreach ($installed_plugins as $plugin => $info) {
+ // this is only for simple plugins.
+ if (!isset($info['manifest']['admin_interface']) || $info['manifest']['admin_interface'] != 'simple') {
+ continue;
+ }
+
+ $plugin_enabled = is_plugin_enabled($plugin);
+
+ // only effect changes to plugins not already in that state.
+ if ($plugin_enabled && !in_array($plugin, $enabled_plugins)) {
+ $success = $success && disable_plugin($plugin);
+ } elseif (!$plugin_enabled && in_array($plugin, $enabled_plugins)) {
+ $success = $success && enable_plugin($plugin);
+ }
+}
+
+if ($success) {
+ elgg_delete_admin_notice('first_installation_plugin_reminder');
+ system_message(elgg_echo('admin:plugins:simple_simple_success'));
+} else {
+ register_error(elgg_echo('admins:plugins:simple_simple_fail'));
+}
+
+forward($_SERVER['HTTP_REFERER']); \ No newline at end of file