aboutsummaryrefslogtreecommitdiff
path: root/views/default/admin/plugins.php
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 /views/default/admin/plugins.php
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 'views/default/admin/plugins.php')
-rw-r--r--views/default/admin/plugins.php44
1 files changed, 25 insertions, 19 deletions
diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php
index 9f426fae2..1aa899fcc 100644
--- a/views/default/admin/plugins.php
+++ b/views/default/admin/plugins.php
@@ -1,8 +1,8 @@
<?php
/**
- * Elgg administration advanced plugin screen
+ * Elgg administration plugin screen
*
- * Shows a list of all plugins sorted by load order.
+ * Shows a list of plugins that can be sorted and filtered.
*
* @package Elgg.Core
* @subpackage Admin.Plugins
@@ -56,6 +56,11 @@ foreach ($installed_plugins as $id => $plugin) {
}
}
+$guids = array();
+foreach ($installed_plugins as $plugin) {
+ $guids[] = $plugin->getGUID();
+}
+
// sort plugins
switch ($sort) {
case 'date':
@@ -99,7 +104,7 @@ if (!array_key_exists($show_category, $categories)) {
}
$category_form = elgg_view_form('admin/plugins/filter', array(
- 'action' => 'admin/plugins/advanced',
+ 'action' => 'admin/plugins',
'method' => 'get',
'disable_security' => true,
), array(
@@ -120,7 +125,7 @@ if (!array_key_exists($sort, $sort_options)) {
}
$sort_form = elgg_view_form('admin/plugins/sort', array(
- 'action' => 'admin/plugins/advanced',
+ 'action' => 'admin/plugins',
'method' => 'get',
'disable_security' => true,
), array(
@@ -129,21 +134,22 @@ $sort_form = elgg_view_form('admin/plugins/sort', array(
'category' => $show_category,
));
-
-// @todo Until "en/deactivate all" means "All plugins on this page" hide when not looking at all.
-if ($show_category == 'all') {
- $activate_url = "action/admin/plugins/activate_all";
- $activate_url = elgg_add_action_tokens_to_url($activate_url);
- $deactivate_url = "action/admin/plugins/deactivate_all";
- $deactivate_url = elgg_add_action_tokens_to_url($deactivate_url);
-
- $buttons = "<div class=\"mbl\">";
- $buttons .= "<a class='elgg-button elgg-button-action' href=\"$activate_url\">" . elgg_echo('admin:plugins:activate_all') . '</a> ';
- $buttons .= "<a class='elgg-button elgg-button-cancel' href=\"$deactivate_url\">" . elgg_echo('admin:plugins:deactivate_all') . '</a> ';
- $buttons .= "</div>";
-} else {
- $buttons = '';
-}
+$buttons = "<div class=\"clearfix mbm\">";
+$buttons .= elgg_view_form('admin/plugins/change_state', array(
+ 'action' => 'action/admin/plugins/activate_all',
+ 'class' => 'float',
+), array(
+ 'guids' => $guids,
+ 'action' => 'activate',
+));
+$buttons .= elgg_view_form('admin/plugins/change_state', array(
+ 'action' => 'action/admin/plugins/deactivate_all',
+ 'class' => 'float',
+), array(
+ 'guids' => $guids,
+ 'action' => 'deactivate',
+));
+$buttons .= "</div>";
$buttons .= $category_form . $sort_form;