Skip to content

Commit

Permalink
feature(groups): adds alphabetical sorting to all groups page
Browse files Browse the repository at this point in the history
  • Loading branch information
jeabakker committed Jul 2, 2015
1 parent fcf6e19 commit ba82c68
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mod/groups/views/default/groups/group_sort_menu.php
Expand Up @@ -11,6 +11,11 @@
'href' => 'groups/all?filter=newest',
'priority' => 200,
),
'alpha' => array(
'text' => elgg_echo('sort:alpha'),
'href' => 'groups/all?filter=alpha',
'priority' => 250,
),
'popular' => array(
'text' => elgg_echo('sort:popular'),
'href' => 'groups/all?filter=popular',
Expand Down
11 changes: 11 additions & 0 deletions mod/groups/views/default/resources/groups/all.php
Expand Up @@ -47,6 +47,17 @@
$content = elgg_echo('groups:nofeatured');
}
break;
case 'alpha':
$dbprefix = elgg_get_config('dbprefix');
$content = elgg_list_entities(array(
'type' => 'group',
'joins' => ["JOIN {$dbprefix}groups_entity ge ON e.guid = ge.guid"],
'order_by' => 'ge.name',
'full_view' => false,
'no_results' => elgg_echo('groups:none'),
'distinct' => false,
));
break;
case 'newest':
default:
$content = elgg_list_entities(array(
Expand Down

0 comments on commit ba82c68

Please sign in to comment.