aboutsummaryrefslogtreecommitdiff
path: root/mod/riverdashboard/views
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-24 15:40:47 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-05-24 15:40:47 +0000
commit65c5ba06227db6c4847fbe17a1ac35a52ed40b02 (patch)
treed9bbfa236e8e9481eb464d70c316052c89a79044 /mod/riverdashboard/views
parentf56c4ae4c881345e0a11d1f24a2e6a06668fb0ca (diff)
downloadelgg-65c5ba06227db6c4847fbe17a1ac35a52ed40b02.tar.gz
elgg-65c5ba06227db6c4847fbe17a1ac35a52ed40b02.tar.bz2
The activity stream's count uses the river table instead of trying to combine entities + annotations based up on time_created.
Also brought small bits of code up to standards. git-svn-id: http://code.elgg.org/elgg/trunk@6173 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/riverdashboard/views')
-rw-r--r--mod/riverdashboard/views/default/river/item/list.php2
-rw-r--r--mod/riverdashboard/views/default/river/item/wrapper.php24
-rw-r--r--mod/riverdashboard/views/default/riverdashboard/container.php10
-rw-r--r--mod/riverdashboard/views/default/riverdashboard/js.php15
4 files changed, 25 insertions, 26 deletions
diff --git a/mod/riverdashboard/views/default/river/item/list.php b/mod/riverdashboard/views/default/river/item/list.php
index 4c3e240ac..bddb2f5e4 100644
--- a/mod/riverdashboard/views/default/river/item/list.php
+++ b/mod/riverdashboard/views/default/river/item/list.php
@@ -16,7 +16,7 @@ if (isset($vars['items']) && is_array($vars['items'])) {
if ($vars['pagination'] !== false) {
$baseurl = $_SERVER['REQUEST_URI'];
- $baseurl = $baseurl = preg_replace('/[\&\?]offset\=[0-9]*/',"",$baseurl);
+ $baseurl = preg_replace('/[\&\?]offset\=[0-9]*/',"",$baseurl);
$nav = '';
diff --git a/mod/riverdashboard/views/default/river/item/wrapper.php b/mod/riverdashboard/views/default/river/item/wrapper.php
index 8506262a8..b90b00f99 100644
--- a/mod/riverdashboard/views/default/river/item/wrapper.php
+++ b/mod/riverdashboard/views/default/river/item/wrapper.php
@@ -41,31 +41,31 @@ if ($comment_count < 3) {
<?php echo elgg_view("profile/icon",array('entity' => $user, 'size' => 'small')); ?>
</span>
<div class="river_item_contents clearfloat">
- <?php
+ <?php
// body contents, generated by the river view in each plugin
- echo $vars['body'];
-
+ echo $vars['body'];
+
//display latest 3 comments if there are any
if ($get_comments){
$counter = 0;
//$background = "";
-
+
echo "<div class='river_comments_tabs clearfloat'>";
-
+
if ($comment_count <= 3) {
echo "<a class='river_more_comments show_comments_button link'>Comments</a>";
}
-
+
//display 'more comments' if there are any
if ($num_comments != 0) {
echo "<a class='river_more_comments show_comments_button link'>Comments (+{$num_comments} more)</a>";
}
-
+
if ($numoflikes != 0) {
echo elgg_view('likes/forms/display', array('entity' => $object));
}
echo "</div>"; // close river_comments_tabs
-
+
echo "<div class='river_comments'>";
if ($numoflikes != 0) {
@@ -74,7 +74,7 @@ if ($get_comments){
echo list_annotations($object->getGUID(), 'likes', 99);
echo "</div>";
}
-
+
foreach ($get_comments as $gc) {
//get the comment owner
$comment_owner = get_user($gc->owner_guid);
@@ -107,7 +107,7 @@ if ($get_comments){
} else {
// tab bar nav - for users that liked object
$numoflikes = elgg_count_likes($object);
-
+
if ($vars['item']->type != 'user' && $numoflikes != 0) {
echo "<div class='river_comments_tabs clearfloat'>";
}
@@ -117,7 +117,7 @@ if ($get_comments){
if ($vars['item']->type != 'user' && $numoflikes != 0) {
echo "</div>"; // close river_comments_tabs
}
-
+
if ($vars['item']->type != 'user') {
echo "<div class='river_comments'>";
}
@@ -127,7 +127,7 @@ if ($get_comments){
echo list_annotations($object->getGUID(), 'likes', 99);
echo "</div>";
}
-
+
// if there are no comments to display
// and this is not a user or a group discussion entry - include the inline comment form
if ($vars['item']->type != 'user' && $vars['item']->subtype != 'groupforumtopic') {
diff --git a/mod/riverdashboard/views/default/riverdashboard/container.php b/mod/riverdashboard/views/default/riverdashboard/container.php
index 7d72453d1..c7123a722 100644
--- a/mod/riverdashboard/views/default/riverdashboard/container.php
+++ b/mod/riverdashboard/views/default/riverdashboard/container.php
@@ -2,21 +2,21 @@
<script type="text/javascript">
$(document).ready(function(){
- var updates = new thewireUpdateChecker(10000);
+ var updates = new activityUpdateChecker(10000);
updates.start();
});
// check for updates on the wire.
-function thewireUpdateChecker(interval) {
+function activityUpdateChecker(interval) {
this.intervalID = null;
this.interval = interval;
this.url = '<?php echo $vars['url']; ?>mod/riverdashboard/endpoint/ping.php';
this.seconds_passed = 0;
-
+
this.start = function() {
// needed to complete closure scope.
var self = this;
-
+
this.intervalID = setInterval(function() { self.checkUpdates(); }, this.interval);
}
@@ -32,7 +32,7 @@ function thewireUpdateChecker(interval) {
if (data) {
$('#riverdashboard_updates').html(data).slideDown();
// could crank down the interval here.
- // if we change the message to simply "New Posts!"
+ // if we change the message to simply "New Posts!"
// we could stop the polling altogether.
}
}
diff --git a/mod/riverdashboard/views/default/riverdashboard/js.php b/mod/riverdashboard/views/default/riverdashboard/js.php
index b1bace04a..1e97a510a 100644
--- a/mod/riverdashboard/views/default/riverdashboard/js.php
+++ b/mod/riverdashboard/views/default/riverdashboard/js.php
@@ -1,9 +1,9 @@
<script type="text/javascript">
$(document).ready(function() {
$('.river_comment_form_button').click(function() {
- elgg_slide_toggle(this,'.river_item','.river_comment_form');
+ elgg_slide_toggle(this, '.river_item', '.river_comment_form');
});
-
+
$('.likes_user_list_button').click(function() {
var myParent = $(this).closest('.river_item');
if (myParent.find('.likes_list').css('display') == 'none') {
@@ -13,11 +13,10 @@
myParent.find('.show_comments_button').addClass('off');
myParent.find('.likes_user_list_button').removeClass('off');
// show users that liked object
- elgg_slide_toggle(this,'.river_item','.likes_list');
+ elgg_slide_toggle(this, '.river_item', '.likes_list');
}
});
-
-
+
$('.show_comments_button').click(function() {
var myParent = $(this).closest('.river_item');
if (myParent.find('.river_comment').css('display') == 'none') {
@@ -27,9 +26,9 @@
myParent.find('.show_comments_button').removeClass('off');
myParent.find('.likes_user_list_button').addClass('off');
// show users that liked object
- elgg_slide_toggle(this,'.river_item','.river_comment');
+ elgg_slide_toggle(this, '.river_item', '.river_comment');
}
- });
-
+ });
+
});
</script> \ No newline at end of file