aboutsummaryrefslogtreecommitdiff
path: root/mod/riverdashboard/index.php
diff options
context:
space:
mode:
authordave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-10 16:32:05 +0000
committerdave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-03-10 16:32:05 +0000
commit9456cf380a51d4863dd0ee96499763bb32f54284 (patch)
tree510773dbfd611deb6c399958e728f735d16a2ed2 /mod/riverdashboard/index.php
parent90c80171f9f089b4f2448c496e72d33432b5d724 (diff)
downloadelgg-9456cf380a51d4863dd0ee96499763bb32f54284.tar.gz
elgg-9456cf380a51d4863dd0ee96499763bb32f54284.tar.bz2
the beginnings of a new activity river with ajax notification and conversation clustering.
git-svn-id: http://code.elgg.org/elgg/trunk@5344 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/riverdashboard/index.php')
-rw-r--r--mod/riverdashboard/index.php140
1 files changed, 62 insertions, 78 deletions
diff --git a/mod/riverdashboard/index.php b/mod/riverdashboard/index.php
index 2312da945..9f46765a9 100644
--- a/mod/riverdashboard/index.php
+++ b/mod/riverdashboard/index.php
@@ -1,78 +1,62 @@
-<?php
-
- /**
- * Elgg river dashboard plugin index page
- *
- * @package ElggRiverDash
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Curverider Ltd <info@elgg.com>
- * @copyright Curverider Ltd 2008-2010
- * @link http://elgg.org/
- */
-
- require_once(dirname(dirname(dirname(__FILE__))) . '/engine/start.php');
-
- gatekeeper();
-
- $content = get_input('content','');
- $content = explode(',',$content);
- $type = $content[0];
- if (isset($content[1])) {
- $subtype = $content[1];
- } else {
- $subtype = '';
- }
- $orient = get_input('display');
- $callback = get_input('callback');
-
- if ($type == 'all') {
- $type = '';
- $subtype = '';
- }
-
- $body = '';
- if (empty($callback)) {
-
- //set a view for the wire to extend
- $area1 = elgg_view("riverdashboard/sitemessage");
-
- //set a view to display newest members
- $area1 .= elgg_view("riverdashboard/newestmembers");
-
- //set a view to display a welcome message
- $body .= elgg_view("riverdashboard/welcome");
-
- }
-
- switch($orient) {
- case 'mine':
- $subject_guid = $_SESSION['user']->guid;
- $relationship_type = '';
- break;
- case 'friends': $subject_guid = $_SESSION['user']->guid;
- $relationship_type = 'friend';
- break;
- default: $subject_guid = 0;
- $relationship_type = '';
- break;
- }
-
- $river = elgg_view_river_items($subject_guid, 0, $relationship_type, $type, $subtype, '') . "</div>";
-
- // Replacing callback calls in the nav with something meaningless
- $river = str_replace('callback=true','replaced=88,334',$river);
-
- $nav = elgg_view('riverdashboard/nav',array(
- 'type' => $type,
- 'subtype' => $subtype,
- 'orient' => $orient
- ));
- if (empty($callback)) {
- $body .= elgg_view('riverdashboard/container', array('body' => $nav . $river . elgg_view('riverdashboard/js')));
- page_draw(elgg_echo('dashboard'),elgg_view_layout('sidebar_boxes',$area1,$body));
- } else {
- header("Content-type: text/html; charset=UTF-8");
- echo $nav . $river . elgg_view('riverdashboard/js');
- }
-
-?>
+<?php
+
+/**
+ * Elgg river dashboard plugin index page
+ */
+
+require_once(dirname(dirname(dirname(__FILE__))) . '/engine/start.php');
+
+gatekeeper();
+
+$type = get_input('type');
+$subtype = get_input('subtype');
+$orient = get_input('display');
+if(!$orient)
+ $orient = 'all';
+$callback = get_input('callback');
+
+if ($type == 'all') {
+ $type = '';
+ $subtype = '';
+}
+
+$body = '';
+
+switch($orient) {
+ case 'mine':
+ $subject_guid = $_SESSION['user']->guid;
+ $relationship_type = '';
+ $title_wording = elgg_echo('river:mine');
+ break;
+ case 'friends': $subject_guid = $_SESSION['user']->guid;
+ $relationship_type = 'friend';
+ $title_wording = elgg_echo('river:friends');
+ break;
+ default: $subject_guid = 0;
+ $relationship_type = '';
+ $title_wording = elgg_echo('river:all');
+ break;
+}
+
+
+$title = elgg_view_title($title_wording);
+
+$river = elgg_view_river_items($subject_guid, 0, $relationship_type, $type, $subtype, '', 20, 0, 0, true, false);
+// Replacing callback calls in the nav with something meaningless
+$river = str_replace('callback=true','replaced=88,334',$river);
+
+$nav = elgg_view('riverdashboard/nav',array('type' => $type,'subtype' => $subtype,'orient' => $orient));
+if(isloggedin()){
+ $sidebar = elgg_view("riverdashboard/menu",array('type' => $type,'subtype' => $subtype,'orient' => $orient));
+ $sidebar .= elgg_view("riverdashboard/sidebar_options", array("object_type" => 'riverdashboard'));
+}else{
+ $sidebar = '';
+}
+set_context('riverdashboard');
+if (empty($callback)) {
+ $body .= elgg_view('riverdashboard/container', array('body' => $nav . $river . elgg_view('riverdashboard/js')));
+ page_draw($title_wording,elgg_view_layout('one_column_with_sidebar',$title . $body, $sidebar));
+} else {
+ header("Content-type: text/html; charset=UTF-8");
+ echo $nav . $river . elgg_view('riverdashboard/js');
+} \ No newline at end of file