aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/default/admin/plugins.php44
-rw-r--r--views/default/css/admin.php7
-rw-r--r--views/default/forms/admin/plugins/change_state.php20
3 files changed, 52 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;
diff --git a/views/default/css/admin.php b/views/default/css/admin.php
index 744211a20..e04bdc568 100644
--- a/views/default/css/admin.php
+++ b/views/default/css/admin.php
@@ -158,6 +158,13 @@ table.mceLayout {
.center {
text-align: center;
}
+.float {
+ float: left;
+}
+.float-alt {
+ float: right;
+}
+
/* ***************************************
PAGE WRAPPER
*************************************** */
diff --git a/views/default/forms/admin/plugins/change_state.php b/views/default/forms/admin/plugins/change_state.php
new file mode 100644
index 000000000..ba5d873e7
--- /dev/null
+++ b/views/default/forms/admin/plugins/change_state.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Activate/deactive all plugins specified by guids array
+ *
+ * @uses $vars['guids'] Array of GUIDs
+ * @uses $vars['action'] 'activate' or 'deactivate'
+ */
+
+$guids = elgg_extract('guids', $vars, array());
+$guids = implode(',', $guids);
+
+echo elgg_view('input/hidden', array(
+ 'name' => 'guids',
+ 'value' => $guids,
+));
+
+echo elgg_view('input/submit', array(
+ 'value' => elgg_echo("admin:plugins:{$vars['action']}_all"),
+ 'class' => 'elgg-button elgg-button-action'
+));