--- /dev/null
+<?php\r
+/**\r
+ * Check for new activity.\r
+ * Outputs # of new activity items since $_GET['last_checked'] time\r
+ */\r
+\r
+// Load Elgg engine will not include plugins\r
+require_once(dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php");\r
+ \r
+// check for last checked time\r
+if (!$seconds_passed = get_input('seconds_passed', 0)) {\r
+ echo '';\r
+ exit;\r
+}\r
+\r
+$last_reload = time() - $seconds_passed;\r
+\r
+//grab any new annotations\r
+$annotations = count_annotations('', '', '', '', '', '', '', $last_reload);\r
+if(!$annotations)\r
+ $annotations = 0;\r
+//grab all new objects created \r
+$entity_creation = elgg_get_entities(array(\r
+ 'count' => TRUE, \r
+ 'created_time_lower' => $last_reload,\r
+ 'wheres' => array('e.type != \'user\'')\r
+));\r
+if(!$entity_creation)\r
+ $entity_creation = 0;\r
+//grab any entities updated\r
+$entity_update = elgg_get_entities(array(\r
+ 'count' => TRUE, \r
+ 'modified_time_lower' => $last_reload,\r
+ 'wheres' => array('e.type != \'user\'')\r
+));\r
+if(!$entity_update)\r
+ $entity_update = 0;\r
+//get any relationships, such as friending - this is not working quite right yet\r
+//$relationship_action = elgg_get_entities_from_relationship(array('count' => TRUE));\r
+//if(!$relationship_action)\r
+// $relationship_action = 0;\r
+\r
+//sum all totals\r
+$all_activity = $annotations + $entity_creation + $entity_update;\r
+\r
+if ($all_activity > 0) {\r
+ $s = ($all_activity == 1) ? '' : 's';\r
+ echo "<a href=\"\" onClick=\"window.location.reload();\" class=\"update_wire\" style='margin-top:9px;'>$all_activity update$s!</a>";\r
+ //echo "<script type=\"text/javascript\">$(document).ready(function() { document.title = \"[{$all_activity}] new item{$s}!\"; }); </script>";\r
+?>\r
+ <script type="text/javascript">\r
+ $(document).ready(function(){\r
+ \r
+ var pageTitleSubstring;\r
+ var stringStartPosition = document.title.indexOf("]");\r
+ \r
+ if (stringStartPosition == -1) { // we haven't already altered page title\r
+ pageTitleSubstring = document.title; \r
+ } else { // we previously prepended to page title, need to remove it first\r
+ pageTitleSubstring = document.title.substring( (stringStartPosition+2) );\r
+ }\r
+ \r
+ document.title = "[<?php echo $all_activity; ?> update<?php echo $s; ?>] "+pageTitleSubstring;\r
+ });\r
+ </script>\r
+\r
+<?php \r
+} else {\r
+ echo '';\r
+ exit;\r
+}\r
-<?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\r
+\r
+/**\r
+ * Elgg river dashboard plugin index page\r
+ */\r
+\r
+require_once(dirname(dirname(dirname(__FILE__))) . '/engine/start.php');\r
+\r
+gatekeeper();\r
+ \r
+$type = get_input('type');\r
+$subtype = get_input('subtype');\r
+$orient = get_input('display');\r
+if(!$orient)\r
+ $orient = 'all';\r
+$callback = get_input('callback');\r
+ \r
+if ($type == 'all') {\r
+ $type = '';\r
+ $subtype = '';\r
+}\r
+\r
+$body = '';\r
+ \r
+switch($orient) {\r
+ case 'mine':\r
+ $subject_guid = $_SESSION['user']->guid;\r
+ $relationship_type = ''; \r
+ $title_wording = elgg_echo('river:mine');\r
+ break;\r
+ case 'friends': $subject_guid = $_SESSION['user']->guid;\r
+ $relationship_type = 'friend';\r
+ $title_wording = elgg_echo('river:friends');\r
+ break;\r
+ default: $subject_guid = 0;\r
+ $relationship_type = '';\r
+ $title_wording = elgg_echo('river:all');\r
+ break;\r
+}\r
+\r
+\r
+$title = elgg_view_title($title_wording);\r
+\r
+$river = elgg_view_river_items($subject_guid, 0, $relationship_type, $type, $subtype, '', 20, 0, 0, true, false);\r
+// Replacing callback calls in the nav with something meaningless\r
+$river = str_replace('callback=true','replaced=88,334',$river);\r
+ \r
+$nav = elgg_view('riverdashboard/nav',array('type' => $type,'subtype' => $subtype,'orient' => $orient));\r
+if(isloggedin()){\r
+ $sidebar = elgg_view("riverdashboard/menu",array('type' => $type,'subtype' => $subtype,'orient' => $orient));\r
+ $sidebar .= elgg_view("riverdashboard/sidebar_options", array("object_type" => 'riverdashboard'));\r
+}else{\r
+ $sidebar = '';\r
+}\r
+set_context('riverdashboard');\r
+if (empty($callback)) {\r
+ $body .= elgg_view('riverdashboard/container', array('body' => $nav . $river . elgg_view('riverdashboard/js')));\r
+ page_draw($title_wording,elgg_view_layout('one_column_with_sidebar',$title . $body, $sidebar));\r
+} else {\r
+ header("Content-type: text/html; charset=UTF-8");\r
+ echo $nav . $river . elgg_view('riverdashboard/js');\r
+}
\ No newline at end of file
-<?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
+<?php\r
+$english = array(\r
+ 'mine' => 'Mine',\r
+ 'filter' => 'Filter',\r
+ 'riverdashboard:useasdashboard' => "Replace the default dashboard with this activity river?",\r
+ 'activity' => 'Activity',\r
+ 'riverdashboard:recentmembers' => 'Recent members',\r
+ \r
+ /**\r
+ * Site messages\r
+ **/\r
+\r
+ 'sitemessages:announcements' => "Site announcements",\r
+ 'sitemessages:posted' => "Posted",\r
+ 'sitemessages:river:created' => "Site admin, %s,",\r
+ 'sitemessages:river:create' => "posted a new site wide message",\r
+ 'sitemessages:add' => "Add a site-wide message to the river page",\r
+ 'sitemessage:deleted' => "Site message deleted",\r
+ \r
+ 'river:widget:noactivity' => 'We could not find any activity.',\r
+ 'river:widget:title' => "Activity",\r
+ 'river:all' => "All activity",\r
+ 'river:mine' => "My activity",\r
+ 'river:friends' => "Friends' activity",\r
+ 'river:widget:description' => "Show your latest activity.",\r
+ 'river:widget:title:friends' => "Friends' activity",\r
+ 'river:widget:description:friends' => "Show what your friends are up to.",\r
+ 'river:widgets:friends' => "Friends",\r
+ 'river:widgets:mine' => "Mine",\r
+ 'river:friends' => "My friends' activity",\r
+ 'river:mine' => "My activity",\r
+ 'river:widget:label:displaynum' => "Number of entries to display:",\r
+ 'river:widget:type' => "Which river would you like to display? One that shows your activity or one that shows your friends activity?",\r
+ 'item:object:sitemessage' => "Site messages",\r
+ 'riverdashboard:avataricon' => "Would you like to use user avatars or icons on your site activity stream?",\r
+ 'option:icon' => 'Icons',\r
+ 'option:avatar' => 'Avatars',\r
+);\r
+ \r
+add_translation("en",$english);
\ No newline at end of file
-<?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>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<plugin_manifest>\r
+ <field key="author" value="Curverider Ltd" />\r
+ <field key="version" value="1.0" />\r
+ <field key="description" value="Elgg river for use with v1.7 onward." />\r
+ <field key="website" value="http://www.elgg.org/" />\r
+ <field key="copyright" value="(C) Curverider 2010" />\r
+ <field key="licence" value="GNU Public License version 2" />\r
+</plugin_manifest>
\ No newline at end of file
-<?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
+<?php\r
+/**\r
+ * Elgg river dashboard plugin\r
+ */\r
+\r
+function riverdashboard_init() {\r
+ global $CONFIG;\r
+ // Register and optionally replace the dashboard\r
+ if (get_plugin_setting('useasdashboard', 'riverdashboard') == 'yes') {\r
+ register_page_handler('dashboard','riverdashboard_page_handler');\r
+ } else {\r
+ // Activity main menu\r
+ if (isloggedin())\r
+ add_menu(elgg_echo('activity'), $CONFIG->wwwroot . "mod/riverdashboard/");\r
+ } \r
+ // Page handler\r
+ register_page_handler('riverdashboard','riverdashboard_page_handler');\r
+ elgg_extend_view('css','riverdashboard/css');\r
+}\r
+ \r
+/**\r
+ * Page handler for riverdash\r
+ *\r
+ * @param unknown_type $page\r
+ */\r
+function riverdashboard_page_handler($page){\r
+ global $CONFIG;\r
+ include(dirname(__FILE__) . "/index.php");\r
+ return true;\r
+}\r
+ \r
+function riverdashboard_dashboard() {\r
+ include(dirname(__FILE__) . '/index.php');\r
+}\r
+\r
+register_elgg_event_handler('init','system','riverdashboard_init');
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Elgg river for dashboard.
+ */
+
+/// Extract the river
+$river = $vars['river'];
+?>
+<div id="river">
+<?php
+if (($river) && (count($river)>0)) {
+ foreach ($river as $r) {
+ echo $r;
+ }
+} else {
+ echo elgg_echo('river:widget:noactivity');
+}
+?>
+</div><!-- /river -->
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ */
+?>
+<div class="river_item_list">
+<?php
+ if (isset($vars['items']) && is_array($vars['items'])) {
+
+ $i = 0;
+ if (!empty($vars['items'])) {
+ foreach($vars['items'] as $item) {
+ echo elgg_view_river_item($item);
+ $i++;
+ if ($i >= $vars['limit']) {
+ break;
+ }
+ }
+ }
+ }
+
+ if ($vars['pagination'] !== false) {
+ $baseurl = $_SERVER['REQUEST_URI'];
+ $baseurl = $baseurl = preg_replace('/[\&\?]offset\=[0-9]*/',"",$baseurl);
+
+ $nav = '';
+
+ if (sizeof($vars['items']) > $vars['limit']) {
+ $newoffset = $vars['offset'] + $vars['limit'];
+ $urladdition = 'offset='.$newoffset;
+ if (substr_count($baseurl,'?')) {
+ $nexturl = $baseurl . '&' . $urladdition;
+ } else {
+ $nexturl=$baseurl . '?' . $urladdition;
+ }
+
+ $nav .= '<a class="back" href="'.$nexturl.'">« ' . elgg_echo('previous') . '</a> ';
+ }
+
+ if ($vars['offset'] > 0) {
+ $newoffset = $vars['offset'] - $vars['limit'];
+ if ($newoffset < 0) {
+ $newoffset = 0;
+ }
+ $urladdition = 'offset='.$newoffset;
+ if (substr_count($baseurl,'?')) {
+ $prevurl=$baseurl . '&' . $urladdition;
+ } else {
+ $prevurl=$baseurl . '?' . $urladdition;
+ }
+
+ $nav .= '<a class="forward" href="'.$prevurl.'">' . elgg_echo('next') . ' »</a> ';
+ }
+
+ if (!empty($nav)) {
+ echo '<div class="river_pagination"><p>'.$nav.'</p><div class="clearfloat"></div></div>';
+ }
+ }
+?>
+</div>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Elgg river item wrapper.
+ * Wraps all river items.
+ */
+
+//set required variables
+$object = get_entity($vars['item']->object_guid);
+//get object url
+$object_url = $object->getURL();
+//user
+//if displaying on the profile get the object owner, else the subject_guid
+if(get_context() == 'profile' && $object->getSubtype() == 'thewire')
+ $user = get_entity($object->owner_guid);
+else
+ $user = get_entity($vars['item']->subject_guid);
+
+//get the right annotation type
+//*todo - use the same for comments, everywhere e.g. comment
+switch($vars['item']->subtype){
+ case 'thewire':
+ $annotation_comment = 'wire_reply';
+ break;
+ default:
+ $annotation_comment = 'generic_comment';
+ break;
+}
+
+//count comment annotations
+$comment_count = count_annotations($vars['item']->object_guid, $vars['item']->type, $vars['item']->subtype, $annotation_comment);
+
+//count like annotations
+$likes = count_annotations($vars['item']->object_guid, $vars['item']->type, $vars['item']->subtype, "likes");
+
+//get last two comments display
+$get_comments = get_annotations($vars['item']->object_guid, "", "", $annotation_comment, "", "", 3, 0, "desc");
+
+if($get_comments){
+ //reverse the array so we can display comments in the right order
+ $get_comments = array_reverse($get_comments);
+}
+
+//minus two off the comment total as we display two by default
+if($comment_count < 3)
+ $num_comments = 0;
+else
+ $num_comments = $comment_count - 3;
+?>
+<div class="river_item">
+ <!-- avatar -->
+ <span class="river_item_useravatar" style="float:left;margin:0 10px 10px 0;">
+ <?php
+ echo elgg_view("profile/icon",array('entity' => $user, 'size' => 'small'));
+ ?>
+ </span>
+ <!-- body contents, generated by the river view in each plugin -->
+ <?php
+ echo $vars['body'];
+ ?>
+ <div class="clearfloat"></div>
+ <!-- display comments and likes if on the dashboard/live feed -->
+ <div class="river_item_annotation">
+ <?php
+ //display the number of comments and likes if there are any
+ if($num_comments != 0){
+ echo "<div class='river_more_comments'><span class='more_comments'>";
+ //set the correct context comment or comments
+ if($num_comments == 1)
+ echo "<a href=\"{$object_url}\">+{$num_comments} more comment</a>";
+ else
+ echo "<a href=\"{$object_url}\">+{$num_comments} more comments</a>";
+
+ echo "</span></div>";
+ }
+ //display latest 2 comments if there are any
+ if($get_comments){
+ $counter = 0;
+ $background = "";
+ echo "<div class='river_comments'>";
+ foreach($get_comments as $gc){
+ //get the comment owner
+ $comment_owner = get_user($gc->owner_guid);
+ //get the comment owner's profile url
+ $comment_owner_url = $comment_owner->getURL();
+ // color-code each of the 3 comments
+ if( ($counter == 2 && $comment_count >= 4) || ($counter == 1 && $comment_count == 2) || ($counter == 0 && $comment_count == 1) || ($counter == 2 && $comment_count == 3) )
+ $alt = 'latest';
+ else if( ($counter == 1 && $comment_count >= 4) || ($counter == 0 && $comment_count == 2) || ($counter == 1 && $comment_count == 3) )
+ $alt = 'penultimate';
+
+ //display comment
+ echo "<div class='river_comment {$alt}'>";
+ echo "<div class='river_comment_owner_icon'>";
+ echo elgg_view("profile/icon",array('entity' => $comment_owner, 'size' => 'tiny'));
+ echo "</div>";
+ //truncate comment to 150 characters
+ if(strlen($gc->value) > 150) {
+ $gc->value = substr($gc->value, 0, strpos($gc->value, ' ', 150)) . "...";
+ }
+ $contents = strip_tags($gc->value);
+ echo "<div class='comment_wrapper'>";
+ echo "<a href=\"{$comment_owner_url}\">" . $comment_owner->name . "</a> " . parse_urls($contents);
+ echo "<br /><span class='river_item_time'>" . friendly_time($gc->time_created) . "</span>";
+ echo "<div class=\"clearfloat\"></div>";
+ echo "</div></div>";
+ $counter++;
+ }
+ echo "</div>";
+ }
+ //display the comment link
+ if($vars['item']->type != 'user'){
+ //for now don't display the comment link on bookmarks and wire messages
+ if($vars['item']->subtype != 'thewire' && $vars['item']->subtype != 'bookmarks' && $vars['item']->subtype != '')
+ echo "<span class='comment_link'><a href=\"{$object_url}\">Comment</a></span>";
+ }
+ ?>
+ </div>
+ <div class="clearfloat"></div>
+</div>
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Elgg relationship create event.
+ * Display something in the river when a relationship is created.
+ */
+
+$statement = $vars['statement'];
+
+$performed_by = $statement->getSubject();
+$event = $statement->getEvent();
+$object = $statement->getObject();
+
+if (is_array($object)) {
+ switch ($object['relationship']) {
+ // Friending
+ case 'friend' :
+ case 'friends' : // 'friends' shouldn't be used, but just incase :)
+
+ // Get second object
+ $userb = $object['object'];
+
+ // Only users can be friends
+ if (($performed_by instanceof ElggUser) && ($userb instanceof ElggUser)) {
+ // User A
+ echo "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a> ";
+
+ // Verb
+ echo elgg_echo('river:relationship:friend');
+
+ // user B
+ echo " <a href=\"{$userb->getURL()}\">{$userb->name}</a>";
+ }
+
+ break;
+ }
+}
\ No newline at end of file
+++ /dev/null
-<?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
-<?php
-
-?>
-
-<div id="river_container"><?php echo $vars['body']; ?></div>
\ No newline at end of file
+<div id="river_container"><?php echo $vars['body']; ?></div><!-- /river_container -->\r
+\r
+<script type="text/JavaScript">\r
+$(document).ready(function(){\r
+ var updates = new thewireUpdateChecker(10000);\r
+ updates.start();\r
+});\r
+\r
+// check for updates on the wire.\r
+function thewireUpdateChecker(interval) {\r
+ this.intervalID = null;\r
+ this.interval = interval;\r
+ this.url = '<?php echo $vars['url']; ?>mod/riverdashboard/endpoint/ping.php';\r
+ this.seconds_passed = 0;\r
+ \r
+ this.start = function() {\r
+ // needed to complete closure scope.\r
+ var self = this;\r
+ \r
+ this.intervalID = setInterval(function() { self.checkUpdates(); }, this.interval);\r
+ }\r
+\r
+ this.checkUpdates = function() {\r
+ this.seconds_passed += this.interval / 1000;\r
+ // more closure fun\r
+ var self = this;\r
+ $.ajax({\r
+ 'type': 'GET',\r
+ 'url': this.url,\r
+ 'data': {'seconds_passed': this.seconds_passed},\r
+ 'success': function(data) {\r
+ if (data) {\r
+ $('#the-wire-updates-notice').html(data).slideDown();\r
+ // could crank down the interval here.\r
+ // if we change the message to simply "New Posts!" \r
+ // we could stop the polling altogether.\r
+ }\r
+ }\r
+ })\r
+ }\r
+\r
+ this.stop = function() {\r
+ clearInterval(this.interval);\r
+ }\r
+\r
+ this.changeInterval = function(interval) {\r
+ this.stop();\r
+ this.interval = interval;\r
+ this.start();\r
+ }\r
+}\r
+</script>\r
/**
* 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;
+ float:right;
}
.river_pagination .forward,
*: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;
+ font-size:1.0em;
}
+.collapsable_box_content .ContentWrapper.ActivityWidget {
+
+}
+
.river_content img {
margin:2px 0 2px 20px;
}
+.river_content_title {
+ margin-left:55px;
+
+}
+.river_content_title a {
+ font-weight: bold;
+ /* color:#333333; */
+}
+
.river_content_display {
- border-left:1px solid #ddd;
- padding:2px 10px 0 10px;
+ border-left:1px solid #DDDDDD;
font-size:90%;
- margin:4px 0 2px 30px;
+ margin:8px 0 6px 55px;
+ padding-left:5px;
}
.river_content_display p {
.following_icon {
width:20px;
- height:40px;
+ height:25px;
margin:0 2px 0 2px;
- background: url(<?php echo $vars['url']; ?>mod/riverdashboard/graphics/follow_icon.png) no-repeat left top;
+ background: url(<?php echo $vars['url']; ?>mod/riverdashboard/graphics/follow_icon.png) no-repeat left -7px;
}
.river_content_display div.usericon a.icon img {
- width:40px;
- height:40px;
+ width:25px;
+ height:25px;
+}
+
+
+/* ***************************************
+ ACTIVITY RIVER
+*************************************** */
+.river_item_list {
+ border-top:1px solid #cccccc;
+}
+.river_item p {
+ margin:0;
+}
+.river_item {
+ border-bottom:1px solid #cccccc;
+ padding:7px 0 10px 0;
+/*
+ margin-top:5px;
+ margin-bottom:5px;
+*/
}
+.river_item_annotation {
+
+}
+span.more_comments {
+
+}
+.river_more_comments {
+ display:block;
+ float:right;
+ padding:2px 4px 7px 30px;
+ text-align:right;
+ width:auto;
+}
+.river_comments {
+ margin:5px 0 0 55px;
+ width:auto;
+}
+.comment_wrapper {
+ margin-left:34px;
+}
+.comment_link {
+ margin-left:55px;
+}
+
+.river_comment_owner_icon {
+ float:left;
+ margin:0 8px 4px 2px;
+}
+
+.river_comment {
+ background-color: #f8f8f8;
+ padding:3px;
+ margin-bottom:3px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+}
+.river_comment.penultimate {
+ background-color: #eeeeee;
+}
+.river_comment.latest {
+ background-color: #dedede;
+ margin-bottom:0;
+}
+
+.river_item_time {
+ font-size:90%;
+ color:#666666;
+}
+.river_item .river_item_useravatar {
+ float:left;
+ margin:3px 0 0 1px;
+}
+/* IE6 fix */
+* html .river_item p {
+ /* padding:3px 0 3px 20px; */
+}
+/* IE7 */
+*:first-child+html .river_item p {
+ /* min-height:17px; */
+}
+
+/* .river_object_blog_update, */
+
+.river_object_blog_create,
+.river_object_page_create,
+.river_object_page_update {
+ float:left;
+ width:26px;
+ height:32px;
+ border:none;
+ background-color: transparent;
+ margin-right:6px;
+ margin-top:2px;
+}
+.river_object_blog_create {
+ background-image: url(<?php echo $vars['url']; ?>mod/riverdashboard/graphics/icon_activity_blogs.png);
+ background-position: left top;
+ background-repeat: no-repeat;
+}
+.river_object_page_create,
+.river_object_page_update {
+ background-image: url(<?php echo $vars['url']; ?>mod/riverdashboard/graphics/icon_activity_pages.png);
+ background-position: left top;
+ background-repeat: no-repeat;
+}
+
+
+.collapsable_box_content .river_user_update {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_profile.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_user_profileupdate {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_profile.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_user_profileiconupdate {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_profile.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_annotate {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_bookmarks_create {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_bookmarks.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_bookmarks_comment {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_status_create {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_status.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_file_create {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_files.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_file_update {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_files.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_file_comment {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_widget_create {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_plugin.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_forums_create {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_forums_update {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_widget_update {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_plugin.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_blog_create {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_blog.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_blog_update {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_blog.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_blog_comment {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_forumtopic_create {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_user_friend {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_friends.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_relationship_friend_create {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_friends.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_relationship_member_create {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_thewire_create {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_thewire.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_group_join {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_groupforumtopic_annotate {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_groupforumtopic_create {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_sitemessage_create {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_blog.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_user_messageboard {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_page_create {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_page_update {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_page_top_create {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_page_top_update {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_page_top_comment {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
+}
+.collapsable_box_content .river_object_page_comment {
+ background: url(<?php echo $vars['url']; ?>_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px;
+}
+
--- /dev/null
+<?php\r
+/**\r
+ * Elgg activity stream menu\r
+ */\r
+$allselect = ''; $friendsselect = ''; $mineselect = ''; $display_option = '';\r
+switch($vars['orient']) {\r
+ case 'all': $allselect = 'class="selected"';\r
+ break;\r
+ case 'friends': $friendsselect = 'class="selected"';\r
+ $display_option = '&display=friends';\r
+ break;\r
+ case 'mine': $mineselect = 'class="selected"';\r
+ $display_option = '&display=mine';\r
+ break;\r
+}\r
+?>\r
+<div id="Submenu"><ul>\r
+<?php\r
+ if(isloggedin()){\r
+?>\r
+ <li <?php echo $allselect; ?> ><a href="<?php echo $vars['url']; ?>mod/riverdashboard/"><?php echo elgg_echo('all'); ?></a></li>\r
+ <li <?php echo $friendsselect; ?> ><a href="<?php echo $vars['url']; ?>mod/riverdashboard/?display=friends"><?php echo elgg_echo('friends'); ?></a></li>\r
+ <li <?php echo $mineselect; ?> ><a href="<?php echo $vars['url']; ?>mod/riverdashboard/?display=mine"><?php echo elgg_echo('mine'); ?></a></li>\r
+\r
+<?php\r
+ }\r
+?>\r
+</ul></div>
\ No newline at end of file
-<?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']; ?>&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&content=<?php echo $vars['type']; ?>,<?php echo $vars['subtype']; ?>&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&content=<?php echo $vars['type']; ?>,<?php echo $vars['subtype']; ?>&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&display='+$('input#display').val() + '&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> -->
+<?php\r
+\r
+$contents = array();\r
+$contents['all'] = 'all';\r
+if (!empty($vars['config']->registered_entities)) {\r
+ foreach ($vars['config']->registered_entities as $type => $ar) {\r
+ foreach ($vars['config']->registered_entities[$type] as $object) {\r
+ if($object != 'helppage'){\r
+ if (!empty($object )) {\r
+ $keyname = 'item:'.$type.':'.$object;\r
+ } else $keyname = 'item:'.$type; \r
+ $contents[$keyname] = "{$type},{$object}";\r
+ }\r
+ }\r
+ }\r
+}\r
+ \r
+$allselect = ''; $friendsselect = ''; $mineselect = ''; $display_option = '';\r
+switch($vars['orient']) {\r
+ case '': $allselect = 'class="selected"';\r
+ break;\r
+ case 'friends': $friendsselect = 'class="selected"';\r
+ $display_option = '&display=friends';\r
+ break;\r
+ case 'mine': $mineselect = 'class="selected"';\r
+ $display_option = '&display=mine';\r
+ break;\r
+}\r
+?>\r
+<div class="ContentWrapper">\r
+ <div class="riverdashboard_filtermenu"> \r
+ <?php\r
+ $location_filter = "<select onchange=\"window.open(this.options[this.selectedIndex].value,'_top')\" name=\"file_filter\" class='Notstyled' >";\r
+ $current = get_input('subtype');\r
+ foreach($contents as $label => $content) {\r
+ $get_values = explode(",", $content);\r
+ //select the current filter\r
+ if($get_values[1] == $current)\r
+ $selected = "SELECTED";\r
+ //set the drop down filter\r
+ if($content[0] && $content[1])\r
+ $location_filter .= "<option {$selected} class='Nomenuoption' value=\"{$CONFIG->url}mod/riverdashboard/index.php?type={$get_values[0]}&subtype={$get_values[1]}{$display_option}\" >" . elgg_echo($label) . "</option>"; \r
+ //reset selected\r
+ $selected = '';\r
+ }\r
+ $location_filter .= "</select>";\r
+ echo $location_filter;\r
+ ?>\r
+ <input type="hidden" name="display" id="display" value="<?php echo htmlentities($vars['orient']); ?>" />\r
+ </div>\r
+<!-- </div> don't close ContentWrapper here, it happens later -->\r
+\r
+<div id="the-wire-updates-notice" class="ContentWrapper clearfloat"></div>\r
-<?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>
+<?php\r
+\r
+ /**\r
+ * Elgg thewire view page\r
+ */\r
+ \r
+?>\r
+<div id="content_area_user_title">\r
+<h2><?php echo sprintf(elgg_echo('welcome:user'), $_SESSION['user']->name); ?></h2>\r
</div>
\ No newline at end of file
<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
+++ /dev/null
-<?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
+++ /dev/null
-<?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