aboutsummaryrefslogtreecommitdiff
path: root/mod/riverdashboard
diff options
context:
space:
mode:
Diffstat (limited to 'mod/riverdashboard')
-rw-r--r--mod/riverdashboard/actions/add.php56
-rw-r--r--mod/riverdashboard/actions/delete.php36
-rw-r--r--mod/riverdashboard/graphics/follow_icon.pngbin0 -> 344 bytes
-rw-r--r--mod/riverdashboard/index.php78
-rw-r--r--mod/riverdashboard/languages/en.php40
-rw-r--r--mod/riverdashboard/manifest.xml10
-rw-r--r--mod/riverdashboard/start.php64
-rw-r--r--mod/riverdashboard/views/default/river/sitemessage/create.php18
-rw-r--r--mod/riverdashboard/views/default/riverdashboard/container.php5
-rw-r--r--mod/riverdashboard/views/default/riverdashboard/css.php148
-rw-r--r--mod/riverdashboard/views/default/riverdashboard/js.php16
-rw-r--r--mod/riverdashboard/views/default/riverdashboard/nav.php54
-rw-r--r--mod/riverdashboard/views/default/riverdashboard/newestmembers.php28
-rw-r--r--mod/riverdashboard/views/default/riverdashboard/sitemessage.php98
-rw-r--r--mod/riverdashboard/views/default/riverdashboard/welcome.php17
-rw-r--r--mod/riverdashboard/views/default/settings/riverdashboard/edit.php16
-rw-r--r--mod/riverdashboard/views/default/widgets/river_widget/edit.php36
-rw-r--r--mod/riverdashboard/views/default/widgets/river_widget/view.php40
-rw-r--r--mod/riverdashboard/views/json/riverdashboard/container.php1
-rw-r--r--mod/riverdashboard/views/rss/riverdashboard/container.php1
20 files changed, 762 insertions, 0 deletions
diff --git a/mod/riverdashboard/actions/add.php b/mod/riverdashboard/actions/add.php
new file mode 100644
index 000000000..fc98664ae
--- /dev/null
+++ b/mod/riverdashboard/actions/add.php
@@ -0,0 +1,56 @@
+<?php
+
+ /**
+ * Elgg site message: add
+ *
+ * @package ElggSiteMessage
+ * @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/
+ **/
+
+ // Make sure we're logged in and are admin (send us to the front page if not)
+ admin_gatekeeper();
+
+ // Get input data
+ $message = get_input('sitemessage');
+ //$access = 1; //it is for all logged in users
+
+ // Make sure the message isn't blank
+ if (empty($message)) {
+ register_error(elgg_echo("sitemessages:blank"));
+ forward("mod/riverdashboard/");
+
+ // Otherwise, save the message
+ } else {
+
+ // Initialise a new ElggObject
+ $sitemessage = new ElggObject();
+ // Tell the system it's a site wide message
+ $sitemessage->subtype = "sitemessage";
+ // Set its owner to the current user
+ $sitemessage->owner_guid = $_SESSION['user']->getGUID();
+ // For now, set its access to logged in users
+ $sitemessage->access_id = 1; // this is for all logged in users
+ // Set description appropriately
+ $sitemessage->title = '';
+ $sitemessage->description = $message;
+ // Before we can set metadata, we need to save the message
+ if (!$sitemessage->save()) {
+ register_error(elgg_echo("sitemessage:error"));
+ forward("mod/riverdashboard/");
+ }
+ // Success message
+ system_message(elgg_echo("sitemessages:posted"));
+
+ // add to river
+ add_to_river('river/sitemessage/create','create',$_SESSION['user']->guid,$sitemessage->guid);
+
+ // Forward to the activity page
+ forward("mod/riverdashboard/");
+
+ }
+
+
+?>
diff --git a/mod/riverdashboard/actions/delete.php b/mod/riverdashboard/actions/delete.php
new file mode 100644
index 000000000..db9196f01
--- /dev/null
+++ b/mod/riverdashboard/actions/delete.php
@@ -0,0 +1,36 @@
+<?php
+
+ /**
+ * Elgg site message: delete
+ *
+ * @package ElggBlog
+ * @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/
+ */
+
+ // Make sure we're logged in (send us to the front page if not)
+ gatekeeper();
+
+ // Get input data
+ $guid = (int) get_input('message');
+
+ // Make sure we actually have permission to edit
+ $message = get_entity($guid);
+ if ($message->getSubtype() == "sitemessage" && $message->canEdit()) {
+
+ // Delete it!
+ $rowsaffected = $message->delete();
+ if ($rowsaffected > 0) {
+ // Success message
+ system_message(elgg_echo("sitemessage:deleted"));
+ } else {
+ register_error(elgg_echo("sitemessage:notdeleted"));
+ }
+ // Forward to the river
+ forward("mod/riverdashboard/");
+
+ }
+
+?> \ No newline at end of file
diff --git a/mod/riverdashboard/graphics/follow_icon.png b/mod/riverdashboard/graphics/follow_icon.png
new file mode 100644
index 000000000..56fa8b1f5
--- /dev/null
+++ b/mod/riverdashboard/graphics/follow_icon.png
Binary files differ
diff --git a/mod/riverdashboard/index.php b/mod/riverdashboard/index.php
new file mode 100644
index 000000000..2312da945
--- /dev/null
+++ b/mod/riverdashboard/index.php
@@ -0,0 +1,78 @@
+<?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');
+ }
+
+?>
diff --git a/mod/riverdashboard/languages/en.php b/mod/riverdashboard/languages/en.php
new file mode 100644
index 000000000..7875f863c
--- /dev/null
+++ b/mod/riverdashboard/languages/en.php
@@ -0,0 +1,40 @@
+<?php
+
+ $english = array(
+
+ 'mine' => 'Mine',
+ 'filter' => 'Filter',
+ 'riverdashboard:useasdashboard' => "Replace the default dashboard with this activity river?",
+ 'activity' => 'Activity',
+ 'riverdashboard:recentmembers' => 'Recent members',
+
+ /**
+ * Site messages
+ **/
+
+ 'sitemessages:announcements' => "Site announcements",
+ 'sitemessages:posted' => "Posted",
+ 'sitemessages:river:created' => "Site admin, %s,",
+ 'sitemessages:river:create' => "posted a new site wide message",
+ 'sitemessages:add' => "Add a site-wide message to the river page",
+ 'sitemessage:deleted' => "Site message deleted",
+ 'sitemessage:error' => "Failed to save site message.",
+
+ 'river:widget:noactivity' => 'We could not find any activity.',
+ 'river:widget:title' => "Activity",
+ 'river:widget:description' => "Show your latest activity.",
+ 'river:widget:title:friends' => "Friends' activity",
+ 'river:widget:description:friends' => "Show what your friends are up to.",
+ 'river:widgets:friends' => "Friends",
+ 'river:widgets:mine' => "Mine",
+ 'river:widget:label:displaynum' => "Number of entries to display:",
+ 'river:widget:type' => "Which river would you like to display? One that shows your activity or one that shows your friends activity?",
+ 'item:object:sitemessage' => "Site messages",
+ 'riverdashboard:avataricon' => "Would you like to use user avatars or icons on your site activity stream?",
+ 'option:icon' => 'Icons',
+ 'option:avatar' => 'Avatars',
+ );
+
+ add_translation("en",$english);
+
+?> \ No newline at end of file
diff --git a/mod/riverdashboard/manifest.xml b/mod/riverdashboard/manifest.xml
new file mode 100644
index 000000000..28e254288
--- /dev/null
+++ b/mod/riverdashboard/manifest.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin_manifest>
+ <field key="author" value="Curverider Ltd" />
+ <field key="version" value="1.7" />
+ <field key="description" value="Alternative replacement for the standard Elgg dashboard." />
+ <field key="website" value="http://www.elgg.org/" />
+ <field key="copyright" value="(C) Curverider 2008-2010" />
+ <field key="licence" value="GNU Public License version 2" />
+ <field key="elgg_version" value="2010030101" />
+</plugin_manifest>
diff --git a/mod/riverdashboard/start.php b/mod/riverdashboard/start.php
new file mode 100644
index 000000000..17bfdf8dd
--- /dev/null
+++ b/mod/riverdashboard/start.php
@@ -0,0 +1,64 @@
+<?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-2010
+ * @link http://elgg.org/
+ */
+
+ function riverdashboard_init() {
+
+ global $CONFIG;
+
+ // Register and optionally replace the dashboard
+ if (get_plugin_setting('useasdashboard', 'riverdashboard') == 'yes') {
+ register_page_handler('dashboard','riverdashboard_page_handler');
+ } else {
+ // Activity main menu
+ if (isloggedin())
+ {
+ add_menu(elgg_echo('activity'), $CONFIG->wwwroot . "mod/riverdashboard/");
+ }
+ }
+
+ // Page handler
+ register_page_handler('riverdashboard','riverdashboard_page_handler');
+
+ elgg_extend_view('css','riverdashboard/css');
+
+ add_widget_type('river_widget',elgg_echo('river:widget:title'), elgg_echo('river:widget:description'));
+
+ }
+
+ /**
+ * Page handler for riverdash
+ *
+ * @param unknown_type $page
+ */
+ function riverdashboard_page_handler($page)
+ {
+ global $CONFIG;
+
+ include(dirname(__FILE__) . "/index.php");
+ return true;
+ }
+
+ function riverdashboard_dashboard() {
+
+ include(dirname(__FILE__) . '/index.php');
+
+ }
+
+ register_elgg_event_handler('init','system','riverdashboard_init');
+
+ // Register actions
+ global $CONFIG;
+ register_action("riverdashboard/add",false,$CONFIG->pluginspath . "riverdashboard/actions/add.php");
+ register_action("riverdashboard/delete",false,$CONFIG->pluginspath . "riverdashboard/actions/delete.php");
+
+
+?> \ No newline at end of file
diff --git a/mod/riverdashboard/views/default/river/sitemessage/create.php b/mod/riverdashboard/views/default/river/sitemessage/create.php
new file mode 100644
index 000000000..eaceb1a2e
--- /dev/null
+++ b/mod/riverdashboard/views/default/river/sitemessage/create.php
@@ -0,0 +1,18 @@
+<?php
+
+ $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
+ $object = get_entity($vars['item']->object_guid);
+ $url = $object->getURL();
+
+ $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
+ $string = sprintf(elgg_echo("sitemessages:river:created"),$url) . " ";
+ $string .= elgg_echo("sitemessages:river:create");
+ $string .= "<div class=\"river_content_display\">";
+ $string .= $object->description;
+ $string .= "</div>";
+
+?>
+
+<?php
+ echo $string;
+?> \ No newline at end of file
diff --git a/mod/riverdashboard/views/default/riverdashboard/container.php b/mod/riverdashboard/views/default/riverdashboard/container.php
new file mode 100644
index 000000000..f4bfd7f83
--- /dev/null
+++ b/mod/riverdashboard/views/default/riverdashboard/container.php
@@ -0,0 +1,5 @@
+<?php
+
+?>
+
+<div id="river_container"><?php echo $vars['body']; ?></div> \ No newline at end of file
diff --git a/mod/riverdashboard/views/default/riverdashboard/css.php b/mod/riverdashboard/views/default/riverdashboard/css.php
new file mode 100644
index 000000000..d9c36f048
--- /dev/null
+++ b/mod/riverdashboard/views/default/riverdashboard/css.php
@@ -0,0 +1,148 @@
+<?php
+
+ /**
+ * Elgg riverdashboard CSS
+ *
+ * @package riverdashboard
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.org/
+ */
+
+?>
+.sidebarBox #thewire_sidebarInputBox {
+ width:178px;
+}
+.sidebarBox .last_wirepost {
+ margin:20px 0 20px 0;
+}
+.sidebarBox .last_wirepost .thewire-singlepage {
+ margin:0;
+}
+.sidebarBox .last_wirepost .thewire-singlepage .thewire_options {
+ display:none;
+}
+.sidebarBox .last_wirepost .thewire-singlepage .note_date {
+ line-height: 1em;
+ padding:3px 0 0 0;
+ width:142px;
+}
+.sidebarBox .last_wirepost .thewire-singlepage .note_body {
+ color:#666666;
+ line-height: 1.2em;
+}
+.sidebarBox .last_wirepost .thewire-singlepage .thewire-post {
+ background-position: 130px bottom;
+}
+.sidebarBox .thewire_characters_remaining {
+ float:right;
+}
+.sidebarBox input.thewire_characters_remaining_field {
+ background: #dedede;
+}
+.sidebarBox input.thewire_characters_remaining_field:focus {
+ background: #dedede;
+ border:none;
+}
+.sidebarBox input#thewire_submit_button {
+ margin:2px 0 0 0;
+ padding:2px 2px 1px 2px;
+ height:auto;
+}
+.sidebarBox .membersWrapper {
+ background: white;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ padding:7px;
+}
+.sidebarBox .membersWrapper .recentMember {
+ margin:2px;
+ float:left;
+}
+.sidebarBox .membersWrapper .recentMember .usericon img {
+ width:25px;
+ height:25px;
+}
+/* br necessary for ie6 & 7 */
+.sidebarBox .membersWrapper br {
+ height:0;
+ line-height:0;
+}
+.welcomemessage {
+ background:white;
+}
+.riverdashboard_filtermenu {
+ margin:10px 0 10px 0;
+}
+
+.river_pagination .forward,
+.river_pagination .back {
+ display:block;
+ float:left;
+ border:1px solid #cccccc;
+ color:#4690d6;
+ text-align: center;
+ font-size: 12px;
+ font-weight: normal;
+ margin:0 6px 0 0;
+ padding:0 4px 1px 4px;
+ cursor: pointer;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+}
+.river_pagination .forward:hover,
+.river_pagination .back:hover {
+ background:#4690d6;
+ color:white;
+ text-decoration: none;
+ border:1px solid #4690d6;
+}
+.river_pagination .back {
+ margin:0 20px 0 0;
+}
+/* IE6 */
+* html .river_pagination { margin-top:17px; }
+/* IE7 */
+*:first-child+html .river_pagination { margin-top:17px; }
+
+/* activity widget */
+.collapsable_box_content .river_item p {
+ color:#333333;
+}
+
+.collapsable_box_content .content_area_user_title h2 {
+ font-size:1.25em;
+ line-height:1.2em;
+ margin:0;
+ padding:0 0 2px 0;
+ color:#4690d6;
+}
+.river_content img {
+ margin:2px 0 2px 20px;
+}
+
+.river_content_display {
+ border-left:1px solid #ddd;
+ padding:2px 10px 0 10px;
+ font-size:90%;
+ margin:4px 0 2px 30px;
+}
+
+.river_content_display p {
+ padding:0;
+ margin:0;
+}
+
+.following_icon {
+ width:20px;
+ height:40px;
+ margin:0 2px 0 2px;
+ background: url(<?php echo $vars['url']; ?>mod/riverdashboard/graphics/follow_icon.png) no-repeat left top;
+}
+.river_content_display div.usericon a.icon img {
+ width:40px;
+ height:40px;
+}
+
+
diff --git a/mod/riverdashboard/views/default/riverdashboard/js.php b/mod/riverdashboard/views/default/riverdashboard/js.php
new file mode 100644
index 000000000..01adec77c
--- /dev/null
+++ b/mod/riverdashboard/views/default/riverdashboard/js.php
@@ -0,0 +1,16 @@
+<?php
+
+/*
+<script type="text/javascript">
+ $(document).ready(function() {
+
+ var href = $("div.river_pagination a").attr('href');
+ href = href.replace("callback=true","callback=");
+ $("div.river_pagination a").attr('href',href);
+
+ });
+</script>
+
+*/
+
+?> \ 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..43d5723ca
--- /dev/null
+++ b/mod/riverdashboard/views/default/riverdashboard/nav.php
@@ -0,0 +1,54 @@
+<?php
+
+ $contents = array();
+ $contents['all'] = 'all';
+ if (!empty($vars['config']->registered_entities)) {
+ foreach ($vars['config']->registered_entities as $type => $ar) {
+ foreach ($vars['config']->registered_entities[$type] as $object) {
+ if (!empty($object )) {
+ $keyname = 'item:'.$type.':'.$object;
+ } else $keyname = 'item:'.$type;
+ $contents[$keyname] = "{$type},{$object}";
+ }
+ }
+ }
+
+ $allselect = ''; $friendsselect = ''; $mineselect = '';
+ switch($vars['orient']) {
+ case '': $allselect = 'class="selected"';
+ break;
+ case 'friends': $friendsselect = 'class="selected"';
+ break;
+ case 'mine': $mineselect = 'class="selected"';
+ break;
+ }
+
+?>
+
+<div class="contentWrapper">
+ <div id="elgg_horizontal_tabbed_nav">
+ <ul>
+ <li <?php echo $allselect; ?> ><a onclick="javascript:$('#river_container').load('<?php echo $vars['url']; ?>mod/riverdashboard/?content=<?php echo $vars['type']; ?>,<?php echo $vars['subtype']; ?>&amp;callback=true'); return false;" href="?display="><?php echo elgg_echo('all'); ?></a></li>
+ <li <?php echo $friendsselect; ?> ><a onclick="javascript:$('#river_container').load('<?php echo $vars['url']; ?>mod/riverdashboard/?display=friends&amp;content=<?php echo $vars['type']; ?>,<?php echo $vars['subtype']; ?>&amp;callback=true'); return false;" href="?display=friends"><?php echo elgg_echo('friends'); ?></a></li>
+ <li <?php echo $mineselect; ?> ><a onclick="javascript:$('#river_container').load('<?php echo $vars['url']; ?>mod/riverdashboard/?display=mine&amp;content=<?php echo $vars['type']; ?>,<?php echo $vars['subtype']; ?>&amp;callback=true'); return false;" href="?display=mine"><?php echo elgg_echo('mine'); ?></a></li>
+ </ul>
+ </div>
+
+ <div class="riverdashboard_filtermenu">
+ <select name="content" id="content" onchange="javascript:$('#river_container').load('<?php echo $vars['url']; ?>mod/riverdashboard/?callback=true&amp;display='+$('input#display').val() + '&amp;content=' + $('select#content').val());">
+ <?php
+
+ foreach($contents as $label => $content) {
+ if (("{$vars['type']},{$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" id="display" value="<?php echo htmlentities($vars['orient']); ?>" />
+ <!-- <input type="submit" value="<?php echo elgg_echo('filter'); ?>" /> -->
+ </div>
+<!-- </div> -->
diff --git a/mod/riverdashboard/views/default/riverdashboard/newestmembers.php b/mod/riverdashboard/views/default/riverdashboard/newestmembers.php
new file mode 100644
index 000000000..562f4b114
--- /dev/null
+++ b/mod/riverdashboard/views/default/riverdashboard/newestmembers.php
@@ -0,0 +1,28 @@
+<?php
+
+ /**
+ * Elgg thewire view page
+ *
+ * @package ElggTheWire
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ *
+ */
+
+ $newest_members = elgg_get_entities_from_metadata(array('metadata_names' => 'icontime', 'types' => 'user', 'limit' => 18));
+
+?>
+
+<div class="sidebarBox">
+<h3><?php echo elgg_echo('riverdashboard:recentmembers') ?></h3>
+<div class="membersWrapper"><br />
+<?php
+ foreach($newest_members as $mem){
+ echo "<div class=\"recentMember\">" . elgg_view("profile/icon",array('entity' => $mem, 'size' => 'tiny')) . "</div>";
+ }
+?>
+<div class="clearfloat"></div>
+</div>
+</div> \ No newline at end of file
diff --git a/mod/riverdashboard/views/default/riverdashboard/sitemessage.php b/mod/riverdashboard/views/default/riverdashboard/sitemessage.php
new file mode 100644
index 000000000..6cc2bc60d
--- /dev/null
+++ b/mod/riverdashboard/views/default/riverdashboard/sitemessage.php
@@ -0,0 +1,98 @@
+<?php
+
+ /**
+ * Elgg thewire view page
+ *
+ * @package ElggTheWire
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ *
+ */
+
+ //grab the current site message
+ $site_message = elgg_get_entities(array('types' => 'object', 'subtypes' => 'sitemessage', 'limit' => 1));
+ if ($site_message) {
+ $mes = $site_message[0];
+ $message = $mes->description;
+ $dateStamp = friendly_time($mes->time_created);
+ $delete = elgg_view("output/confirmlink",array(
+ 'href' => $vars['url'] . "action/riverdashboard/delete?message=" . $mes->guid,
+ 'text' => elgg_echo('delete'),
+ 'confirm' => elgg_echo('deleteconfirm'),
+ ));
+ }
+
+?>
+
+ <div class="sidebarBox">
+
+<?php
+
+ //if there is a site message
+ if($site_message){
+
+?>
+
+ <?php
+
+ echo "<h3>" . elgg_echo("sitemessages:announcements") . "</h3>";
+ echo "<p><small>" . elgg_echo("sitemessages:posted") . ": " . $dateStamp;
+ //if admin display the delete link
+ if(isadminloggedin())
+ echo " " . $delete . " ";
+ echo "</small></p>";
+ //display the message
+ echo "<p>" . $message . "</p>";
+
+ //display the input form to add a new message
+ if(isadminloggedin()){
+ //action
+ $action = "riverdashboard/add";
+ $link = elgg_echo("sitemessages:add");
+ $input_area = elgg_view('input/plaintext', array('internalname' => 'sitemessage', 'value' => ''));
+ $submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save')));
+ $form_body = <<<EOT
+
+ <p><a class="collapsibleboxlink">{$link}</a></p>
+ <div class="collapsible_box">
+ {$input_area}<br />{$submit_input}
+ </div>
+
+EOT;
+?>
+
+<?php
+ //display the form
+ echo elgg_view('input/form', array('action' => "{$vars['url']}action/$action", 'body' => $form_body));
+
+ }//end of admin if statement
+?>
+<?php
+ //if there is no message, add a form to create one
+ }else{
+
+ if(isadminloggedin()){
+
+ //action
+ $action = "riverdashboard/add";
+ $link = elgg_echo("sitemessages:add");
+ $input_area = elgg_view('input/text', array('internalname' => 'sitemessage', 'value' => ''));
+ $submit_input = elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('save')));
+ $form_body = <<<EOT
+
+ <p><a class="collapsibleboxlink">{$link}</a></p>
+ <div class="collapsible_box">
+ {$input_area}<br />{$submit_input}
+ </div>
+EOT;
+?>
+<?php
+ //display the form
+ echo elgg_view('input/form', array('action' => "{$vars['url']}action/$action", 'body' => $form_body));
+
+ }//end of admin check
+ }//end of main if
+?>
+</div>
diff --git a/mod/riverdashboard/views/default/riverdashboard/welcome.php b/mod/riverdashboard/views/default/riverdashboard/welcome.php
new file mode 100644
index 000000000..23541c0ac
--- /dev/null
+++ b/mod/riverdashboard/views/default/riverdashboard/welcome.php
@@ -0,0 +1,17 @@
+<?php
+
+ /**
+ * Elgg thewire view page
+ *
+ * @package ElggTheWire
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider <info@elgg.com>
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ *
+ */
+
+?>
+<div id="content_area_user_title">
+<h2><?php echo sprintf(elgg_echo('welcome:user'), $_SESSION['user']->name); ?></h2>
+</div> \ No newline at end of file
diff --git a/mod/riverdashboard/views/default/settings/riverdashboard/edit.php b/mod/riverdashboard/views/default/settings/riverdashboard/edit.php
new file mode 100644
index 000000000..2e0a434fb
--- /dev/null
+++ b/mod/riverdashboard/views/default/settings/riverdashboard/edit.php
@@ -0,0 +1,16 @@
+<?php
+?>
+<p>
+ <?php echo elgg_echo('riverdashboard:useasdashboard'); ?>
+ <select name="params[useasdashboard]">
+ <option value="yes" <?php if ($vars['entity']->useasdashboard == 'yes') echo " selected=\"yes\" "; ?>><?php echo elgg_echo('option:yes'); ?></option>
+ <option value="no" <?php if ($vars['entity']->useasdashboard != 'yes') echo " selected=\"yes\" "; ?>><?php echo elgg_echo('option:no'); ?></option>
+ </select>
+</p>
+<p>
+ <?php echo elgg_echo('riverdashboard:avataricon'); ?>
+ <select name="params[avatar_icon]">
+ <option value="icon" <?php if ($vars['entity']->avatar_icon == 'icon') echo " selected=\"yes\" "; ?>><?php echo elgg_echo('option:icon'); ?></option>
+ <option value="avatar" <?php if ($vars['entity']->avatar_icon == 'avatar') echo " selected=\"yes\" "; ?>><?php echo elgg_echo('option:avatar'); ?></option>
+ </select>
+</p> \ No newline at end of file
diff --git a/mod/riverdashboard/views/default/widgets/river_widget/edit.php b/mod/riverdashboard/views/default/widgets/river_widget/edit.php
new file mode 100644
index 000000000..3f3c9d625
--- /dev/null
+++ b/mod/riverdashboard/views/default/widgets/river_widget/edit.php
@@ -0,0 +1,36 @@
+<?php
+ /**
+ * Edit the widget
+ *
+ * @package ElggRiver
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+ if(!$vars['entity']->content_type)
+ $content_type = 'mine';
+ else
+ $content_type = $vars['entity']->content_type;
+
+
+?>
+<p>
+ <?php echo elgg_echo('river:widget:label:displaynum'); ?>
+
+ <select name="params[num_display]">
+ <option value="5" <?php if ($vars['entity']->num_display == 5) echo " selected=\"yes\" "; ?>>5</option>
+ <option value="8" <?php if (($vars['entity']->num_display == 8)) echo " selected=\"yes\" "; ?>>8</option>
+ <option value="12" <?php if ($vars['entity']->num_display == 12) echo " selected=\"yes\" "; ?>>12</option>
+ <option value="15" <?php if ($vars['entity']->num_display == 15) echo " selected=\"yes\" "; ?>>15</option>
+ </select>
+</p>
+<p>
+ <?php echo elgg_echo('river:widget:type'); ?>
+
+ <select name="params[content_type]">
+ <option value="mine" <?php if ($content_type == 'mine') echo " selected=\"yes\" "; ?>><?php echo elgg_echo("river:widgets:mine");?></option>
+ <option value="friends" <?php if ($content_type != 'mine') echo " selected=\"yes\" "; ?>><?php echo elgg_echo("river:widgets:friends");?></option>
+ </select>
+</p> \ No newline at end of file
diff --git a/mod/riverdashboard/views/default/widgets/river_widget/view.php b/mod/riverdashboard/views/default/widgets/river_widget/view.php
new file mode 100644
index 000000000..039962c27
--- /dev/null
+++ b/mod/riverdashboard/views/default/widgets/river_widget/view.php
@@ -0,0 +1,40 @@
+<?php
+ /**
+ * View the widget
+ *
+ * @package ElggRiver
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.com/
+ */
+
+ $owner = page_owner_entity();
+
+ //get the type - mine or friends
+ $type = $vars['entity']->content_type;
+ if(!$type)
+ $type = "mine";
+
+ //based on type grab the correct content type
+ if($type == "mine")
+ $content_type = '';
+ else
+ $content_type = 'friend';
+
+ //get the number of items to display
+ $limit = $vars['entity']->num_display;
+ if(!$limit)
+ $limit = 4;
+
+ //grab the river
+ $river = elgg_view_river_items($owner->getGuid(), 0, $content_type, $content[0], $content[1], '', $limit,0,0,false);
+
+ //display
+ echo "<div class=\"contentWrapper\">";
+ if($type != 'mine')
+ echo "<div class='content_area_user_title'><h2>" . elgg_echo("friends") . "</h2></div>";
+ echo $river;
+ echo "</div>";
+
+?> \ No newline at end of file
diff --git a/mod/riverdashboard/views/json/riverdashboard/container.php b/mod/riverdashboard/views/json/riverdashboard/container.php
new file mode 100644
index 000000000..871a6cc7e
--- /dev/null
+++ b/mod/riverdashboard/views/json/riverdashboard/container.php
@@ -0,0 +1 @@
+<?php echo $vars['body']; ?> \ No newline at end of file
diff --git a/mod/riverdashboard/views/rss/riverdashboard/container.php b/mod/riverdashboard/views/rss/riverdashboard/container.php
new file mode 100644
index 000000000..871a6cc7e
--- /dev/null
+++ b/mod/riverdashboard/views/rss/riverdashboard/container.php
@@ -0,0 +1 @@
+<?php echo $vars['body']; ?> \ No newline at end of file