From 538a22b85384008533aeef2ac356ff668766e0cb Mon Sep 17 00:00:00 2001 From: pete Date: Wed, 7 Apr 2010 14:10:51 +0000 Subject: Riverdashboard refreshed, and updated display of comments and likes (the loading of these needs to be moved to ajax callbacks) git-svn-id: http://code.elgg.org/elgg/trunk@5643 36083f99-b078-4883-b0ff-0f9b5a30f544 --- languages/en.php | 4 +- .../views/default/river/object/blog/create.php | 5 +- mod/groups/views/default/river/forum/create.php | 7 +- .../views/default/river/forum/topic/create.php | 7 +- .../views/default/river/object/page/create.php | 5 +- .../views/default/river/item/wrapper.php | 99 +++++++---- .../views/default/riverdashboard/css.php | 191 ++++++++------------- .../views/default/riverdashboard/js.php | 30 +++- .../views/default/riverdashboard/rivercomment.php | 11 +- views/default/annotation/annotate.php | 5 +- views/default/annotation/likes.php | 10 +- views/default/css.php | 29 ++-- views/default/js/initialise_elgg.php | 20 --- views/default/likes/forms/display.php | 25 +++ views/default/likes/forms/edit.php | 13 +- views/default/likes/forms/link.php | 19 ++ 16 files changed, 255 insertions(+), 225 deletions(-) create mode 100644 views/default/likes/forms/display.php create mode 100644 views/default/likes/forms/link.php diff --git a/languages/en.php b/languages/en.php index e0742d909..6564cd95f 100644 --- a/languages/en.php +++ b/languages/en.php @@ -843,9 +843,9 @@ If you requested this click on the link below, otherwise ignore this email. 'likes:failure' => 'There was a problem liking this item', 'likes:alreadyliked' => 'You have already liked this item', 'likes:notfound' => 'The item you are trying to like cannot be found', - 'likes:likethis' => 'Like this', + 'likes:likethis' => 'Like', 'likes:userlikedthis' => 'user liked this', - 'likes:userslikethis' => 'users liked this', + 'likes:userslikedthis' => 'users liked this', 'likes:river:annotate' => 'likes', /** diff --git a/mod/blog/views/default/river/object/blog/create.php b/mod/blog/views/default/river/object/blog/create.php index d59d601f5..1071deb30 100644 --- a/mod/blog/views/default/river/object/blog/create.php +++ b/mod/blog/views/default/river/object/blog/create.php @@ -10,11 +10,12 @@ $contents = strip_tags($object->description); //strip tags from the contents to $url = "getURL()}\">{$performed_by->name}"; $title = sprintf(elgg_echo('blog:river:create'), $url); -$string .= $title . " getURL() . "\">" . $object->title . " " . friendly_time($object->publish_time) . ""; +$string .= $title . " getURL() . "\">" . $object->title . " " . friendly_time($object->publish_time) . " Comment"; +$string .= elgg_view('likes/forms/link', array('entity' => $object)); $string .= "
"; $string .= "
"; if(strlen($contents) > 200) { - $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "..."; + $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "…"; }else{ $string .= $contents; } diff --git a/mod/groups/views/default/river/forum/create.php b/mod/groups/views/default/river/forum/create.php index fb6cd707c..e51d9fe72 100644 --- a/mod/groups/views/default/river/forum/create.php +++ b/mod/groups/views/default/river/forum/create.php @@ -2,7 +2,7 @@ $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject(); $object = get_entity($vars['item']->object_guid); - //$url = $object->getURL(); + $object_url = $object->getURL(); $forumtopic = $object->guid; $group_guid = $object->container_guid; //grab the annotation, if one exists @@ -12,12 +12,13 @@ $url = $vars['url'] . "mod/groups/topicposts.php?topic=" . $forumtopic . "&group_guid=" . $group_guid; $url_user = "getURL()}\">{$performed_by->name}"; $string = sprintf(elgg_echo("groupforum:river:posted"),$url_user) . " "; - $string .= elgg_echo("groupforum:river:annotate:create") . " | " . $object->title . ""; + $string .= elgg_echo("groupforum:river:annotate:create") . " | " . $object->title . " ". friendly_time($object->time_created) ." Visit discussion"; + $string .= elgg_view('likes/forms/link', array('entity' => $object)); $string .= "
"; if($comment){ $contents = strip_tags($comment);//this is so we don't get large images etc in the activity river if(strlen($contents) > 200) - $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "..."; + $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "…"; else $string .= $contents; } diff --git a/mod/groups/views/default/river/forum/topic/create.php b/mod/groups/views/default/river/forum/topic/create.php index f4c4aadfd..7b06cd275 100644 --- a/mod/groups/views/default/river/forum/topic/create.php +++ b/mod/groups/views/default/river/forum/topic/create.php @@ -2,7 +2,7 @@ $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject(); $object = get_entity($vars['item']->object_guid); - //$url = $object->getURL(); + $object_url = $object->getURL(); $forumtopic = $object->guid; $group_guid = $object->container_guid; $url = $vars['url'] . "mod/groups/topicposts.php?topic=" . $forumtopic . "&group_guid=" . $group_guid; @@ -13,10 +13,11 @@ $contents = strip_tags($contents);//this is so we don't get large images etc in the activity river $url_user = "getURL()}\">{$performed_by->name}"; $string = sprintf(elgg_echo("groupforum:river:postedtopic"),$url_user) . ": "; - $string .= "" . $object->title . ""; + $string .= "" . $object->title . " " . friendly_time($object->time_created) . " Visit discussion"; + $string .= elgg_view('likes/forms/link', array('entity' => $object)); $string .= "
"; if(strlen($contents) > 200) { - $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "..."; + $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "…"; }else{ $string .= $contents; } diff --git a/mod/pages/views/default/river/object/page/create.php b/mod/pages/views/default/river/object/page/create.php index 27352cef6..25efc216a 100644 --- a/mod/pages/views/default/river/object/page/create.php +++ b/mod/pages/views/default/river/object/page/create.php @@ -8,10 +8,11 @@ $url = "getURL()}\">{$performed_by->name}"; $contents = strip_tags($object->description); //strip tags from the contents to stop large images etc blowing out the river view $string = sprintf(elgg_echo("pages:river:created"),$url) . " "; - $string .= elgg_echo("pages:river:create") . " getURL() . "\">" . $object->title . ""; + $string .= elgg_echo("pages:river:create") . " getURL() . "\">" . $object->title . " ". friendly_time($object->time_created) ." Comment"; + $string .= elgg_view('likes/forms/link', array('entity' => $object)); $string .= "
"; if(strlen($contents) > 200) { - $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "..."; + $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "…"; }else{ $string .= $contents; } diff --git a/mod/riverdashboard/views/default/river/item/wrapper.php b/mod/riverdashboard/views/default/river/item/wrapper.php index 0dba70e5c..dba6f9953 100644 --- a/mod/riverdashboard/views/default/river/item/wrapper.php +++ b/mod/riverdashboard/views/default/river/item/wrapper.php @@ -8,6 +8,8 @@ $object = get_entity($vars['item']->object_guid); //get object url $object_url = $object->getURL(); +$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') @@ -29,7 +31,7 @@ switch($vars['item']->subtype){ //count comment annotations $comment_count = count_annotations($vars['item']->object_guid, $vars['item']->type, $vars['item']->subtype, $annotation_comment); -//get last two comments display +//get last three comments display $get_comments = get_annotations($vars['item']->object_guid, "", "", $annotation_comment, "", "", 3, 0, "desc"); if($get_comments){ @@ -37,7 +39,7 @@ if($get_comments){ $get_comments = array_reverse($get_comments); } -//minus two off the comment total as we display two by default +//minus 3 off the comment total as we display 3 by default if($comment_count < 3) $num_comments = 0; else @@ -48,32 +50,40 @@ else $user, 'size' => 'small')); ?>
- - -
+ -"; - echo "
"; - echo elgg_view_likes($object); - echo "
"; - //display latest 2 comments if there are any + //display latest 3 comments if there are any if($get_comments){ $counter = 0; - $background = ""; - echo "
"; + //$background = ""; - //display the number of comments if there are any - if($num_comments != 0){ - //set the correct context comment or comments - if($num_comments == 1) - echo "+{$num_comments} more comment"; - else - echo "+{$num_comments} more comments"; + echo "
"; + + if($comment_count <= 3) { + echo "Comments"; + } + + //display 'more comments' if there are any + if($num_comments != 0){ + echo "Comments (+{$num_comments} more)"; } - + + if($numoflikes != 0){ + echo elgg_view('likes/forms/display', array('entity' => $object)); + } + echo "
"; // close river_comments_tabs + + echo "
"; + + if($numoflikes != 0){ + //show the users who liked the object + echo ""; + } + foreach($get_comments as $gc){ //get the comment owner $comment_owner = get_user($gc->owner_guid); @@ -92,7 +102,7 @@ else echo ""; //truncate comment to 150 characters if(strlen($gc->value) > 150) { - $gc->value = substr($gc->value, 0, strpos($gc->value, ' ', 150)) . "..."; + $gc->value = substr($gc->value, 0, strpos($gc->value, ' ', 150)) . "…"; } $contents = strip_tags($gc->value); echo "
"; @@ -101,20 +111,33 @@ else echo "
"; $counter++; } + echo elgg_make_river_comment($object); + echo "
"; // close river_comments + } else { + // tab bar nav - for users that liked object + echo "
"; + $numoflikes = elgg_count_likes($object); + if($numoflikes != 0){ + echo elgg_view('likes/forms/display', array('entity' => $object)); + } + echo "
"; // close river_comments_tabs + + echo "
"; + + if($numoflikes != 0){ + //show the users who liked the object + echo ""; } - //display the comment link - if($vars['item']->type != 'user'){ - //for now don't display the comment link on wire and conversations for now - if($vars['item']->subtype != 'thewire' && $vars['item']->subtype != 'conversations' && $vars['item']->subtype != '') - //don't display the comment option on group discussions atm - if($vars['item']->subtype == 'groupforumtopic'){ - echo "Visit discussion"; - }else{ - echo "
"; - echo elgg_make_river_comment($object); - echo "
"; - } - } - ?> + + // 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); + } + echo "
"; + } +echo "
"; // close river_item_contents +?>
\ No newline at end of file diff --git a/mod/riverdashboard/views/default/riverdashboard/css.php b/mod/riverdashboard/views/default/riverdashboard/css.php index c8c004213..9a6109de0 100644 --- a/mod/riverdashboard/views/default/riverdashboard/css.php +++ b/mod/riverdashboard/views/default/riverdashboard/css.php @@ -36,6 +36,11 @@ .river_item p { margin:0; } +.river_item .entity_subtext { + padding-left:5px; + padding-right:5px; + font-size:85%; +} .river_item_useravatar { float:left; margin-top:3px; @@ -46,8 +51,9 @@ } .river_content_display { border-left:1px solid #DDDDDD; - font-size:90%; - margin:8px 0 6px 0; + font-size:85%; + line-height:1.5em; + margin:8px 0 5px 0; padding-left:5px; } .following_icon { @@ -58,148 +64,95 @@ } /* LATEST COMMENTS IN RIVER */ +.river_comments_tabs { + max-height: 19px; + overflow:hidden; +} .river_comments { - margin:5px 0 0 55px; - width:auto; + -moz-border-radius-bottomleft:5px; + -moz-border-radius-bottomright:5px; + -moz-border-radius-topleft:5px; + -moz-border-radius-topright:0; + -webkit-border-top-left-radius:5px; + -webkit-border-top-right-radius:0; + -webkit-border-bottom-right-radius:5px; + -webkit-border-bottom-left-radius:5px; + background-color: #eeeeee; } .river_comment { - background-color: #f8f8f8; padding:3px; - margin-bottom:3px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; + border-bottom:1px solid white; } .river_comment.penultimate { - background-color: #eeeeee; + } .river_comment.latest { - background-color: #dedede; - margin-bottom:0; -} -a.river_more_comments { - display:block; - float:right; - padding:2px 4px 7px 30px; - text-align:right; - width:auto; -} -.river_comment_owner_icon { - float:left; - margin:3px 8px 4px 2px; -} -.river_comment_contents { - margin-left:34px; -} -.river_item .comment_link { - margin-left:55px; -} -.river_comments .entity_subtext { - display: block; -} -/* ACTIVITY WIDGET? - @todo - -.collapsable_box_content .river_user_update { - background: url(_graphics/river_icons/river_icon_profile.gif) no-repeat left -1px; -} -.collapsable_box_content .river_object_user_profileupdate { - background: url(_graphics/river_icons/river_icon_profile.gif) no-repeat left -1px; -} -.collapsable_box_content .river_object_user_profileiconupdate { - background: url(_graphics/river_icons/river_icon_profile.gif) no-repeat left -1px; -} -.collapsable_box_content .river_object_annotate { - background: url(_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; -} -.collapsable_box_content .river_object_bookmarks_create { - background: url(_graphics/river_icons/river_icon_bookmarks.gif) no-repeat left -1px; -} -.collapsable_box_content .river_object_bookmarks_comment { - background: url(_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; -} -.collapsable_box_content .river_object_status_create { - background: url(_graphics/river_icons/river_icon_status.gif) no-repeat left -1px; } -.collapsable_box_content .river_object_file_create { - background: url(_graphics/river_icons/river_icon_files.gif) no-repeat left -1px; +/* hidden inline comment form */ +.river_comment_form.hidden { + padding:5px; } -.collapsable_box_content .river_object_file_update { - background: url(_graphics/river_icons/river_icon_files.gif) no-repeat left -1px; -} -.collapsable_box_content .river_object_file_comment { - background: url(_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; -} -.collapsable_box_content .river_object_widget_create { - background: url(_graphics/river_icons/river_icon_plugin.gif) no-repeat left -1px; -} -.collapsable_box_content .river_object_forums_create { - background: url(_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px; -} -.collapsable_box_content .river_object_forums_update { - background: url(_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px; -} -.collapsable_box_content .river_object_widget_update { - background: url(_graphics/river_icons/river_icon_plugin.gif) no-repeat left -1px; -} -.collapsable_box_content .river_object_blog_create { - background: url(_graphics/river_icons/river_icon_blog.gif) no-repeat left -1px; -} -.collapsable_box_content .river_object_blog_update { - background: url(_graphics/river_icons/river_icon_blog.gif) no-repeat left -1px; -} -.collapsable_box_content .river_object_blog_comment { - background: url(_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; -} -.collapsable_box_content .river_object_forumtopic_create { - background: url(_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px; -} -.collapsable_box_content .river_user_friend { - background: url(_graphics/river_icons/river_icon_friends.gif) no-repeat left -1px; -} -.collapsable_box_content .river_object_relationship_friend_create { - background: url(_graphics/river_icons/river_icon_friends.gif) no-repeat left -1px; +.river_comment_form.hidden .input_text { + width:560px; + padding:3px; } -.collapsable_box_content .river_object_relationship_member_create { - background: url(_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px; +.river_comment_form.hidden .submit_button { + margin:0 0 0 10px; + float:right; } -.collapsable_box_content .river_object_thewire_create { - background: url(_graphics/river_icons/river_icon_thewire.gif) no-repeat left -1px; +.river_link_divider { + color:#999999; } -.collapsable_box_content .river_group_join { - background: url(_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px; +.river_comment_form_button, +.river_user_like_button { + font-size:85%; } -.collapsable_box_content .river_object_groupforumtopic_annotate { - background: url(_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; +.elgg_likes_user { + border-bottom:1px solid white; + padding:3px; } -.collapsable_box_content .river_object_groupforumtopic_create { - background: url(_graphics/river_icons/river_icon_forum.gif) no-repeat left -1px; +.elgg_likes_user .entity_listing_icon { + margin:3px 0 4px 2px; } -.collapsable_box_content .river_object_sitemessage_create { - background: url(_graphics/river_icons/river_icon_blog.gif) no-repeat left -1px; +.elgg_likes_user .entity_listing_info { + width:635px; } -.collapsable_box_content .river_user_messageboard { - background: url(_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; +.elgg_likes_user .entity_metadata { + margin-top:3px; } -.collapsable_box_content .river_object_page_create { - background: url(_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px; +.river_item p.elgg_likes_owner { + padding-top:4px; } -.collapsable_box_content .river_object_page_update { - background: url(_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px; +a.river_more_comments { + display:block; + float:right; + padding:1px 7px 1px 7px; + margin-left:6px; + text-align:right; + font-size:85%; + width:auto; + background-color: #eeeeee; + -moz-border-radius-topleft:4px; + -moz-border-radius-topright:4px; + -webkit-border-top-left-radius:4px; + -webkit-border-top-right-radius:4px; } -.collapsable_box_content .river_object_page_top_create { - background: url(_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px; +a.river_more_comments.off { + background-color: white; } -.collapsable_box_content .river_object_page_top_update { - background: url(_graphics/river_icons/river_icon_pages.gif) no-repeat left -1px; +.river_comment_owner_icon { + float:left; + margin:3px 8px 4px 2px; } -.collapsable_box_content .river_object_page_top_comment { - background: url(_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; +.river_comment_contents { + margin-left:34px; } -.collapsable_box_content .river_object_page_comment { - background: url(_graphics/river_icons/river_icon_comment.gif) no-repeat left -1px; +/* +.river_item .comment_link { + margin-left:55px; } - */ + diff --git a/mod/riverdashboard/views/default/riverdashboard/js.php b/mod/riverdashboard/views/default/riverdashboard/js.php index ad96a6069..b1bace04a 100644 --- a/mod/riverdashboard/views/default/riverdashboard/js.php +++ b/mod/riverdashboard/views/default/riverdashboard/js.php @@ -1,7 +1,35 @@ \ No newline at end of file diff --git a/mod/riverdashboard/views/default/riverdashboard/rivercomment.php b/mod/riverdashboard/views/default/riverdashboard/rivercomment.php index 32d1b4675..d440e7ab6 100644 --- a/mod/riverdashboard/views/default/riverdashboard/rivercomment.php +++ b/mod/riverdashboard/views/default/riverdashboard/rivercomment.php @@ -5,11 +5,14 @@ */ if (isset($vars['entity']) && isloggedin()) { - $form_body = "Add comment"; - $form_body .= "
"; - $form_body .= elgg_view('input/text',array('internalname' => 'generic_comment', 'value' => 'Add a comment...')); + $form_body = ""; echo elgg_view('input/form', array('body' => $form_body, 'action' => "{$vars['url']}action/comments/add")); } \ No newline at end of file diff --git a/views/default/annotation/annotate.php b/views/default/annotation/annotate.php index e66035204..2cb35798b 100644 --- a/views/default/annotation/annotate.php +++ b/views/default/annotation/annotate.php @@ -12,13 +12,14 @@ $comment = get_annotation($vars['item']->annotation_id)->value; $url = "getURL()}\">{$performed_by->name}"; $string = sprintf(elgg_echo("river:posted:generic"),$url) . " "; - $string .= elgg_echo("{$subtype}:river:annotate") . " getURL()}\">" . $title . " " . friendly_time($object->time_created); + $string .= elgg_echo("{$subtype}:river:annotate") . " getURL()}\">" . $title . " ". friendly_time($object->time_created) ." Comment"; + $string .= elgg_view('likes/forms/link', array('entity' => $object)); if(get_context() != 'riverdashboard'){ $string .= "
"; if($comment){ $contents = strip_tags($comment);//this is so we don't get large images etc in the activity river if(strlen($contents) > 200) - $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "..."; + $string .= substr($contents, 0, strpos($contents, ' ', 200)) . "…"; else $string .= $contents; } diff --git a/views/default/annotation/likes.php b/views/default/annotation/likes.php index 4cf27e82b..2808664df 100644 --- a/views/default/annotation/likes.php +++ b/views/default/annotation/likes.php @@ -6,8 +6,8 @@ $owner = get_user($vars['annotation']->owner_guid); ?> -
-
+
+
$owner, @@ -16,19 +16,19 @@ $owner = get_user($vars['annotation']->owner_guid); ?>
-
+
canEdit()) { ?> - + diff --git a/views/default/css.php b/views/default/css.php index cc3c82d4b..70cc7ab4d 100644 --- a/views/default/css.php +++ b/views/default/css.php @@ -10,7 +10,7 @@ PAGE LAYOUT main page content blocks: header, sidebar, footer... GENERIC SELECTORS reusable generic classes ELGG TOPBAR elgg topbar - TOOLS MENU drop-down tools menu in topbar + [ TOOLS MENU drop-down tools menu in topbar ] HEADER CONTENTS ELGG SITE NAVIGATION Primary site navigation in header FOOTER CONTENTS @@ -354,7 +354,7 @@ h2 { width:100%; } #elgg_topbar_contents a { - margin-right:20px; + margin-right:30px; padding-top:2px; display:inline; float:left; @@ -410,6 +410,7 @@ h2 { /* *************************************** TOOLS MENU *************************************** */ +/* #elgg_topbar_contents ul.tools_menu, #elgg_topbar_contents ul.tools_menu ul { margin:0; @@ -448,7 +449,9 @@ h2 { #elgg_topbar_contents ul.tools_menu ul li { float: none; } +*/ /* elgg toolbar drop-down menu style */ +/* #elgg_topbar_contents ul.tools_menu ul { width: 150px; top: 24px; @@ -469,7 +472,7 @@ h2 { text-decoration: none; } #elgg_topbar_contents ul.tools_menu ul li a { - background-color: #333333; /* menu off-state color */ + background-color: #333333; font-weight: bold; padding-left:6px; padding-top:4px; @@ -480,11 +483,12 @@ h2 { border-bottom: 1px solid white; } #elgg_topbar_contents ul.tools_menu ul a.hover { - background-color: #0054a7; /* menu hover-state color */ + background-color: #0054a7; } #elgg_topbar_contents ul.tools_menu ul a { opacity: 0.9; } +*/ @@ -1058,7 +1062,8 @@ li.navigation_more ul li { } .entity_subtext { color:#666666; - font-size: 90%; + font-size: 85%; + font-style: italic; } /* entity metadata block */ .entity_metadata { @@ -1614,16 +1619,4 @@ a.action_button:focus { .admin_settings.menuitems li.custom_menuitem { margin-bottom:20px; } -.plugin_info_label { - font-weight: bold; -} -.plugin_description { - font-style: italic; -} -.plugin_screenshot { - display: inline; - margin: 3px; -} -.plugin_screenshot img { - width: 100px; -} \ No newline at end of file + diff --git a/views/default/js/initialise_elgg.php b/views/default/js/initialise_elgg.php index 19b2224d9..c7dbed4aa 100644 --- a/views/default/js/initialise_elgg.php +++ b/views/default/js/initialise_elgg.php @@ -4,26 +4,6 @@ $(document).ready(function () { // toggle widget box contents $('a.toggle_box_contents').bind('click', toggleContent); -/* // replaced with elgg_slide_toggle - @todo - PH update widget canvases with the new toggle function - // toggle widget box edit panel - $('a.toggle_box_edit_panel').click(function () { - $(this.parentNode.parentNode).children(".collapsable_box_editpanel").slideToggle("fast"); - return false; - }); - - // toggle customise edit panel - $('a.toggle_customise_edit_panel').click(function () { - $('div#customise_editpanel').slideToggle("fast"); - return false; - }); - - $('a.collapsibleboxlink').click(function () { - $(this.parentNode.parentNode).children(".collapsible_box").slideToggle("fast"); - return false; - }); -*/ - // WIDGET GALLERY EDIT PANEL // Sortable widgets var els = ['#leftcolumn_widgets', '#middlecolumn_widgets', '#rightcolumn_widgets', '#widget_picker_gallery' ]; diff --git a/views/default/likes/forms/display.php b/views/default/likes/forms/display.php new file mode 100644 index 000000000..f8fc661fd --- /dev/null +++ b/views/default/likes/forms/display.php @@ -0,0 +1,25 @@ + + * @link http://elgg.com/ + * + * @uses $vars['entity'] + */ + +if (isset($vars['entity']) && isloggedin()) { + + //display the number of likes + $numoflikes = elgg_count_likes($vars['entity']); + if ($numoflikes != 0) { + if ($numoflikes == 1) { + $user_string = elgg_echo('likes:userlikedthis'); + } else { + $user_string = elgg_echo('likes:userslikedthis'); + } + + echo ""; + } +} \ No newline at end of file diff --git a/views/default/likes/forms/edit.php b/views/default/likes/forms/edit.php index 97497eca5..be019d749 100644 --- a/views/default/likes/forms/edit.php +++ b/views/default/likes/forms/edit.php @@ -13,8 +13,8 @@ if (isset($vars['entity']) && isloggedin()) { $guid = $vars['entity']->getGuid(); $url = elgg_add_action_tokens_to_url($vars['url'] . "action/likes/add?guid={$guid}"); //check to see if the user has already liked - if (!elgg_annotation_exists($guid, 'likes')) { - echo "" . elgg_echo('likes:likethis') . "
"; + if (!elgg_annotation_exists($guid, 'likes') ) { + echo "" . elgg_echo('likes:likethis') . ""; } //display the number of likes $numoflikes = elgg_count_likes($vars['entity']); @@ -26,9 +26,10 @@ if (isset($vars['entity']) && isloggedin()) { } echo ""; + + //show the users who liked the object + echo ""; } - //show the users who liked the object - echo ""; } \ No newline at end of file diff --git a/views/default/likes/forms/link.php b/views/default/likes/forms/link.php new file mode 100644 index 000000000..6f5d41829 --- /dev/null +++ b/views/default/likes/forms/link.php @@ -0,0 +1,19 @@ + + * @link http://elgg.com/ + * + * @uses $vars['entity'] + */ + +if (isset($vars['entity']) && isloggedin()) { + $guid = $vars['entity']->getGuid(); + $url = elgg_add_action_tokens_to_url($vars['url'] . "action/likes/add?guid={$guid}"); + //check to see if the user has already liked + if (!elgg_annotation_exists($guid, 'likes') ) { + echo " | " . elgg_echo('likes:likethis') . ""; + } +} \ No newline at end of file -- cgit v1.2.3