Permalink
Browse files

feature(groups): allow the group river to be filtered by content type

fixes #7167
  • Loading branch information...
jeabakker committed Mar 23, 2016
1 parent b96c736 commit 0d8f93641ec69b13b81902dee6645cf4fbf8fce1
Showing with 21 additions and 2 deletions.
  1. +21 −2 mod/groups/views/default/resources/groups/activity.php
@@ -16,7 +16,7 @@
$db_prefix = elgg_get_config('dbprefix');
-$content = elgg_list_river(array(
+$options = array(
'joins' => array(
"JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid",
"LEFT JOIN {$db_prefix}entities e2 ON e2.guid = rv.target_guid",
@@ -25,12 +25,31 @@
"(e1.container_guid = $group->guid OR e2.container_guid = $group->guid)",
),
'no_results' => elgg_echo('groups:activity:none'),
-));
+);
+
+$type = preg_replace('[\W]', '', get_input('type', 'all'));
+$subtype = preg_replace('[\W]', '', get_input('subtype', ''));
+if ($subtype) {
+ $selector = "type=$type&subtype=$subtype";
+} else {
+ $selector = "type=$type";
+}
+
+if ($type != 'all') {
+ $options['type'] = $type;
+ if ($subtype) {
+ $options['subtype'] = $subtype;
+ }
+}
+
+$content = elgg_view('core/river/filter', array('selector' => $selector));
+$content .= elgg_list_river($options);
$params = array(
'content' => $content,
'title' => $title,
'filter' => '',
+ 'class' => 'elgg-river-layout',
);
$body = elgg_view_layout('content', $params);

0 comments on commit 0d8f936

Please sign in to comment.