aboutsummaryrefslogtreecommitdiff
path: root/actions/admin/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'actions/admin/plugins')
-rw-r--r--actions/admin/plugins/disable.php17
-rw-r--r--actions/admin/plugins/disableall.php14
-rw-r--r--actions/admin/plugins/enable.php16
-rw-r--r--actions/admin/plugins/enableall.php15
-rw-r--r--actions/admin/plugins/reorder.php20
-rw-r--r--actions/admin/plugins/simple_update_states.php22
6 files changed, 60 insertions, 44 deletions
diff --git a/actions/admin/plugins/disable.php b/actions/admin/plugins/disable.php
index ac80d46e3..3207e6800 100644
--- a/actions/admin/plugins/disable.php
+++ b/actions/admin/plugins/disable.php
@@ -1,24 +1,24 @@
<?php
/**
- * Disable plugin action.
+ * Disable a plugin or plugins.
*
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * Plugins to be disabled are passed via $_REQUEST['plugin'] as plugin ID (directory name).
+ * After disabling the plugin(s), the views cache and simplecache are both reset.
+ *
+ * @uses mixed $_GET['plugin'] The id (directory name) of the plugin to disable. Can be an array.
+ *
+ * @package Elgg.Core
+ * @subpackage Administration.Site
*/
-// block non-admin users
admin_gatekeeper();
-// Get the plugin
$plugin = get_input('plugin');
if (!is_array($plugin)) {
$plugin = array($plugin);
}
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');
@@ -27,6 +27,7 @@ foreach ($plugin as $p) {
}
}
+// need to reset caches for new view locations and cached view output.
elgg_view_regenerate_simplecache();
elgg_filepath_cache_reset();
diff --git a/actions/admin/plugins/disableall.php b/actions/admin/plugins/disableall.php
index 80553e9d1..8cba6252a 100644
--- a/actions/admin/plugins/disableall.php
+++ b/actions/admin/plugins/disableall.php
@@ -1,20 +1,19 @@
<?php
/**
- * Disable plugin action.
+ * Disable all installed plugins.
*
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * All plugins in the mod/ directory are disabled and the views cache and simplecache
+ * are reset.
+ *
+ * @package Elgg.Core
+ * @subpackage Administration.Site
*/
-// block non-admin users
admin_gatekeeper();
$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));
@@ -23,6 +22,7 @@ foreach ($plugins as $p => $data) {
}
}
+// need to reset caches for new view locations and cached view output.
elgg_view_regenerate_simplecache();
elgg_filepath_cache_reset();
diff --git a/actions/admin/plugins/enable.php b/actions/admin/plugins/enable.php
index 053fbc556..0510fafa8 100644
--- a/actions/admin/plugins/enable.php
+++ b/actions/admin/plugins/enable.php
@@ -1,14 +1,16 @@
<?php
/**
- * Enable plugin action.
+ * Enables a plugin or plugins.
*
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * Plugins to be enabled are passed via $_REQUEST['plugin'] as plugin ID (directory name).
+ * After enabling the plugin(s), the views cache and simplecache are reset.
+ *
+ * @uses mixed $_GET['plugin'] The id (directory name) of the plugin to enable. Can be an array.
+ *
+ * @package Elgg.Core
+ * @subpackage Administration.Site
*/
-// block non-admin users
admin_gatekeeper();
$plugin = get_input('plugin');
@@ -18,7 +20,6 @@ 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));
@@ -27,6 +28,7 @@ foreach ($plugin as $p) {
}
}
+// need to reset caches for new view locations and cached view output.
elgg_view_regenerate_simplecache();
elgg_filepath_cache_reset();
diff --git a/actions/admin/plugins/enableall.php b/actions/admin/plugins/enableall.php
index d1758a4b3..f3325d2a6 100644
--- a/actions/admin/plugins/enableall.php
+++ b/actions/admin/plugins/enableall.php
@@ -1,20 +1,19 @@
<?php
/**
- * Enable plugin action.
+ * Enables all installed plugins.
*
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * All plugins in the mod/ directory are enabled and the views cache and simplecache
+ * are reset.
+ *
+ * @package Elgg.Core
+ * @subpackage Administration.Site
*/
-// block non-admin users
admin_gatekeeper();
$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));
@@ -23,7 +22,7 @@ foreach ($plugins as $p => $data) {
}
}
-// Regen view cache
+// need to reset caches for new view locations and cached view output.
elgg_view_regenerate_simplecache();
elgg_filepath_cache_reset();
diff --git a/actions/admin/plugins/reorder.php b/actions/admin/plugins/reorder.php
index 6423dc14c..e3f5c4a0a 100644
--- a/actions/admin/plugins/reorder.php
+++ b/actions/admin/plugins/reorder.php
@@ -1,17 +1,21 @@
<?php
/**
- * Reorder plugin action.
+ * Changes the load order of a plugin.
*
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * Plugin order affects priority for view, action, and page handler
+ * overriding as well as the order of view extensions. Higher numbers
+ * are loaded after lower numbers, and so receive higher priority.
+ *
+ * NOTE: When viewing the admin page (advanced plugin admin in >= 1.8) plugins
+ * LOWER on the page have HIGHER priority and will override views, etc
+ * from plugins above them.
+ *
+ * @package Elgg.Core
+ * @subpackage Administration.Site
*/
-// block non-admin users
admin_gatekeeper();
-// Get the plugin
$mod = get_input('plugin');
$mod = str_replace('.', '', $mod);
$mod = str_replace('/', '', $mod);
@@ -44,4 +48,4 @@ if (regenerate_plugin_list($plugins)) {
elgg_view_regenerate_simplecache();
elgg_filepath_cache_reset();
-forward($_SERVER['HTTP_REFERER']);
+forward($_SERVER['HTTP_REFERER']); \ No newline at end of file
diff --git a/actions/admin/plugins/simple_update_states.php b/actions/admin/plugins/simple_update_states.php
index 197f183f9..1945868f2 100644
--- a/actions/admin/plugins/simple_update_states.php
+++ b/actions/admin/plugins/simple_update_states.php
@@ -1,13 +1,19 @@
<?php
/**
- * Elgg administration simple plugin bulk enable / disable
+ * Bulk enable and disable for plugins appearing in the "simple" interface.
*
- * Shows an alphabetical list of "simple" plugins.
+ * Plugins marked as using the "simple" interface can be enabled and disabled
+ * en masse by passing the enabled plugins as an array of their plugin ids
+ * (directory names) through $_REQUEST['enabled_plugins']. All "simple" plugins
+ * not in this array will be disabled.
*
- * @package Elgg
- * @subpackage Core
- * @author Curverider Ltd
- * @link http://elgg.org/
+ * Simplecache and views cache are reset.
+ *
+ * @uses array $_REQUEST['enabled_plugins'] An array of plugin ids (directory names) to enable.
+ *
+ * @since 1.8
+ * @package Elgg.Core
+ * @subpackage Administration.Site
*/
$installed_plugins = get_installed_plugins();
@@ -38,4 +44,8 @@ if ($success) {
register_error(elgg_echo('admins:plugins:simple_simple_fail'));
}
+// need to reset caches for new view locations and cached view output.
+elgg_view_regenerate_simplecache();
+elgg_filepath_cache_reset();
+
forward($_SERVER['HTTP_REFERER']); \ No newline at end of file