aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-13 13:03:33 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-13 13:03:33 +0000
commit771c5e5909e69f614372f6bfb43300647e5aa5e1 (patch)
tree8adc418cc5e11c4ac21211cd1f6a1904a209ab03
parent6f9f24e681a05b64ea84ab7ba0a50f40bb291f75 (diff)
downloadelgg-771c5e5909e69f614372f6bfb43300647e5aa5e1.tar.gz
elgg-771c5e5909e69f614372f6bfb43300647e5aa5e1.tar.bz2
New river dashboard.
git-svn-id: https://code.elgg.org/elgg/trunk@2737 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--mod/riverdashboard/index.php44
-rw-r--r--mod/riverdashboard/start.php27
-rw-r--r--mod/riverdashboard/views/default/riverdashboard/nav.php50
3 files changed, 121 insertions, 0 deletions
diff --git a/mod/riverdashboard/index.php b/mod/riverdashboard/index.php
new file mode 100644
index 000000000..d4be29b85
--- /dev/null
+++ b/mod/riverdashboard/index.php
@@ -0,0 +1,44 @@
+<?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-2009
+ * @link http://elgg.org/
+ */
+
+ require_once(dirname(dirname(dirname(__FILE__))) . '/engine/start.php');
+
+ gatekeeper();
+
+ $subtype = get_input('content','');
+ $orient = get_input('display');
+
+ if ($subtype == 'all') $subtype = '';
+
+ 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, '', $subtype, '');
+ $body = elgg_view('riverdashboard/nav',array(
+ 'subtype' => $subtype,
+ 'orient' => $orient
+ ));
+ $body .= $river;
+
+ echo page_draw(elgg_echo('dashboard'),elgg_view_layout('two_column_left_sidebar','',$body));
+
+?> \ No newline at end of file
diff --git a/mod/riverdashboard/start.php b/mod/riverdashboard/start.php
new file mode 100644
index 000000000..b99cff0a0
--- /dev/null
+++ b/mod/riverdashboard/start.php
@@ -0,0 +1,27 @@
+<?php
+
+ /**
+ * Elgg river dashboard plugin
+ *
+ * @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-2009
+ * @link http://elgg.org/
+ */
+
+ function riverdashboard_init() {
+
+ register_page_handler('dashboard','riverdashboard_dashboard');
+
+ }
+
+ function riverdashboard_dashboard() {
+
+ include(dirname(__FILE__) . '/index.php');
+
+ }
+
+ register_plugin_hook('init','system','riverdashboard_init');
+
+?> \ No newline at end of file
diff --git a/mod/riverdashboard/views/default/riverdashboard/nav.php b/mod/riverdashboard/views/default/riverdashboard/nav.php
new file mode 100644
index 000000000..a6e3a9381
--- /dev/null
+++ b/mod/riverdashboard/views/default/riverdashboard/nav.php
@@ -0,0 +1,50 @@
+<?php
+
+ $contents = array();
+ $contents['all'] = 'all';
+ if (!empty($vars['config']->registered_entities['object'])) {
+ foreach ($vars['config']->registered_entities['object'] as $object)
+ $contents['item:object:'.$object] = $object;
+ }
+
+ $allselect = ''; $friendsselect = ''; $mineselect = '';
+ switch($vars['orient']) {
+ case '': $allselect = 'class="riverdashboard_tabs_selected"';
+ break;
+ case 'friends': $friendsselect = 'class="riverdashboard_tabs_selected"';
+ break;
+ case 'mine': $mineselect = 'class="riverdashboard_tabs_selected"';
+ break;
+ }
+
+?>
+
+<div class="riverdashboard_navigation">
+ <div class="riverdashboard_tabs">
+ <p>
+ <a <?php echo $allselect; ?> href="?content=<?php echo $vars['subtype']; ?>">All</a>
+ <a <?php echo $friendsselect; ?> href="?display=friends&content=<?php echo $vars['subtype']; ?>">Friends</a>
+ <a <?php echo $mineselect; ?> href="?display=mine&content=<?php echo $vars['subtype']; ?>">Mine</a>
+ </p>
+ </div>
+
+ <div class="riverdashboard_content_select">
+ <form action="index.php">
+ <select name="content">
+ <?php
+
+ foreach($contents as $label => $content) {
+ if (($vars['subtype'] == $content) ||
+ (empty($vars['subtype']) && $content == 'all')) {
+ $selected = 'selected="selected"';
+ } else $selected = '';
+ echo "<option value=\"{$content}\" {$selected}>".elgg_echo($label)."</option>";
+ }
+
+ ?>
+ </select>
+ <input type="hidden" name="display" value="<?php echo htmlentities($vars['orient']); ?>" />
+ <input type="submit" value="<?php echo elgg_echo('filter'); ?>" />
+ </form>
+ </div>
+</div> \ No newline at end of file