From d5f0d44d4ddf33db2248ef0bdd44633d57c31683 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 8 Oct 2011 08:22:08 -0400 Subject: Fixes #3411 output/url now has a is_trusted parameter - defaults to false --- mod/bookmarks/views/default/bookmarks/group_module.php | 2 ++ mod/bookmarks/views/default/object/bookmarks.php | 9 +++++---- mod/bookmarks/views/default/widgets/bookmarks/content.php | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'mod/bookmarks/views') diff --git a/mod/bookmarks/views/default/bookmarks/group_module.php b/mod/bookmarks/views/default/bookmarks/group_module.php index 3797de010..60a727819 100644 --- a/mod/bookmarks/views/default/bookmarks/group_module.php +++ b/mod/bookmarks/views/default/bookmarks/group_module.php @@ -14,6 +14,7 @@ if ($group->bookmarks_enable == "no") { $all_link = elgg_view('output/url', array( 'href' => "bookmarks/group/$group->guid/all", 'text' => elgg_echo('link:view:all'), + 'is_trusted' => true, )); elgg_push_context('widgets'); @@ -35,6 +36,7 @@ if (!$content) { $new_link = elgg_view('output/url', array( 'href' => "bookmarks/add/$group->guid", 'text' => elgg_echo('bookmarks:add'), + 'is_trusted' => true, )); echo elgg_view('groups/profile/module', array( diff --git a/mod/bookmarks/views/default/object/bookmarks.php b/mod/bookmarks/views/default/object/bookmarks.php index ca1f5d312..784263232 100644 --- a/mod/bookmarks/views/default/object/bookmarks.php +++ b/mod/bookmarks/views/default/object/bookmarks.php @@ -17,12 +17,13 @@ $owner_icon = elgg_view_entity_icon($owner, 'tiny'); $container = $bookmark->getContainerEntity(); $categories = elgg_view('output/categories', $vars); -$link = filter_tags(elgg_view('output/url', array('href' => $bookmark->address, 'rel' => 'nofollow'))); +$link = elgg_view('output/url', array('href' => $bookmark->address)); $description = elgg_view('output/longtext', array('value' => $bookmark->description, 'class' => 'pbl')); $owner_link = elgg_view('output/url', array( 'href' => "bookmarks/owner/$owner->username", 'text' => $owner->name, + 'is_trusted' => true, )); $author_text = elgg_echo('byline', array($owner_link)); @@ -36,6 +37,7 @@ if ($comments_count != 0) { $comments_link = elgg_view('output/url', array( 'href' => $bookmark->getURL() . '#comments', 'text' => $text, + 'is_trusted' => true, )); } else { $comments_link = ''; @@ -104,11 +106,10 @@ HTML; } } - $link = filter_tags(elgg_view('output/url', array( + $link = elgg_view('output/url', array( 'href' => $bookmark->address, 'text' => $display_text, - 'rel' => 'nofollow', - ))); + )); $content = elgg_view_icon('push-pin-alt') . "$link{$excerpt}"; diff --git a/mod/bookmarks/views/default/widgets/bookmarks/content.php b/mod/bookmarks/views/default/widgets/bookmarks/content.php index ea7816345..0b85017fc 100644 --- a/mod/bookmarks/views/default/widgets/bookmarks/content.php +++ b/mod/bookmarks/views/default/widgets/bookmarks/content.php @@ -24,6 +24,7 @@ if ($content) { $more_link = elgg_view('output/url', array( 'href' => $url, 'text' => elgg_echo('bookmarks:more'), + 'is_trusted' => true, )); echo "$more_link"; } else { -- cgit v1.2.3 From 3daee8aa3b9ac62cfcba0d6a7e16836468e26884 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Mon, 10 Oct 2011 07:45:53 -0400 Subject: Fixes #3949 bookmarks widget fix --- mod/bookmarks/views/default/widgets/bookmarks/edit.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mod/bookmarks/views') diff --git a/mod/bookmarks/views/default/widgets/bookmarks/edit.php b/mod/bookmarks/views/default/widgets/bookmarks/edit.php index 99d65ac8f..ed9c7fd88 100644 --- a/mod/bookmarks/views/default/widgets/bookmarks/edit.php +++ b/mod/bookmarks/views/default/widgets/bookmarks/edit.php @@ -6,13 +6,13 @@ */ // set default value -if (!isset($vars['entity']->max_display)) { - $vars['entity']->max_display = 4; +if (!isset($vars['entity']->num_display)) { + $vars['entity']->num_display = 4; } $params = array( - 'name' => 'params[max_display]', - 'value' => $vars['entity']->max_display, + 'name' => 'params[num_display]', + 'value' => $vars['entity']->num_display, 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), ); $dropdown = elgg_view('input/dropdown', $params); -- cgit v1.2.3 From 3703a53134d6b167602cd40f31eb58bfefda9d0b Mon Sep 17 00:00:00 2001 From: cash Date: Mon, 24 Oct 2011 22:01:03 -0400 Subject: Fixes #3974 blog, bookmarks, file, and pages plugins consistent in integration with categories plugin --- mod/blog/views/default/forms/blog/save.php | 2 +- mod/blog/views/default/object/blog.php | 3 +-- mod/bookmarks/views/default/object/bookmarks.php | 2 +- mod/file/views/default/object/file.php | 2 +- mod/pages/views/default/forms/pages/edit.php | 2 +- mod/pages/views/default/object/page_top.php | 3 ++- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'mod/bookmarks/views') diff --git a/mod/blog/views/default/forms/blog/save.php b/mod/blog/views/default/forms/blog/save.php index 8246fdec3..a805541bd 100644 --- a/mod/blog/views/default/forms/blog/save.php +++ b/mod/blog/views/default/forms/blog/save.php @@ -104,7 +104,7 @@ $access_input = elgg_view('input/access', array( 'value' => $vars['access_id'] )); -$categories_input = elgg_view('categories', $vars); +$categories_input = elgg_view('input/categories', $vars); // hidden inputs $container_guid_input = elgg_view('input/hidden', array('name' => 'container_guid', 'value' => elgg_get_page_owner_guid())); diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php index ab75bd09b..b51b769a2 100644 --- a/mod/blog/views/default/object/blog.php +++ b/mod/blog/views/default/object/blog.php @@ -52,8 +52,7 @@ $metadata = elgg_view_menu('entity', array( 'class' => 'elgg-menu-hz', )); -$subtitle = "

$author_text $date $comments_link

"; -$subtitle .= $categories; +$subtitle = "$author_text $date $comments_link $categories"; // do not show the metadata and controls in widget view if (elgg_in_context('widgets')) { diff --git a/mod/bookmarks/views/default/object/bookmarks.php b/mod/bookmarks/views/default/object/bookmarks.php index 784263232..bdd623bb5 100644 --- a/mod/bookmarks/views/default/object/bookmarks.php +++ b/mod/bookmarks/views/default/object/bookmarks.php @@ -50,7 +50,7 @@ $metadata = elgg_view_menu('entity', array( 'class' => 'elgg-menu-hz', )); -$subtitle = "$author_text $date $categories $comments_link"; +$subtitle = "$author_text $date $comments_link $categories"; // do not show the metadata and controls in widget view if (elgg_in_context('widgets')) { diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php index fbd585b8a..874d8fb07 100644 --- a/mod/file/views/default/object/file.php +++ b/mod/file/views/default/object/file.php @@ -53,7 +53,7 @@ $metadata = elgg_view_menu('entity', array( 'class' => 'elgg-menu-hz', )); -$subtitle = "$author_text $date $categories $comments_link"; +$subtitle = "$author_text $date $comments_link $categories"; // do not show the metadata and controls in widget view if (elgg_in_context('widgets')) { diff --git a/mod/pages/views/default/forms/pages/edit.php b/mod/pages/views/default/forms/pages/edit.php index c29de1085..20737a121 100644 --- a/mod/pages/views/default/forms/pages/edit.php +++ b/mod/pages/views/default/forms/pages/edit.php @@ -24,7 +24,7 @@ foreach ($variables as $name => $type) { time_created); $editor_text = elgg_echo('pages:strapline', array($date, $editor_link)); $tags = elgg_view('output/tags', array('tags' => $page->tags)); +$categories = elgg_view('output/categories', $vars); $comments_count = $page->countComments(); //only display if there are commments @@ -67,7 +68,7 @@ $metadata = elgg_view_menu('entity', array( 'class' => 'elgg-menu-hz', )); -$subtitle = "$editor_text $categories $comments_link"; +$subtitle = "$editor_text $comments_link $categories"; // do not show the metadata and controls in widget view if (elgg_in_context('widgets') || $revision) { -- cgit v1.2.3 From 08910caa0a8750a449db6910bb28d0d1e758c615 Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 25 Oct 2011 19:18:09 -0400 Subject: added new view for the full display of objects --- mod/blog/views/default/object/blog.php | 17 ++++----- mod/bookmarks/views/default/object/bookmarks.php | 18 ++++++---- mod/file/views/default/object/file.php | 23 ++++++------ mod/pages/views/default/object/page_top.php | 15 ++++---- views/default/object/elements/full.php | 45 ++++++++++++++++++++++++ 5 files changed, 81 insertions(+), 37 deletions(-) create mode 100644 views/default/object/elements/full.php (limited to 'mod/bookmarks/views') diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php index b51b769a2..05ddf62c7 100644 --- a/mod/blog/views/default/object/blog.php +++ b/mod/blog/views/default/object/blog.php @@ -66,8 +66,6 @@ if ($full) { 'class' => 'blog-post', )); - $header = elgg_view_title($blog->title); - $params = array( 'entity' => $blog, 'title' => false, @@ -76,15 +74,14 @@ if ($full) { 'tags' => $tags, ); $params = $params + $vars; - $list_body = elgg_view('object/elements/summary', $params); + $summary = elgg_view('object/elements/summary', $params); - $blog_info = elgg_view_image_block($owner_icon, $list_body); - - echo << $blog->title, + 'summary' => $summary, + 'icon' => $owner_icon, + 'body' => $body, + )); } else { // brief view diff --git a/mod/bookmarks/views/default/object/bookmarks.php b/mod/bookmarks/views/default/object/bookmarks.php index bdd623bb5..ba8029a54 100644 --- a/mod/bookmarks/views/default/object/bookmarks.php +++ b/mod/bookmarks/views/default/object/bookmarks.php @@ -58,7 +58,6 @@ if (elgg_in_context('widgets')) { } if ($full && !elgg_in_context('gallery')) { - $header = elgg_view_title($bookmark->title); $params = array( 'entity' => $bookmark, @@ -68,19 +67,24 @@ if ($full && !elgg_in_context('gallery')) { 'tags' => $tags, ); $params = $params + $vars; - $list_body = elgg_view('object/elements/summary', $params); - $bookmark_info = elgg_view_image_block($owner_icon, $list_body); + $summary = elgg_view('object/elements/summary', $params); $bookmark_icon = elgg_view_icon('push-pin-alt'); - echo << $bookmark_icon$link $description HTML; + echo elgg_view('object/elements/full', array( + 'entity' => $bookmark, + 'title' => $bookmark->title, + 'icon' => $owner_icon, + 'summary' => $summary, + 'body' => $body, + )); + } elseif (elgg_in_context('gallery')) { echo << @@ -124,4 +128,4 @@ HTML; $body = elgg_view('object/elements/summary', $params); echo elgg_view_image_block($owner_icon, $body); -} \ No newline at end of file +} diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php index 874d8fb07..81421133f 100644 --- a/mod/file/views/default/object/file.php +++ b/mod/file/views/default/object/file.php @@ -19,8 +19,6 @@ $excerpt = elgg_get_excerpt($file->description); $mime = $file->mimetype; $base_type = substr($mime, 0, strpos($mime,'/')); -$body = elgg_view('output/longtext', array('value' => $file->description)); - $owner_link = elgg_view('output/url', array( 'href' => "file/owner/$owner->username", 'text' => $owner->name, @@ -69,8 +67,6 @@ if ($full && !elgg_in_context('gallery')) { $extra = elgg_view("file/specialcontent/$base_type/default", $vars); } - $header = elgg_view_title($file->title); - $params = array( 'entity' => $file, 'title' => false, @@ -79,17 +75,18 @@ if ($full && !elgg_in_context('gallery')) { 'tags' => $tags, ); $params = $params + $vars; - $list_body = elgg_view('object/elements/summary', $params); + $summary = elgg_view('object/elements/summary', $params); - $file_info = elgg_view_image_block($file_icon, $list_body); + $text = elgg_view('output/longtext', array('value' => $file->description)); + $body = "$text $extra"; - echo << - $body - $extra - -HTML; + echo elgg_view('object/elements/full', array( + 'entity' => $file, + 'title' => false, + 'icon' => $file_icon, + 'summary' => $summary, + 'body' => $body, + )); } elseif (elgg_in_context('gallery')) { echo ' +HTML; -- cgit v1.2.3 From 82da6bff73a99d18bbe2363c7e30aaf6d3fc949f Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 29 Oct 2011 12:33:10 -0400 Subject: adds a river layout view that all river views should use --- engine/lib/views.php | 2 +- .../views/default/river/object/blog/create.php | 2 +- .../default/river/object/bookmarks/create.php | 2 +- .../views/default/river/object/file/create.php | 2 +- .../river/annotation/group_topic_post/reply.php | 2 +- mod/groups/views/default/river/group/create.php | 2 +- .../river/object/groupforumtopic/create.php | 2 +- .../default/river/relationship/member/create.php | 2 +- .../default/river/object/messageboard/create.php | 2 +- .../views/default/river/object/page/create.php | 2 +- .../views/default/river/object/thewire/create.php | 2 +- .../river/annotation/generic_comment/create.php | 2 +- views/default/river/elements/layout.php | 14 +++++++++++ views/default/river/item.php | 28 +++++++++++++++++----- views/default/river/relationship/friend/create.php | 2 +- .../river/user/default/profileiconupdate.php | 3 +-- views/default/river/user/default/profileupdate.php | 2 +- 17 files changed, 51 insertions(+), 22 deletions(-) create mode 100644 views/default/river/elements/layout.php (limited to 'mod/bookmarks/views') diff --git a/engine/lib/views.php b/engine/lib/views.php index e8cb20232..3b26fb169 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -1225,7 +1225,7 @@ function elgg_view_river_item($item, array $vars = array()) { $vars['item'] = $item; - return elgg_view($item->getView(), $vars); + return elgg_view('river/item', $vars); } /** diff --git a/mod/blog/views/default/river/object/blog/create.php b/mod/blog/views/default/river/object/blog/create.php index 613cbb165..a054c1061 100644 --- a/mod/blog/views/default/river/object/blog/create.php +++ b/mod/blog/views/default/river/object/blog/create.php @@ -7,7 +7,7 @@ $object = $vars['item']->getObjectEntity(); $excerpt = strip_tags($object->excerpt); $excerpt = elgg_get_excerpt($excerpt); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'message' => $excerpt, )); \ No newline at end of file diff --git a/mod/bookmarks/views/default/river/object/bookmarks/create.php b/mod/bookmarks/views/default/river/object/bookmarks/create.php index 984d109be..388f54ac9 100644 --- a/mod/bookmarks/views/default/river/object/bookmarks/create.php +++ b/mod/bookmarks/views/default/river/object/bookmarks/create.php @@ -8,7 +8,7 @@ $object = $vars['item']->getObjectEntity(); $excerpt = elgg_get_excerpt($object->description); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'message' => $excerpt, 'attachments' => elgg_view('output/url', array('href' => $object->address)), diff --git a/mod/file/views/default/river/object/file/create.php b/mod/file/views/default/river/object/file/create.php index dad629120..e8e6142e0 100644 --- a/mod/file/views/default/river/object/file/create.php +++ b/mod/file/views/default/river/object/file/create.php @@ -7,7 +7,7 @@ $object = $vars['item']->getObjectEntity(); $excerpt = strip_tags($object->description); $excerpt = elgg_get_excerpt($excerpt); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'message' => $excerpt, )); \ No newline at end of file diff --git a/mod/groups/views/default/river/annotation/group_topic_post/reply.php b/mod/groups/views/default/river/annotation/group_topic_post/reply.php index cc94fbd43..afc823bde 100644 --- a/mod/groups/views/default/river/annotation/group_topic_post/reply.php +++ b/mod/groups/views/default/river/annotation/group_topic_post/reply.php @@ -6,7 +6,7 @@ $object = $vars['item']->getObjectEntity(); $reply = $vars['item']->getAnnotation(); $excerpt = elgg_get_excerpt($reply->value); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'message' => $excerpt, )); \ No newline at end of file diff --git a/mod/groups/views/default/river/group/create.php b/mod/groups/views/default/river/group/create.php index cacb5ad3f..ea42b5b00 100644 --- a/mod/groups/views/default/river/group/create.php +++ b/mod/groups/views/default/river/group/create.php @@ -7,7 +7,7 @@ $object = $vars['item']->getObjectEntity(); $excerpt = strip_tags($object->description); $excerpt = elgg_get_excerpt($excerpt); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'message' => $excerpt, )); \ No newline at end of file diff --git a/mod/groups/views/default/river/object/groupforumtopic/create.php b/mod/groups/views/default/river/object/groupforumtopic/create.php index 80e7b09aa..e7d92bc08 100644 --- a/mod/groups/views/default/river/object/groupforumtopic/create.php +++ b/mod/groups/views/default/river/object/groupforumtopic/create.php @@ -15,7 +15,7 @@ if (elgg_is_logged_in() && $object->canAnnotate(0, 'group_topic_post')) { $responses = elgg_view_form('discussion/reply/save', $form_vars, $body_vars); } -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'message' => $excerpt, 'responses' => $responses, diff --git a/mod/groups/views/default/river/relationship/member/create.php b/mod/groups/views/default/river/relationship/member/create.php index d1c4c3ed3..0afd87e4b 100644 --- a/mod/groups/views/default/river/relationship/member/create.php +++ b/mod/groups/views/default/river/relationship/member/create.php @@ -3,6 +3,6 @@ * Group join river view. */ -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], )); diff --git a/mod/messageboard/views/default/river/object/messageboard/create.php b/mod/messageboard/views/default/river/object/messageboard/create.php index 975598805..7ce7f6b4e 100644 --- a/mod/messageboard/views/default/river/object/messageboard/create.php +++ b/mod/messageboard/views/default/river/object/messageboard/create.php @@ -5,7 +5,7 @@ $messageboard = $vars['item']->getAnnotation(); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'message' => $messageboard->value, )); diff --git a/mod/pages/views/default/river/object/page/create.php b/mod/pages/views/default/river/object/page/create.php index ca15ddea7..4c31def33 100644 --- a/mod/pages/views/default/river/object/page/create.php +++ b/mod/pages/views/default/river/object/page/create.php @@ -7,7 +7,7 @@ $object = $vars['item']->getObjectEntity(); $excerpt = strip_tags($object->description); $excerpt = elgg_get_excerpt($excerpt); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'message' => $excerpt, )); \ No newline at end of file diff --git a/mod/thewire/views/default/river/object/thewire/create.php b/mod/thewire/views/default/river/object/thewire/create.php index fbf592664..c75a42b3f 100644 --- a/mod/thewire/views/default/river/object/thewire/create.php +++ b/mod/thewire/views/default/river/object/thewire/create.php @@ -24,7 +24,7 @@ $object_link = elgg_view('output/url', array( $summary = elgg_echo("river:create:object:thewire", array($subject_link, $object_link)); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'message' => $excerpt, 'summary' => $summary, diff --git a/views/default/river/annotation/generic_comment/create.php b/views/default/river/annotation/generic_comment/create.php index d3db68e41..7d586450d 100644 --- a/views/default/river/annotation/generic_comment/create.php +++ b/views/default/river/annotation/generic_comment/create.php @@ -5,7 +5,7 @@ $object = $vars['item']->getObjectEntity(); $comment = $vars['item']->getAnnotation(); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'message' => elgg_get_excerpt($comment->value), )); diff --git a/views/default/river/elements/layout.php b/views/default/river/elements/layout.php new file mode 100644 index 000000000..94622e272 --- /dev/null +++ b/views/default/river/elements/layout.php @@ -0,0 +1,14 @@ + elgg_view('river/elements/image', $vars), + 'body' => elgg_view('river/elements/body', $vars), + 'class' => 'elgg-river-item', +)); diff --git a/views/default/river/item.php b/views/default/river/item.php index 94622e272..75767e08d 100644 --- a/views/default/river/item.php +++ b/views/default/river/item.php @@ -1,14 +1,30 @@ elgg_view('river/elements/image', $vars), - 'body' => elgg_view('river/elements/body', $vars), - 'class' => 'elgg-river-item', -)); +echo elgg_view($item->getView(), $vars); + + +$_elgg_special_river_catch = false; diff --git a/views/default/river/relationship/friend/create.php b/views/default/river/relationship/friend/create.php index a191e7b1e..0408d79e1 100644 --- a/views/default/river/relationship/friend/create.php +++ b/views/default/river/relationship/friend/create.php @@ -8,7 +8,7 @@ $object = $vars['item']->getObjectEntity(); $subject_icon = elgg_view_entity_icon($subject, 'tiny'); $object_icon = elgg_view_entity_icon($object, 'tiny'); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'attachments' => $subject_icon . elgg_view_icon('arrow-right') . $object_icon, )); diff --git a/views/default/river/user/default/profileiconupdate.php b/views/default/river/user/default/profileiconupdate.php index 90daab1a7..160ffd252 100644 --- a/views/default/river/user/default/profileiconupdate.php +++ b/views/default/river/user/default/profileiconupdate.php @@ -3,7 +3,6 @@ * Update avatar river view */ - $subject = $vars['item']->getSubjectEntity(); $subject_link = elgg_view('output/url', array( @@ -15,7 +14,7 @@ $subject_link = elgg_view('output/url', array( $string = elgg_echo('river:update:user:avatar', array($subject_link)); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'summary' => $string, 'attachments' => elgg_view_entity_icon($subject, 'tiny', array('hover' => false)), diff --git a/views/default/river/user/default/profileupdate.php b/views/default/river/user/default/profileupdate.php index 69b69b106..ce72970d6 100644 --- a/views/default/river/user/default/profileupdate.php +++ b/views/default/river/user/default/profileupdate.php @@ -14,7 +14,7 @@ $subject_link = elgg_view('output/url', array( $string = elgg_echo('river:update:user:profile', array($subject_link)); -echo elgg_view('river/item', array( +echo elgg_view('river/elements/layout', array( 'item' => $vars['item'], 'summary' => $string, )); -- cgit v1.2.3 From 5c0bd8a19a294f178ddd6607dd3f624ca34fa5b7 Mon Sep 17 00:00:00 2001 From: cash Date: Tue, 1 Nov 2011 19:36:27 -0400 Subject: added semi-colons after function expressions --- .../coding_standards/javascript_coding_standards.txt | 11 +++++++++++ js/lib/avatar_cropper.js | 6 +++--- js/lib/configuration.js | 2 +- js/lib/elgglib.js | 8 ++++---- js/lib/hooks.js | 8 ++++---- js/lib/ui.js | 14 +++++++------- js/lib/ui.widgets.js | 12 ++++++------ js/lib/userpicker.js | 10 +++++----- mod/blog/views/default/js/blog/save_draft.php | 4 ++-- mod/bookmarks/views/default/bookmarks/js.php | 2 +- mod/developers/views/default/js/developers/developers.php | 4 ++-- mod/embed/views/default/js/embed/embed.php | 8 ++++---- mod/messageboard/views/default/messageboard/js.php | 6 +++--- mod/thewire/views/default/js/thewire.php | 6 +++--- mod/tinymce/views/default/js/tinymce.php | 4 ++-- .../views/default/uservalidationbyemail/js.php | 2 +- 16 files changed, 59 insertions(+), 48 deletions(-) (limited to 'mod/bookmarks/views') diff --git a/documentation/coding_standards/javascript_coding_standards.txt b/documentation/coding_standards/javascript_coding_standards.txt index 7d3b842ec..9939e80ab 100644 --- a/documentation/coding_standards/javascript_coding_standards.txt +++ b/documentation/coding_standards/javascript_coding_standards.txt @@ -1,2 +1,13 @@ *** JAVASCRIPT CODING STANDARDS *** +* Same formatting standards as PHP. + +* All functions should be in the elgg namespace. + +* Function expressions should end with a semi-colon: + + elgg.ui.toggles = function(event) { + event.preventDefault(); + $(target).slideToggle('medium'); + }; + diff --git a/js/lib/avatar_cropper.js b/js/lib/avatar_cropper.js index df6ba7866..fc32a0832 100644 --- a/js/lib/avatar_cropper.js +++ b/js/lib/avatar_cropper.js @@ -32,7 +32,7 @@ elgg.avatarCropper.init = function() { var selection = ias.getSelection(); elgg.avatarCropper.preview($('#user-avatar-cropper'), selection); } -} +}; /** * Handler for changing select area. @@ -57,7 +57,7 @@ elgg.avatarCropper.preview = function(img, selection) { marginLeft: '-' + Math.round(scaleX * selection.x1) + 'px', marginTop: '-' + Math.round(scaleY * selection.y1) + 'px' }); -} +}; /** * Handler for updating the form inputs after select ends @@ -71,6 +71,6 @@ elgg.avatarCropper.selectChange = function(img, selection) { $('input[name=x2]').val(selection.x2); $('input[name=y1]').val(selection.y1); $('input[name=y2]').val(selection.y2); -} +}; elgg.register_hook_handler('init', 'system', elgg.avatarCropper.init); \ No newline at end of file diff --git a/js/lib/configuration.js b/js/lib/configuration.js index f724a2f01..6e221c957 100644 --- a/js/lib/configuration.js +++ b/js/lib/configuration.js @@ -7,4 +7,4 @@ elgg.provide('elgg.config'); */ elgg.get_site_url = function() { return elgg.config.wwwroot; -} \ No newline at end of file +}; \ No newline at end of file diff --git a/js/lib/elgglib.js b/js/lib/elgglib.js index 628adccfc..d963a62be 100644 --- a/js/lib/elgglib.js +++ b/js/lib/elgglib.js @@ -467,7 +467,7 @@ elgg.parse_url = function(url, component, expand) { } } return results; -} +}; /** * Returns an object with key/values of the parsed query string. @@ -540,7 +540,7 @@ elgg.push_to_object_array = function(object, parent, value) { } return false; -} +}; /** * Tests if object[parent] contains child @@ -554,7 +554,7 @@ elgg.is_in_object_array = function(object, parent, value) { elgg.assertTypeOf('string', parent); return typeof(object[parent]) != 'undefined' && object[parent].indexOf(value) >= 0; -} +}; /** * Triggers the init hook when the library is ready @@ -569,4 +569,4 @@ elgg.initWhenReady = function() { elgg.trigger_hook('init', 'system'); elgg.trigger_hook('ready', 'system'); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/js/lib/hooks.js b/js/lib/hooks.js index edfd28f24..7bac471f6 100644 --- a/js/lib/hooks.js +++ b/js/lib/hooks.js @@ -136,7 +136,7 @@ elgg.register_instant_hook = function(name, type) { elgg.assertTypeOf('string', type); return elgg.push_to_object_array(elgg.config.instant_hooks, name, type); -} +}; /** * Is this hook registered as an instant hook? @@ -146,7 +146,7 @@ elgg.register_instant_hook = function(name, type) { */ elgg.is_instant_hook = function(name, type) { return elgg.is_in_object_array(elgg.config.instant_hooks, name, type); -} +}; /** * Records that a hook has been triggered. @@ -156,7 +156,7 @@ elgg.is_instant_hook = function(name, type) { */ elgg.set_triggered_hook = function(name, type) { return elgg.push_to_object_array(elgg.config.triggered_hooks, name, type); -} +}; /** * Has this hook been triggered yet? @@ -166,7 +166,7 @@ elgg.set_triggered_hook = function(name, type) { */ elgg.is_triggered_hook = function(name, type) { return elgg.is_in_object_array(elgg.config.triggered_hooks, name, type); -} +}; elgg.register_instant_hook('init', 'system'); elgg.register_instant_hook('ready', 'system'); diff --git a/js/lib/ui.js b/js/lib/ui.js index 6cc1bc78a..16ef2dc96 100644 --- a/js/lib/ui.js +++ b/js/lib/ui.js @@ -25,7 +25,7 @@ elgg.ui.init = function () { if ($('.elgg-input-date').length) { elgg.ui.initDatePicker(); } -} +}; /** * Toggles an element based on clicking a separate element @@ -43,7 +43,7 @@ elgg.ui.toggles = function(event) { var target = $(this).toggleClass('elgg-state-active').attr('href'); $(target).slideToggle('medium'); -} +}; /** * Pops up an element based on clicking a separate element @@ -105,7 +105,7 @@ elgg.ui.popsUp = function(event) { $('body') .die('click', elgg.ui.popupClose) .live('click', elgg.ui.popupClose); -} +}; /** * Catches clicks that aren't in a popup and closes all popups. @@ -143,7 +143,7 @@ elgg.ui.popupClose = function(event) { $('body').die('click', elgg.ui.popClose); } -} +}; /** * Toggles a child menu when the parent is clicked @@ -155,7 +155,7 @@ elgg.ui.toggleMenu = function(event) { $(this).siblings().slideToggle('medium'); $(this).toggleClass('elgg-menu-closed elgg-menu-opened'); event.preventDefault(); -} +}; /** * Initialize the hover menu @@ -215,7 +215,7 @@ elgg.ui.initHoverMenu = function(parent) { $(".elgg-menu-hover").fadeOut(); } }); -} +}; /** * Calls a confirm() and prevents default if denied. @@ -276,7 +276,7 @@ elgg.ui.initDatePicker = function() { } } }); -} +}; elgg.register_hook_handler('init', 'system', elgg.ui.init); elgg.register_hook_handler('getOptions', 'ui.popup', elgg.ui.LoginHandler); \ No newline at end of file diff --git a/js/lib/ui.widgets.js b/js/lib/ui.widgets.js index fb256672a..6435d2147 100644 --- a/js/lib/ui.widgets.js +++ b/js/lib/ui.widgets.js @@ -65,7 +65,7 @@ elgg.ui.widgets.add = function(event) { } }); event.preventDefault(); -} +}; /** * Persist the widget's new position @@ -96,7 +96,7 @@ elgg.ui.widgets.move = function(event, ui) { // @hack fixes jquery-ui/opera bug where draggable elements jump ui.item.css('top', 0); ui.item.css('left', 0); -} +}; /** * Removes a widget from the layout @@ -134,7 +134,7 @@ elgg.ui.widgets.remove = function(event) { } }); event.preventDefault(); -} +}; /** * Toggle the collapse state of the widget @@ -146,7 +146,7 @@ elgg.ui.widgets.collapseToggle = function(event) { $(this).toggleClass('elgg-widget-collapsed'); $(this).parent().parent().find('.elgg-body').slideToggle('medium'); event.preventDefault(); -} +}; /** * Save a widget's settings @@ -178,7 +178,7 @@ elgg.ui.widgets.saveSettings = function(event) { } }); event.preventDefault(); -} +}; /** * Make all elements have the same min-height @@ -197,6 +197,6 @@ elgg.ui.widgets.equalHeight = function(selector) { } }) $(selector).css('min-height', maxHeight); -} +}; elgg.register_hook_handler('init', 'system', elgg.ui.widgets.init); diff --git a/js/lib/userpicker.js b/js/lib/userpicker.js index ae2add53f..8287ba91c 100644 --- a/js/lib/userpicker.js +++ b/js/lib/userpicker.js @@ -34,7 +34,7 @@ elgg.userpicker.init = function() { }); $('.elgg-userpicker-remove').live('click', elgg.userpicker.removeUser); -} +}; /** * Adds a user to the select user list @@ -59,7 +59,7 @@ elgg.userpicker.addUser = function(event, ui) { $(this).val(''); event.preventDefault(); -} +}; /** * Remove a user from the selected user list @@ -75,7 +75,7 @@ elgg.userpicker.removeUser = function(event) { item.remove(); event.preventDefault(); -} +}; /** * Render the list item for insertion into the selected user list @@ -96,7 +96,7 @@ elgg.userpicker.viewUser = function(info) { html += " Date: Tue, 1 Nov 2011 21:08:22 -0400 Subject: Fixes #4035 made the entity view pages consistent for blog, bookmarks, file, pages, and forum posts --- mod/blog/lib/blog.php | 1 - mod/blog/views/default/object/blog.php | 1 - mod/bookmarks/pages/bookmarks/view.php | 1 - mod/bookmarks/views/default/object/bookmarks.php | 1 - mod/file/views/default/object/file.php | 1 - mod/groups/views/default/object/groupforumtopic.php | 1 - mod/pages/views/default/object/page_top.php | 1 - views/default/object/elements/full.php | 10 +--------- 8 files changed, 1 insertion(+), 16 deletions(-) (limited to 'mod/bookmarks/views') diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php index 792f32c42..590547a8c 100644 --- a/mod/blog/lib/blog.php +++ b/mod/blog/lib/blog.php @@ -20,7 +20,6 @@ function blog_get_page_content_read($guid = NULL) { // no header or tabs for viewing an individual blog $return['filter'] = ''; - $return['header'] = ''; if (!elgg_instanceof($blog, 'object', 'blog')) { $return['content'] = elgg_echo('blog:error:post_not_found'); diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php index 05ddf62c7..3525b3d48 100644 --- a/mod/blog/views/default/object/blog.php +++ b/mod/blog/views/default/object/blog.php @@ -77,7 +77,6 @@ if ($full) { $summary = elgg_view('object/elements/summary', $params); echo elgg_view('object/elements/full', array( - 'title' => $blog->title, 'summary' => $summary, 'icon' => $owner_icon, 'body' => $body, diff --git a/mod/bookmarks/pages/bookmarks/view.php b/mod/bookmarks/pages/bookmarks/view.php index 8e097b090..2439d2ee8 100644 --- a/mod/bookmarks/pages/bookmarks/view.php +++ b/mod/bookmarks/pages/bookmarks/view.php @@ -28,7 +28,6 @@ $body = elgg_view_layout('content', array( 'content' => $content, 'title' => $title, 'filter' => '', - 'header' => '', )); echo elgg_view_page($title, $body); diff --git a/mod/bookmarks/views/default/object/bookmarks.php b/mod/bookmarks/views/default/object/bookmarks.php index ba8029a54..89a0d03e0 100644 --- a/mod/bookmarks/views/default/object/bookmarks.php +++ b/mod/bookmarks/views/default/object/bookmarks.php @@ -79,7 +79,6 @@ HTML; echo elgg_view('object/elements/full', array( 'entity' => $bookmark, - 'title' => $bookmark->title, 'icon' => $owner_icon, 'summary' => $summary, 'body' => $body, diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php index 81421133f..1db9863c9 100644 --- a/mod/file/views/default/object/file.php +++ b/mod/file/views/default/object/file.php @@ -69,7 +69,6 @@ if ($full && !elgg_in_context('gallery')) { $params = array( 'entity' => $file, - 'title' => false, 'metadata' => $metadata, 'subtitle' => $subtitle, 'tags' => $tags, diff --git a/mod/groups/views/default/object/groupforumtopic.php b/mod/groups/views/default/object/groupforumtopic.php index f3d5f96d5..a579d89a4 100644 --- a/mod/groups/views/default/object/groupforumtopic.php +++ b/mod/groups/views/default/object/groupforumtopic.php @@ -64,7 +64,6 @@ if ($full) { $params = array( 'entity' => $topic, - 'title' => false, 'metadata' => $metadata, 'subtitle' => $subtitle, 'tags' => $tags, diff --git a/mod/pages/views/default/object/page_top.php b/mod/pages/views/default/object/page_top.php index 0a1c33458..e78289f28 100644 --- a/mod/pages/views/default/object/page_top.php +++ b/mod/pages/views/default/object/page_top.php @@ -80,7 +80,6 @@ if ($full) { $params = array( 'entity' => $page, - 'title' => false, 'metadata' => $metadata, 'subtitle' => $subtitle, 'tags' => $tags, diff --git a/views/default/object/elements/full.php b/views/default/object/elements/full.php index 4a2991442..9b89f9706 100644 --- a/views/default/object/elements/full.php +++ b/views/default/object/elements/full.php @@ -2,8 +2,7 @@ /** * Object full rendering * - * Sample output - *

Title

+ * Sample output: *
*
*
@@ -12,14 +11,12 @@ *
* * @uses $vars['entity'] ElggEntity - * @uses $vars['title'] Title (false for no title) * @uses $vars['icon'] HTML for the content icon * @uses $vars['summary'] HTML for the content summary * @uses $vars['body'] HTML for the content body * @uses $vars['class'] Optional additional class for the content wrapper */ -$title = elgg_extract('title', $vars); $icon = elgg_extract('icon', $vars); $summary = elgg_extract('summary', $vars); $body = elgg_extract('body', $vars); @@ -30,14 +27,9 @@ if ($class) { $class = "elgg-content"; } -if ($title) { - $title = elgg_view_title($title); -} - $header = elgg_view_image_block($icon, $summary); echo << $header $body -- cgit v1.2.3 From 7f8b7adeb346c8d07e2da4b72e9f78e8ffcb82b9 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Thu, 3 Nov 2011 08:24:19 -0400 Subject: Refs #4027 updated all rss views except for groups --- mod/bookmarks/languages/en.php | 4 +- mod/bookmarks/views/rss/object/bookmarks.php | 36 +++++++++++------ mod/file/start.php | 3 ++ mod/file/views/rss/file/enclosure.php | 16 ++++++++ mod/file/views/rss/object/file.php | 21 ---------- mod/search/views/rss/search/list.php | 25 ++++++++++++ mod/search/views/rss/search/listing.php | 25 ------------ mod/thewire/languages/en.php | 1 + mod/thewire/views/rss/object/thewire.php | 59 +++++++++++----------------- views/rss/annotation/generic_comment.php | 2 +- views/rss/group/default.php | 2 +- views/rss/object/default.php | 6 ++- views/rss/user/default.php | 2 +- 13 files changed, 103 insertions(+), 99 deletions(-) create mode 100644 mod/file/views/rss/file/enclosure.php delete mode 100644 mod/file/views/rss/object/file.php create mode 100644 mod/search/views/rss/search/list.php delete mode 100644 mod/search/views/rss/search/listing.php (limited to 'mod/bookmarks/views') diff --git a/mod/bookmarks/languages/en.php b/mod/bookmarks/languages/en.php index 0478e292f..2c589c207 100644 --- a/mod/bookmarks/languages/en.php +++ b/mod/bookmarks/languages/en.php @@ -68,14 +68,14 @@ $english = array( */ 'bookmarks:save:success' => "Your item was successfully bookmarked.", - 'bookmarks:delete:success' => "Your bookmarked item was successfully deleted.", + 'bookmarks:delete:success' => "Your bookmark was deleted.", /** * Error messages */ 'bookmarks:save:failed' => "Your bookmark could not be saved. Make sure you've entered a title and address and then try again.", - 'bookmarks:save:invalid' => "The address of the bookmark is invalid and could nto be saved.", + 'bookmarks:save:invalid' => "The address of the bookmark is invalid and could not be saved.", 'bookmarks:delete:failed' => "Your bookmark could not be deleted. Please try again.", ); diff --git a/mod/bookmarks/views/rss/object/bookmarks.php b/mod/bookmarks/views/rss/object/bookmarks.php index 8e88485f1..1abda4710 100644 --- a/mod/bookmarks/views/rss/object/bookmarks.php +++ b/mod/bookmarks/views/rss/object/bookmarks.php @@ -1,23 +1,37 @@ title; if (empty($title)) { - $title = substr($vars['entity']->description,0,32); - if (strlen($vars['entity']->description) > 32) - $title .= " ..."; + $title = strip_tags($vars['entity']->description); + $title = elgg_get_excerpt($title, 32); } -?> +$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $vars['entity']->getTimeCreated()); +$url_text = elgg_echo('bookmarks:address'); +$link = elgg_view('output/url', array('href' => $vars['entity']->address)); +$description = $vars['entity']->description . "

$url_text: $link

"; + +$creator = elgg_view('page/components/creator', $vars); +$georss = elgg_view('page/components/georss', $vars); +$extension = elgg_view('extensions/item'); + +$item = <<<__HTML - getURL(); ?> - time_created) ?> - address; ?> - <![CDATA[<?php echo $title; ?>]]> - description)); ?>]]> + $permalink + $pubdate + $permalink + <![CDATA[$title]]> + + $creator$georss$extension + +__HTML; + +echo $item; diff --git a/mod/file/start.php b/mod/file/start.php index 843ae0794..9007fc9ba 100644 --- a/mod/file/start.php +++ b/mod/file/start.php @@ -22,6 +22,9 @@ function file_init() { // Extend CSS elgg_extend_view('css/elgg', 'file/css'); + // add enclosure to rss item + elgg_extend_view('extensions/item', 'file/enclosure'); + // extend group main page elgg_extend_view('groups/tool_latest', 'file/group_module'); diff --git a/mod/file/views/rss/file/enclosure.php b/mod/file/views/rss/file/enclosure.php new file mode 100644 index 000000000..600d287ef --- /dev/null +++ b/mod/file/views/rss/file/enclosure.php @@ -0,0 +1,16 @@ +getGUID(); + $size = $vars['entity']->size(); + $mime_type = $vars['entity']->getMimeType(); + echo <<"; +END; +} diff --git a/mod/file/views/rss/object/file.php b/mod/file/views/rss/object/file.php deleted file mode 100644 index a0660d6c8..000000000 --- a/mod/file/views/rss/object/file.php +++ /dev/null @@ -1,21 +0,0 @@ -title; -if (empty($title)) { - $title = elgg_get_excerpt($vars['entity']->description, 32); -} -?> - - - getURL(); ?> - time_created) ?> - getURL(); ?> - <![CDATA[<?php echo $title; ?>]]> - description)); ?>]]> - - diff --git a/mod/search/views/rss/search/list.php b/mod/search/views/rss/search/list.php new file mode 100644 index 000000000..32082fd31 --- /dev/null +++ b/mod/search/views/rss/search/list.php @@ -0,0 +1,25 @@ + $entity, + 'params' => $vars['params'], + 'results' => $vars['results'] + )); + } +} + +echo $body; \ No newline at end of file diff --git a/mod/search/views/rss/search/listing.php b/mod/search/views/rss/search/listing.php deleted file mode 100644 index 32082fd31..000000000 --- a/mod/search/views/rss/search/listing.php +++ /dev/null @@ -1,25 +0,0 @@ - $entity, - 'params' => $vars['params'], - 'results' => $vars['results'] - )); - } -} - -echo $body; \ No newline at end of file diff --git a/mod/thewire/languages/en.php b/mod/thewire/languages/en.php index 9716fc060..3c83d145f 100644 --- a/mod/thewire/languages/en.php +++ b/mod/thewire/languages/en.php @@ -20,6 +20,7 @@ $english = array( 'thewire:noposts' => "No wire posts yet", 'item:object:thewire' => "Wire posts", 'thewire:update' => 'Update', + 'thewire:by' => 'Wire post by %s', 'thewire:previous' => "Previous", 'thewire:hide' => "Hide", diff --git a/mod/thewire/views/rss/object/thewire.php b/mod/thewire/views/rss/object/thewire.php index 8229f46f1..494c2c8dc 100644 --- a/mod/thewire/views/rss/object/thewire.php +++ b/mod/thewire/views/rss/object/thewire.php @@ -2,46 +2,35 @@ /** * Elgg thewire rss view * - * @package Elgg - * @subpackage Core + * @package ElggTheWire */ $owner = $vars['entity']->getOwnerEntity(); -if ($owner) { - $title = elgg_echo('thewire:by', array($owner->name)); -} else { - $subtitle = strip_tags($vars['entity']->description); - $title = elgg_get_excerpt($subtitle, 32); +if (!$owner) { + return true; } -?> +$title = elgg_echo('thewire:by', array($owner->name)); +$permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); +$pubdate = date('r', $vars['entity']->getTimeCreated()); + +$description = autop($vars['entity']->description); + +$creator = elgg_view('page/components/creator', $vars); +$georss = elgg_view('page/components/georss', $vars); +$extension = elgg_view('extensions/item', $vars); + +$item = <<<__HTML -getGUID(); ?> -time_created) ?> -getURL()); ?> -<![CDATA[<?php echo $title; ?>]]> -description)); ?>]]> -getOwnerEntity(); -if ($owner) { - ?> - name; ?> - -getLongitude()) && - ($vars['entity']->getLatitude()) -) { - ?> - - getLatitude(); ?> getLongitude(); ?> - - - + $permalink + $pubdate + $permalink + <![CDATA[$title]]> + + $creator$georss$extension + +__HTML; + +echo $item; diff --git a/views/rss/annotation/generic_comment.php b/views/rss/annotation/generic_comment.php index 9e9107568..de652fc8e 100644 --- a/views/rss/annotation/generic_comment.php +++ b/views/rss/annotation/generic_comment.php @@ -16,7 +16,7 @@ $permalink = $annotation->getURL(); $title = elgg_echo('generic_comment:title', array($poster_name)); $creator = elgg_view('page/components/creator', array('entity' => $annotation)); -$extensions = elgg_view('extensions/item'); +$extensions = elgg_view('extensions/item', $vars); $item = <<<__HTML diff --git a/views/rss/group/default.php b/views/rss/group/default.php index 1276ab8f1..f57c7f82c 100644 --- a/views/rss/group/default.php +++ b/views/rss/group/default.php @@ -20,7 +20,7 @@ if ($vars['entity']->description) { $creator = elgg_view('page/components/creator', $vars); $georss = elgg_view('page/components/georss', $vars); -$extension = elgg_view('extensions/item'); +$extension = elgg_view('extensions/item', $vars); $item = <<<__HTML diff --git a/views/rss/object/default.php b/views/rss/object/default.php index b5d269ac7..be8025953 100644 --- a/views/rss/object/default.php +++ b/views/rss/object/default.php @@ -15,9 +15,11 @@ if (empty($title)) { $permalink = htmlspecialchars($vars['entity']->getURL(), ENT_NOQUOTES, 'UTF-8'); $pubdate = date('r', $vars['entity']->getTimeCreated()); +$description = autop($vars['entity']->description); + $creator = elgg_view('page/components/creator', $vars); $georss = elgg_view('page/components/georss', $vars); -$extension = elgg_view('extensions/item'); +$extension = elgg_view('extensions/item', $vars); $item = <<<__HTML @@ -25,7 +27,7 @@ $item = <<<__HTML $pubdate $permalink <![CDATA[$title]]> - description}]]> + $creator$georss$extension diff --git a/views/rss/user/default.php b/views/rss/user/default.php index 1500881f8..1c7bf75e7 100644 --- a/views/rss/user/default.php +++ b/views/rss/user/default.php @@ -17,7 +17,7 @@ if ($vars['entity']->description) { } $georss = elgg_view('page/components/georss', $vars); -$extension = elgg_view('extensions/item'); +$extension = elgg_view('extensions/item', $vars); $item = <<<__HTML -- cgit v1.2.3 From 5ae9e93b57bdc6744198538153b84bed4a34e960 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sun, 13 Nov 2011 16:22:57 -0500 Subject: Fixes #4082 adds output/img --- engine/lib/users.php | 11 ++++++----- mod/bookmarks/views/default/bookmarks/bookmarklet.php | 9 ++++++--- views/default/core/avatar/upload.php | 7 +++++-- views/default/forms/avatar/crop.php | 17 +++++++++++++---- views/default/icon/default.php | 7 +++++-- views/default/icon/user/default.php | 12 +++++++++--- views/default/output/img.php | 12 ++++++++++++ 7 files changed, 56 insertions(+), 19 deletions(-) create mode 100644 views/default/output/img.php (limited to 'mod/bookmarks/views') diff --git a/engine/lib/users.php b/engine/lib/users.php index 4072740f9..9cb8ddfa7 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1476,14 +1476,15 @@ function users_pagesetup() { // topbar if ($viewer) { - - $icon_url = $viewer->getIconURL('topbar'); - $class = 'elgg-border-plain elgg-transition'; - $title = elgg_echo('profile'); elgg_register_menu_item('topbar', array( 'name' => 'profile', 'href' => $viewer->getURL(), - 'text' => "\"$viewer-name\" title=\"$title\" class=\"$class\" />", + 'text' => elgg_view('output/img', array( + 'src' => $viewer->getIconURL('topbar'), + 'alt' => $viewer->name, + 'title' => elgg_echo('profile'), + 'class' => 'elgg-border-plain elgg-transition', + )), 'priority' => 100, 'link_class' => 'elgg-topbar-avatar', )); diff --git a/mod/bookmarks/views/default/bookmarks/bookmarklet.php b/mod/bookmarks/views/default/bookmarks/bookmarklet.php index 1d0b25498..b3e9737fe 100644 --- a/mod/bookmarks/views/default/bookmarks/bookmarklet.php +++ b/mod/bookmarks/views/default/bookmarks/bookmarklet.php @@ -20,13 +20,16 @@ if (!$name && ($user = elgg_get_logged_in_user_entity())) { } $url = elgg_get_site_url(); - +$img = elgg_view('output/img', array( + 'src' => 'mod/bookmarks/graphics/bookmarklet.gif', + 'alt' => $title, +)); $bookmarklet = "getIconUrl('medium'); +$user_avatar = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('medium'), + 'alt' => elgg_echo('avatar'), +)); $current_label = elgg_echo('avatar:current'); @@ -23,7 +26,7 @@ $upload_form = elgg_view_form('avatar/upload', $form_params, $vars); $image = <<
- avatar + $user_avatar HTML; diff --git a/views/default/forms/avatar/crop.php b/views/default/forms/avatar/crop.php index f622fd60f..3e798cb27 100644 --- a/views/default/forms/avatar/crop.php +++ b/views/default/forms/avatar/crop.php @@ -9,14 +9,23 @@ elgg_load_js('jquery.imgareaselect'); elgg_load_js('elgg.avatar_cropper'); elgg_load_css('jquery.imgareaselect'); -$master_image = $vars['entity']->getIconUrl('master'); +$master_img = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('master'), + 'alt' => elgg_echo('avatar'), + 'class' => 'mrl', + 'id' => 'user-avatar-cropper', +)); + +$preview_img = elgg_view('output/img', array( + 'src' => $vars['entity']->getIconUrl('master'), + 'alt' => elgg_echo('avatar'), +)); ?>
- <?php echo elgg_echo('avatar'); ?> +
-
- +
getIconURL($vars['size']); -$img = "\"$title\""; +$img = elgg_view('output/img', array( + 'src' => $entity->getIconURL($vars['size']), + 'alt' => $title, + 'class' => $class, +)); if ($url) { $params = array( diff --git a/views/default/icon/user/default.php b/views/default/icon/user/default.php index a208ec41a..c0b0e7483 100644 --- a/views/default/icon/user/default.php +++ b/views/default/icon/user/default.php @@ -47,7 +47,7 @@ if ($js) { $img_class = ''; if (isset($vars['img_class'])) { - $img_class = "class=\"{$vars['img_class']}\""; + $img_class = $vars['img_class']; } $use_hover = elgg_extract('use_hover', $vars, true); @@ -62,8 +62,14 @@ if (isset($vars['hover'])) { $spacer_url = elgg_get_site_url() . '_graphics/spacer.gif'; -$icon_url = $user->getIconURL($size); -$icon = "\"$name\""; +$icon_url = elgg_format_url($user->getIconURL($size)); +$icon = elgg_view('output/img', array( + 'src' => $spacer_url, + 'alt' => $name, + 'title' => $name, + 'class' => $img_class, + 'style' => "background: url($icon_url) no-repeat;", +)); $show_menu = $use_hover && (elgg_is_admin_logged_in() || !$user->isBanned()); diff --git a/views/default/output/img.php b/views/default/output/img.php new file mode 100644 index 000000000..d3f596801 --- /dev/null +++ b/views/default/output/img.php @@ -0,0 +1,12 @@ +"; -- cgit v1.2.3