diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-06-09 20:19:08 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-06-09 20:19:08 +0000 |
commit | 64045426f4eb5150c46dd2534058c3522bbe6ecf (patch) | |
tree | c9ebdf02326824eb0b940c2ebbe0bc333668ffad /views | |
parent | 4886371c1709f5b098226e362986796b960f4e54 (diff) | |
download | elgg-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')
-rw-r--r-- | views/default/admin/plugins.php | 44 | ||||
-rw-r--r-- | views/default/css/admin.php | 7 | ||||
-rw-r--r-- | views/default/forms/admin/plugins/change_state.php | 20 |
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' +)); |