]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
attempting to standardize riverdashboard plugin in similar manner as 1.7 branch revis...
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 13 May 2010 01:42:18 +0000 (01:42 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Thu, 13 May 2010 01:42:18 +0000 (01:42 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@6021 36083f99-b078-4883-b0ff-0f9b5a30f544

16 files changed:
mod/riverdashboard/actions/add.php
mod/riverdashboard/actions/delete.php
mod/riverdashboard/endpoint/ping.php
mod/riverdashboard/index.php
mod/riverdashboard/languages/en.php
mod/riverdashboard/start.php
mod/riverdashboard/views/default/river/item/list.php
mod/riverdashboard/views/default/river/item/wrapper.php
mod/riverdashboard/views/default/river/item/wrapper_classic.php
mod/riverdashboard/views/default/riverdashboard/container.php
mod/riverdashboard/views/default/riverdashboard/ecml/activity.php
mod/riverdashboard/views/default/riverdashboard/menu.php
mod/riverdashboard/views/default/riverdashboard/nav.php
mod/riverdashboard/views/default/riverdashboard/sitemessage.php
mod/riverdashboard/views/default/riverdashboard/welcome.php
mod/riverdashboard/views/default/settings/riverdashboard/edit.php

index fc98664ae1cf56380c6c98fd08c1f4bc593ae96d..144476728f1f6b1ee7b6ee759c9b90c166b69d4a 100644 (file)
@@ -1,56 +1,53 @@
 <?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/");
-                       
+/**
+ * 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 {
-                       
+} else {
+
        // Initialise a new ElggObject
-                       $sitemessage = new ElggObject();
+       $sitemessage = new ElggObject();
        // Tell the system it's a site wide message
-                       $sitemessage->subtype = "sitemessage";
+       $sitemessage->subtype = "sitemessage";
        // Set its owner to the current user
-                       $sitemessage->owner_guid = $_SESSION['user']->getGUID();
+       $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
+       $sitemessage->access_id = 1; // this is for all logged in users
        // Set description appropriately
-                       $sitemessage->title = '';
-                       $sitemessage->description = $message;
+       $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/");
-                       }
+       if (!$sitemessage->save()) {
+               register_error(elgg_echo("sitemessage:error"));
+               forward("mod/riverdashboard/");
+       }
        // Success message
-                       system_message(elgg_echo("sitemessages:posted"));
+       system_message(elgg_echo("sitemessages:posted"));
 
        // add to river
-               add_to_river('river/sitemessage/create','create',$_SESSION['user']->guid,$sitemessage->guid);
+       add_to_river('river/sitemessage/create','create',$_SESSION['user']->guid,$sitemessage->guid);
 
        // Forward to the activity page
-                       forward("mod/riverdashboard/");
-                               
-               }
+       forward("mod/riverdashboard/");
 
-               
-?>
+}
index db9196f0184e10b79083df6b0ef9733944338635..4ef62e69dc47d3c9e4236b9ffb68a486360bfa07 100644 (file)
@@ -1,36 +1,35 @@
 <?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/
       */
+/**
+ * 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();
+// 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) {
+// 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
+               system_message(elgg_echo("sitemessage:deleted"));
+       } else {
+               register_error(elgg_echo("sitemessage:notdeleted"));
+       }
+       // Forward to the river
+       forward("mod/riverdashboard/");
+
+}
+
index d41128e1fad0746bdb2da44bd57be02e6f011c4e..ef30475d9810aa5913ad1788d6069a3df20ebc65 100644 (file)
@@ -17,24 +17,30 @@ $last_reload = time() - $seconds_passed;
 
 //grab any new annotations
 $annotations = count_annotations('', '', '', '', '', '', '', $last_reload);
-if(!$annotations)
+if (!$annotations) {
        $annotations = 0;
+}
+
 //grab all new objects created 
 $entity_creation = elgg_get_entities(array(
        'count' => TRUE, 
        'created_time_lower' => $last_reload,
        'wheres' => array('e.type != \'user\'')
 ));
-if(!$entity_creation)
+
+if (!$entity_creation) {
        $entity_creation = 0;
+}
+
 //grab any entities updated
 $entity_update = elgg_get_entities(array(
        'count' => TRUE, 
        'modified_time_lower' => $last_reload,
        'wheres' => array('e.type != \'user\'')
 ));
-if(!$entity_update)
+if (!$entity_update) {
        $entity_update = 0;
+}
 //get any relationships, such as friending - this is not working quite right yet
 //$relationship_action = elgg_get_entities_from_relationship(array('count' => TRUE));
 //if(!$relationship_action)
index 3718452134d2702dddff873dd1be0ddd42eda6e3..2eb659e769c89513345556454688aca678328e55 100644 (file)
@@ -11,8 +11,9 @@ gatekeeper();
 $type = get_input('type');
 $subtype = get_input('subtype');
 $orient = get_input('display');
-if(!$orient)
+if(!$orient) {
        $orient = 'all';
+}
 $callback = get_input('callback');
 
 if ($type == 'all') {
@@ -24,37 +25,40 @@ $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;
+               $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);
 
 //select the correct river
-if (get_plugin_setting('activitytype', 'riverdashboard') == 'classic')
+if (get_plugin_setting('activitytype', 'riverdashboard') == 'classic') {
        $river = elgg_view_river_items($subject_guid, 0, $relationship_type, $type, $subtype, '', 20, 0, 0, true, true)  . "</div>";
-else
+} else {
        $river = elgg_view_river_items($subject_guid, 0, $relationship_type, $type, $subtype, '', 20, 0, 0, true, false)  . "</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(isloggedin()){
+if (isloggedin()) {
        $sidebar = elgg_view("riverdashboard/menu",array('type' => $type,'subtype' => $subtype,'orient' => $orient));
        $sidebar .= elgg_view("riverdashboard/sidebar", array("object_type" => 'riverdashboard'));
-}else{
+} else {
        $sidebar = '';
 }
 set_context('riverdashboard');
index 558ac7e5d06ccc6133fba222ef2bda13ea1d0d4c..d0ab70e5926becb8de0ec57635ba17476ee70ba9 100644 (file)
@@ -8,7 +8,7 @@ $english = array(
 
        /**
         * Site messages
-                **/
+        **/
 
        'sitemessages:announcements' => "Site announcements",
        'sitemessages:posted' => "Posted",
@@ -44,4 +44,4 @@ $english = array(
        'riverdashboard:ecml:desc:usage' => '[activity user=username limit=limit type=type subtype=subtype]'
 );
 
-add_translation("en",$english);
\ No newline at end of file
+add_translation("en", $english);
\ No newline at end of file
index 9f64f4c9d042017ea5cee4c2275109b07fb9cedb..e30681f75c4aed1bc5cdecf5db404fd0be8bc7a2 100644 (file)
@@ -8,12 +8,12 @@
 function riverdashboard_init() {
        global $CONFIG;
        // Register and optionally replace the dashboard
-       register_page_handler('dashboard','riverdashboard_page_handler');
+       register_page_handler('dashboard', 'riverdashboard_page_handler');
        add_menu(elgg_echo('activity'), $CONFIG->wwwroot . "mod/riverdashboard/");
 
        // Page handler
-       register_page_handler('riverdashboard','riverdashboard_page_handler');
-       elgg_extend_view('css','riverdashboard/css');
+       register_page_handler('riverdashboard', 'riverdashboard_page_handler');
+       elgg_extend_view('css', 'riverdashboard/css');
 
        // add an activity stream ECML keyword
        // we'll restrict it to use in sitepages's custom_frontpage
@@ -41,7 +41,7 @@ function elgg_make_river_comment($entity){
                return false;
        } else {
                //display the comment form
-               $comments = elgg_view('riverdashboard/rivercomment',array('entity' => $entity));
+               $comments = elgg_view('riverdashboard/rivercomment', array('entity' => $entity));
                return $comments;
        }
 }
index e7e1a9c07e023efe4c59aa1b8d8d514d117fdd86..4c3e240ac6393f8fa2aed825072ac94e08df9760 100644 (file)
@@ -1,54 +1,53 @@
 <?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 (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);
+if ($vars['pagination'] !== false) {
+       $baseurl = $_SERVER['REQUEST_URI'];
+       $baseurl = $baseurl = preg_replace('/[\&\?]offset\=[0-9]*/',"",$baseurl);
 
-               $nav = '';
+       $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="pagination_previous" href="'.$nexturl.'">&laquo; ' . elgg_echo('previous') . '</a> ';
+       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;
                }
 
-               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="pagination_previous" href="'.$nexturl.'">&laquo; ' . elgg_echo('previous') . '</a> ';
+       }
 
-                       $nav .= '<a class="pagination_next" href="'.$prevurl.'">' . elgg_echo('next') . ' &raquo;</a> ';
+       if ($vars['offset'] > 0) {
+               $newoffset = $vars['offset'] - $vars['limit'];
+               if ($newoffset < 0) {
+                       $newoffset = 0;
                }
-
-               if (!empty($nav)) {
-                       echo '<div class="pagination clearfloat">'.$nav.'</div>';
+               $urladdition = 'offset='.$newoffset;
+               if (substr_count($baseurl,'?')) {
+                       $prevurl=$baseurl . '&' . $urladdition;
+               } else {
+                       $prevurl=$baseurl . '?' . $urladdition;
                }
+
+               $nav .= '<a class="pagination_next" href="'.$prevurl.'">' . elgg_echo('next') . ' &raquo;</a> ';
+       }
+
+       if (!empty($nav)) {
+               echo '<div class="pagination clearfloat">'.$nav.'</div>';
        }
-?>
\ No newline at end of file
+}
index 7a3285382f5bd1c1d8e528a70b5c9e40c1942053..8506262a8bd68bb385ab9482ac9565540aab12c0 100644 (file)
@@ -12,10 +12,11 @@ $numoflikes = elgg_count_likes($object);
 
 //user
 //if displaying on the profile get the object owner, else the subject_guid
-if(get_context() == 'profile' && $object->getSubtype() ==  'thewire')
+if (get_context() == 'profile' && $object->getSubtype() ==  'thewire') {
        $user = get_entity($object->owner_guid);
-else
+} else {
        $user = get_entity($vars['item']->subject_guid);
+}
 
 //count comment annotations
 $comment_count = count_annotations($vars['item']->object_guid, $vars['item']->type, $vars['item']->subtype, $annotation_comment);
@@ -23,16 +24,17 @@ $comment_count = count_annotations($vars['item']->object_guid, $vars['item']->ty
 //get last three comments display
 $get_comments = get_annotations($vars['item']->object_guid, "", "", 'generic_comment', "", "", 3, 0, "desc");
 
-if($get_comments){
+if ($get_comments){
        //reverse the array so we can display comments in the right order
-       $get_comments = array_reverse($get_comments);   
+       $get_comments = array_reverse($get_comments);
 }
 
 //minus 3 off the comment total as we display 3 by default
-if($comment_count < 3)
+if ($comment_count < 3) {
        $num_comments = 0;
-else
+} else {
        $num_comments = $comment_count - 3;
+}
 ?>
 <div class="river_item riverdashboard">
        <span class="river_item_useravatar">
@@ -43,98 +45,98 @@ else
                // body contents, generated by the river view in each plugin
                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'>";
+//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){
-                       //show the users who liked the object
-                       echo "<div class='likes_list hidden'>";
-                       echo list_annotations($object->getGUID(), 'likes', 99);
-                       echo "</div>";
-               }
+       if ($numoflikes != 0) {
+               //show the users who liked the object
+               echo "<div class='likes_list hidden'>";
+               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);
-                       //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) )
+       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} clearfloat'>";
-                       echo "<span class='river_comment_owner_icon'>";
-                       echo elgg_view("profile/icon",array('entity' => $comment_owner, 'size' => 'tiny'));
-                       echo "</span>";
-                       //truncate comment to 150 characters
-                       if(strlen($gc->value) > 150) {
-                               $gc->value = substr($gc->value, 0, strpos($gc->value, ' ', 150)) . "&hellip;";
-                   }
-                       $contents = strip_tags($gc->value);
-                   echo "<div class='river_comment_contents'>";
-                       echo "<a href=\"{$comment_owner_url}\">" . $comment_owner->name . "</a> " . parse_urls($contents);
-                       echo "<span class='entity_subtext'>" . friendly_time($gc->time_created) . "</span>";
-                       echo "</div></div>";
-                       $counter++;
                }
-                       echo elgg_make_river_comment($object);
-                       echo "</div>"; // close river_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'>";
-               }
-               if($numoflikes != 0){
-                       echo elgg_view('likes/forms/display', array('entity' => $object));
-               }
-               if ($vars['item']->type != 'user' && $numoflikes != 0) {        
-                       echo "</div>"; // close river_comments_tabs
-               }
-                       
-               if ($vars['item']->type != 'user') {
-                       echo "<div class='river_comments'>";
-               }
-               if($numoflikes != 0){
-                       //show the users who liked the object
-                       echo "<div class='likes_list hidden'>";
-                       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') {
-                       echo elgg_make_river_comment($object);
-               }
-               if ($vars['item']->type != 'user') {
-                       echo "</div>";
+               //display comment
+               echo "<div class='river_comment {$alt} clearfloat'>";
+               echo "<span class='river_comment_owner_icon'>";
+               echo elgg_view("profile/icon", array('entity' => $comment_owner, 'size' => 'tiny'));
+               echo "</span>";
+               //truncate comment to 150 characters
+               if (strlen($gc->value) > 150) {
+                       $gc->value = substr($gc->value, 0, strpos($gc->value, ' ', 150)) . "&hellip;";
                }
+               $contents = strip_tags($gc->value);
+               echo "<div class='river_comment_contents'>";
+               echo "<a href=\"{$comment_owner_url}\">" . $comment_owner->name . "</a> " . parse_urls($contents);
+               echo "<span class='entity_subtext'>" . friendly_time($gc->time_created) . "</span>";
+               echo "</div></div>";
+               $counter++;
+       }
+       echo elgg_make_river_comment($object);
+       echo "</div>"; // close river_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'>";
+       }
+       if ($numoflikes != 0) {
+               echo elgg_view('likes/forms/display', array('entity' => $object));
        }
+       if ($vars['item']->type != 'user' && $numoflikes != 0) {
+               echo "</div>"; // close river_comments_tabs
+       }
+       
+       if ($vars['item']->type != 'user') {
+               echo "<div class='river_comments'>";
+       }
+       if ($numoflikes != 0) {
+               //show the users who liked the object
+               echo "<div class='likes_list hidden'>";
+               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') {
+               echo elgg_make_river_comment($object);
+       }
+       if ($vars['item']->type != 'user') {
+               echo "</div>";
+       }
+}
 echo "</div>"; // close river_item_contents
 ?>
 </div>
\ No newline at end of file
index abbed46d60833f9eee819f90772b88952d5ca682..0a3c1da8f647461170b5bb290b98e37828a5a3f8 100644 (file)
@@ -9,14 +9,14 @@
  */\r
 ?>\r
 <div class="river_item riverdashboard">\r
-               <span class="river_item_useravatar">\r
-                       <?php\r
-                               echo elgg_view("profile/icon",array('entity' => get_entity($vars['item']->subject_guid), 'size' => 'small'));\r
-                       ?>\r
-               </span>\r
-               <div class="river_item_contents clearfloat">\r
-                       <?php\r
-                               echo $vars['body'];\r
-                       ?>\r
-               </div>\r
+       <span class="river_item_useravatar">\r
+<?php\r
+echo elgg_view("profile/icon",array('entity' => get_entity($vars['item']->subject_guid), 'size' => 'small'));\r
+?>\r
+       </span>\r
+       <div class="river_item_contents clearfloat">\r
+<?php\r
+echo $vars['body'];\r
+?>\r
+       </div>\r
 </div>
\ No newline at end of file
index 67e277e99623d0f78637675a0b030e8fca443290..7d72453d15608b3d20a0cd09fe316589d52eafdb 100644 (file)
@@ -1,6 +1,6 @@
 <?php echo $vars['body']; ?>
 
-<script type="text/JavaScript">
+<script type="text/javascript">
 $(document).ready(function(){
        var updates = new thewireUpdateChecker(10000);
        updates.start();
index 93b7e168f844ee08ee524d031f8fdd9d61401d31..43148f08b0e73af55b7a17bb735445ee3454c9fd 100644 (file)
@@ -25,6 +25,6 @@ if ($owner && !is_numeric($owner)) {
 $river = elgg_view_river_items($owner, NULL, NULL, $type, $subtype, '', $limit, 0, 0, true, false)  . "</div>";
 
 // Replacing callback calls in the nav with something meaningless
-$river = str_replace('callback=true','replaced=88,334',$river);
+$river = str_replace('callback=true','replaced=88,334', $river);
 
 echo $river;
\ No newline at end of file
index c5c49f0a329d74c9f6fb007869cb85215df771b2..f8e1386ee98ca44ff08f6b65b8118c9ad92794f3 100644 (file)
@@ -18,10 +18,9 @@ switch($vars['orient']) {
 <?php
        if(isloggedin()){
 ?>
-               <li <?php echo $allselect; ?> ><a href="<?php echo $vars['url']; ?>mod/riverdashboard/"><?php echo elgg_echo('all'); ?></a></li>
-               <li <?php echo $friendsselect; ?> ><a href="<?php echo $vars['url']; ?>mod/riverdashboard/?display=friends"><?php echo elgg_echo('friends'); ?></a></li>
-               <li <?php echo $mineselect; ?> ><a href="<?php echo $vars['url']; ?>mod/riverdashboard/?display=mine"><?php echo elgg_echo('mine'); ?></a></li>
-
+       <li <?php echo $allselect; ?> ><a href="<?php echo $vars['url']; ?>mod/riverdashboard/"><?php echo elgg_echo('all'); ?></a></li>
+       <li <?php echo $friendsselect; ?> ><a href="<?php echo $vars['url']; ?>mod/riverdashboard/?display=friends"><?php echo elgg_echo('friends'); ?></a></li>
+       <li <?php echo $mineselect; ?> ><a href="<?php echo $vars['url']; ?>mod/riverdashboard/?display=mine"><?php echo elgg_echo('mine'); ?></a></li>
 <?php
        }
 ?>
index ab4aab10d67f8cbd81137a273ec814d7f473fe37..8a328c6cf54b52bd1e3b4bff9ac4c107fd9aa868 100644 (file)
@@ -5,26 +5,31 @@ $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($object != 'helppage'){
+                       if ($object != 'helppage'){
                                if (!empty($object )) {
                                        $keyname = 'item:'.$type.':'.$object;
-                               } else $keyname = 'item:'.$type; 
+                               } else {
+                                       $keyname = 'item:'.$type;
+                               }
                                $contents[$keyname] = "{$type},{$object}";
                        }
                }
        }
 }
        
-$allselect = ''; $friendsselect = ''; $mineselect = ''; $display_option = '';
+$allselect = $friendsselect = $mineselect = $display_option = '';
 switch($vars['orient']) {
-       case '':                $allselect = 'class="selected"';
-                                       break;
-       case 'friends': $friendsselect = 'class="selected"';
-                                       $display_option = '&amp;display=friends';
-                                       break;
-       case 'mine':    $mineselect = 'class="selected"';
-                                       $display_option = '&amp;display=mine';
-                                       break;
+       case '':
+               $allselect = 'class="selected"';
+               break;
+       case 'friends':
+               $friendsselect = 'class="selected"';
+               $display_option = '&amp;display=friends';
+               break;
+       case 'mine':
+               $mineselect = 'class="selected"';
+               $display_option = '&amp;display=mine';
+               break;
 }
 ?>
 <div class="riverdashboard_filtermenu"> 
@@ -34,11 +39,13 @@ switch($vars['orient']) {
                foreach($contents as $label => $content) {
                        $get_values = explode(",", $content);
                        //select the current filter
-                       if($get_values[1] == $current)
+                       if ($get_values[1] == $current) {
                                $selected = "SELECTED";
+                       }
                        //set the drop down filter
-                       if($content[0] && $content[1])
+                       if ($content[0] && $content[1]) {
                                $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>";                                
+                       }
                        //reset selected
                        $selected = '';
                }
index 058c0d17f2555b3c05e0f410abd594e214ff2f47..4d1eea2af8c2f8edd066c473cbb6f1cc06859bfe 100644 (file)
@@ -1,58 +1,50 @@
 <?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/
-        * 
       */
+/**
+ * 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(
+//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'),
-               ));
-       }
-       
-?>
+       ));
+}
 
-       
-<?php
+//if there is a site message
+if ($site_message) {
 
-       //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>";
 
-               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
+       //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">
                        </div>
        
 EOT;
-?>
+               //display the form
+               echo elgg_view('input/form', array('action' => "{$vars['url']}action/$action", 'body' => $form_body));
 
-<?php
-                       //display the form
-                       echo elgg_view('input/form', array('action' => "{$vars['url']}action/$action", 'body' => $form_body));
+       }//end of admin if statement
 
-               }//end of admin if statement
-?>
-<?php
        //if there is no message, add a form to create one
-       }else{
+} else {
+
+       if (isadminloggedin()) {
 
-               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
+               //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
-?>
+}//end of main if
index 0e83fb63fe68e5bec0cb25c4814f0c63284a2361..394e84f7b78b1bbb0d770cd98f02998bb7650f3a 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 
-       /**
       * Elgg thewire view page
       */
-        
+/**
+ * Elgg thewire view page
+ */
+
 ?>
 <h2><?php echo sprintf(elgg_echo('welcome:user'), $_SESSION['user']->name); ?></h2>
\ No newline at end of file
index 30cfaba5fc3057825c895c7fc83943625515230d..281ac2f7125badce4bbd72d56a5eb1e5be293aca 100644 (file)
@@ -1,5 +1,4 @@
-<?php\r
-?>\r
+\r
 <p>\r
        <?php echo elgg_echo('river:type'); ?>\r
        <select name="params[activitytype]">\r