diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-04-03 12:57:53 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-04-03 12:57:53 +0000 |
commit | 4cedebe6c9735bf9b4202e28f9777cf6467c4753 (patch) | |
tree | de4f9656f965ab14d4b765d1423d7281b9064cee /mod/groups/views/default | |
parent | 8c3c289bbb565c2b73e6249a5c40293f45453a55 (diff) | |
download | elgg-4cedebe6c9735bf9b4202e28f9777cf6467c4753.tar.gz elgg-4cedebe6c9735bf9b4202e28f9777cf6467c4753.tar.bz2 |
Fixes #3105 group sort menu uses filter menu
git-svn-id: http://code.elgg.org/elgg/trunk@8930 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/views/default')
-rw-r--r-- | mod/groups/views/default/groups/group_sort_menu.php | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/mod/groups/views/default/groups/group_sort_menu.php b/mod/groups/views/default/groups/group_sort_menu.php index 863515a85..c53b49c8e 100644 --- a/mod/groups/views/default/groups/group_sort_menu.php +++ b/mod/groups/views/default/groups/group_sort_menu.php @@ -2,23 +2,35 @@ /** * All groups listing page navigation * - * @todo should use navigation tab view */ -$group_count = (int)elgg_get_entities(array('types' => 'group', 'count' => true)); +$tabs = array( + 'newest' => array( + 'text' => elgg_echo('groups:newest'), + 'href' => 'groups/all?filter=newest', + 'priority' => 200, + ), + 'popular' => array( + 'text' => elgg_echo('groups:popular'), + 'href' => 'groups/all?filter=popular', + 'priority' => 300, + ), + 'discussion' => array( + 'text' => elgg_echo('groups:latestdiscussion'), + 'href' => 'groups/all?filter=discussion', + 'priority' => 400, + ), +); -$selected = elgg_extract('selected', $vars); - -$url = elgg_get_site_url() . "groups/all"; +// sets default selected item +if (strpos(full_url(), 'filter') === false) { + $tabs['newest']['selected'] = true; +} -?> -<div class="elgg-tabs mtm"> - <div class="right"> - <?php echo $group_count . " " . elgg_echo("groups:count"); ?> - </div> -<ul> - <li <?php if($selected == "newest") echo "class='selected'"; ?>><a href="<?php echo $url; ?>?filter=newest"><?php echo elgg_echo('groups:newest'); ?></a></li> - <li <?php if($selected == "pop") echo "class='selected'"; ?>><a href="<?php echo $url; ?>?filter=pop"><?php echo elgg_echo('groups:popular'); ?></a></li> - <li <?php if($selected == "active") echo "class='selected'"; ?>><a href="<?php echo $url; ?>?filter=active"><?php echo elgg_echo('groups:latestdiscussion'); ?></a></li> -</ul> -</div> +foreach ($tabs as $name => $tab) { + $tab['name'] = $name; + + elgg_register_menu_item('filter', $tab); +} + +echo elgg_view_menu('filter', array('sort_by' => 'priority', 'class' => 'elgg-menu-hz')); |