Permalink
Browse files

feature(groups): adds alphabetical sorting to all groups page

  • Loading branch information...
jeabakker committed Jul 2, 2015
1 parent fcf6e19 commit ba82c6827ad6839b64cabf56de8a08695992bc34
@@ -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',
@@ -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(

0 comments on commit ba82c68

Please sign in to comment.