diff options
author | Sem <sembrestels@riseup.net> | 2011-11-18 07:32:27 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2011-11-18 07:32:27 +0100 |
commit | e53d410129701ea1c9d19529afa493f11b5f5b70 (patch) | |
tree | d9963b24bf8932654b4a47e36602c75975e50dba /actions/admin/plugins | |
parent | 377da25d2965c64941f83baae119fc970ec60982 (diff) | |
parent | 08a962c98e2923724f8013d6eaae89101243752a (diff) | |
download | elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.gz elgg-e53d410129701ea1c9d19529afa493f11b5f5b70.tar.bz2 |
Merge github.com:Elgg/Elgg
Conflicts:
engine/lib/input.php
Diffstat (limited to 'actions/admin/plugins')
-rw-r--r-- | actions/admin/plugins/activate.php | 4 | ||||
-rw-r--r-- | actions/admin/plugins/activate_all.php | 4 | ||||
-rw-r--r-- | actions/admin/plugins/deactivate.php | 4 | ||||
-rw-r--r-- | actions/admin/plugins/deactivate_all.php | 4 | ||||
-rw-r--r-- | actions/admin/plugins/set_priority.php | 4 | ||||
-rw-r--r-- | actions/admin/plugins/simple_update_states.php | 48 |
6 files changed, 15 insertions, 53 deletions
diff --git a/actions/admin/plugins/activate.php b/actions/admin/plugins/activate.php index 0049878e3..224b5a2ae 100644 --- a/actions/admin/plugins/activate.php +++ b/actions/admin/plugins/activate.php @@ -29,7 +29,9 @@ foreach ($plugin_guids as $guid) { if ($plugin->activate()) { $activated_guids[] = $guid; } else { - register_error(elgg_echo('admin:plugins:activate:no', array($plugin->getManifest()->getName()))); + $msg = $plugin->getError(); + $string = ($msg) ? 'admin:plugins:activate:no_with_msg' : 'admin:plugins:activate:no'; + register_error(elgg_echo($string, array($plugin->getFriendlyName(), $plugin->getError()))); } } diff --git a/actions/admin/plugins/activate_all.php b/actions/admin/plugins/activate_all.php index 19eb82142..19c142346 100644 --- a/actions/admin/plugins/activate_all.php +++ b/actions/admin/plugins/activate_all.php @@ -18,7 +18,9 @@ foreach ($guids as $guid) { 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()))); + $msg = $plugin->getError(); + $string = ($msg) ? 'admin:plugins:activate:no_with_msg' : 'admin:plugins:activate:no'; + register_error(elgg_echo($string, array($plugin->getFriendlyName(), $plugin->getError()))); } } } diff --git a/actions/admin/plugins/deactivate.php b/actions/admin/plugins/deactivate.php index f5eca3aaa..2ce796eff 100644 --- a/actions/admin/plugins/deactivate.php +++ b/actions/admin/plugins/deactivate.php @@ -28,7 +28,9 @@ foreach ($plugin_guids as $guid) { 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()))); + $msg = $plugin->getError(); + $string = ($msg) ? 'admin:plugins:deactivate:no_with_msg' : 'admin:plugins:deactivate:no'; + register_error(elgg_echo($string, array($plugin->getFriendlyName(), $plugin->getError()))); } } diff --git a/actions/admin/plugins/deactivate_all.php b/actions/admin/plugins/deactivate_all.php index 436a3ad30..479e9c607 100644 --- a/actions/admin/plugins/deactivate_all.php +++ b/actions/admin/plugins/deactivate_all.php @@ -18,7 +18,9 @@ foreach ($guids as $guid) { 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()))); + $msg = $plugin->getError(); + $string = ($msg) ? 'admin:plugins:deactivate:no_with_msg' : 'admin:plugins:deactivate:no'; + register_error(elgg_echo($string, array($plugin->getFriendlyName(), $plugin->getError()))); } } } diff --git a/actions/admin/plugins/set_priority.php b/actions/admin/plugins/set_priority.php index 1f8bc24af..79b1c4c53 100644 --- a/actions/admin/plugins/set_priority.php +++ b/actions/admin/plugins/set_priority.php @@ -26,7 +26,9 @@ if (!($plugin instanceof ElggPlugin)) { if ($plugin->setPriority($priority)) { //system_message(elgg_echo('admin:plugins:set_priority:yes', array($plugin->getManifest()->getName()))); } else { - register_error(elgg_echo('admin:plugins:set_priority:no', array($plugin->getManifest()->getName()))); + $msg = $plugin->getError(); + $string = ($msg) ? 'admin:plugins:set_priority:no_with_msg' : 'admin:plugins:set_priority:no'; + register_error(elgg_echo($string, array($plugin->getFriendlyName(), $plugin->getError()))); } // don't regenerate the simplecache because the plugin won't be diff --git a/actions/admin/plugins/simple_update_states.php b/actions/admin/plugins/simple_update_states.php deleted file mode 100644 index 7601013a7..000000000 --- a/actions/admin/plugins/simple_update_states.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Bulk activate/deactivate for plugins appearing in the "simple" interface. - * - * Plugins marked as using the "simple" interface can be activated/deactivated - * en masse by passing the plugins to activate as an array of their plugin guids - * in $_REQUEST['enabled_plugins']. All "simple" plugins not in this array will be - * deactivated. - * - * Simplecache and views cache are reset. - * - * @uses array $_REQUEST['activated_plugin_guids'] Array of plugin guids to activate. - * - * @since 1.8 - * @package Elgg.Core - * @subpackage Administration.Plugins - */ - -$active_plugin_guids = get_input('active_plugin_guids', array()); -$installed_plugins = elgg_get_plugins('any'); -$success = TRUE; - -foreach ($installed_plugins as $plugin) { - // this is only for simple plugins. - if ($plugin->getManifest()->getAdminInterface() != 'simple') { - continue; - } - - // only effect changes to plugins not already in that state. - if ($plugin->isActive() && !in_array($plugin->guid, $active_plugin_guids)) { - $success = $success && $plugin->deactivate(); - } elseif (!$plugin->isActive() && in_array($plugin->guid, $active_plugin_guids)) { - $success = $success && $plugin->activate(); - } -} - -if ($success) { - //system_message(elgg_echo('admin:plugins:simple_simple_success')); -} else { - register_error(elgg_echo('admin:plugins:simple_simple_fail')); -} - -// don't regenerate the simplecache because the plugin won't be -// loaded until next run. Just invalidate and let it regnerate as needed -elgg_invalidate_simplecache(); -elgg_filepath_cache_reset(); - -forward(REFERER);
\ No newline at end of file |