aboutsummaryrefslogtreecommitdiff
path: root/pages/river.php
diff options
context:
space:
mode:
Diffstat (limited to 'pages/river.php')
-rw-r--r--pages/river.php60
1 files changed, 60 insertions, 0 deletions
diff --git a/pages/river.php b/pages/river.php
new file mode 100644
index 000000000..0e1511334
--- /dev/null
+++ b/pages/river.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Main activity stream list page
+ */
+
+$options = array();
+
+$page_type = preg_replace('[\W]', '', get_input('page_type', 'all'));
+$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;
+ }
+}
+
+switch ($page_type) {
+ case 'mine':
+ $title = elgg_echo('river:mine');
+ $page_filter = 'mine';
+ $options['subject_guid'] = elgg_get_logged_in_user_guid();
+ break;
+ case 'friends':
+ $title = elgg_echo('river:friends');
+ $page_filter = 'friends';
+ $options['relationship_guid'] = elgg_get_logged_in_user_guid();
+ $options['relationship'] = 'friend';
+ break;
+ default:
+ $title = elgg_echo('river:all');
+ $page_filter = 'all';
+ break;
+}
+
+$activity = elgg_list_river($options);
+if (!$activity) {
+ $activity = elgg_echo('river:none');
+}
+
+$content = elgg_view('core/river/filter', array('selector' => $selector));
+
+$sidebar = elgg_view('core/river/sidebar');
+
+$params = array(
+ 'content' => $content . $activity,
+ 'sidebar' => $sidebar,
+ 'filter_context' => $page_filter,
+ 'class' => 'elgg-river-layout',
+);
+
+$body = elgg_view_layout('content', $params);
+
+echo elgg_view_page($title, $body);