]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixing a few display issues in the object/blog view
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 24 Dec 2010 13:39:24 +0000 (13:39 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Fri, 24 Dec 2010 13:39:24 +0000 (13:39 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7718 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/blog/views/default/object/blog.php
views/default/layout/objects/list/body.php

index f296caa693a0815c1a0f9ba2b325b22a6b33a7d4..199a7c8221c529da056972a9efc6410f857a08d0 100644 (file)
@@ -12,16 +12,18 @@ if (!$blog) {
        return TRUE;
 }
 
-$owner = get_entity($blog->owner_guid);
-$container = get_entity($blog->container_guid);
-$linked_title = "<a href=\"{$blog->getURL()}\" title=\"" . htmlentities($blog->title) . "\">{$blog->title}</a>";
+$owner = $blog->getOwnerEntity();
+$container = $blog->getContainerEntity();
 $categories = elgg_view('categories/view', $vars);
 $excerpt = $blog->excerpt;
 
 $body = autop($blog->description);
 $owner_icon = elgg_view('profile/icon', array('entity' => $owner, 'size' => 'tiny'));
-$owner_blog_link = "<a href=\"" . elgg_get_site_url() . "pg/blog/owner/$owner->username\">{$owner->name}</a>";
-$author_text = elgg_echo('blog:author_by_line', array($owner_blog_link));
+$owner_link = elgg_view('output/url', array(
+       'href' => "pg/blog/owner/$owner->username",
+       'text' => $owner->name,
+));
+$author_text = elgg_echo('blog:author_by_line', array($owner_link));
 if ($blog->tags) {
        $tags = "<p class=\"elgg-tags\">" . elgg_view('output/tags', array('tags' => $blog->tags)) . "</p>";
 } else {
@@ -64,8 +66,11 @@ if ($blog->canEdit()) {
                $metadata .= "<li>$status_text</li>";
        }
 
-       $edit_url = elgg_get_site_url()."pg/blog/edit/{$owner->username}/{$blog->getGUID()}/";
-       $edit_link = "<span class='entity-edit'><a href=\"$edit_url\">" . elgg_echo('edit') . '</a></span>';
+       $edit_url = elgg_get_site_url() . "pg/blog/edit/{$owner->username}/{$blog->getGUID()}/";
+       $edit_link = elgg_view('output/url', array(
+               'href' => $edit_url,
+               'text' => elgg_echo('edit'),
+       ));
        $metadata .= "<li>$edit_link</li>";
 
        $delete_url = "action/blog/delete?guid={$blog->getGUID()}";
@@ -89,35 +94,23 @@ if ($full) {
                'title' => $blog->title,
                'buttons' => '',
        );
-       $header = elgg_view('content/header', $params);
+       $header = elgg_view_title($blog->title);
 
        $params = array(
                'entity' => $blog,
+               'title' => false,
                'metadata' => $metadata,
                'subtitle' => $subtitle,
                'tags' => $tags,
        );
        $list_body = elgg_view('layout/objects/list/body', $params);
 
-       $info = <<<HTML
-<div class="entity-listing-info clearfix">
-       <div class="entity-metadata">$edit</div>
-       <p class="entity-subtext">
-               $author_text
-               $date
-               $categories
-               $comments_link
-       </p>
-       $tags
-</div>
-HTML;
-
        $blog_info = elgg_view_image_block($owner_icon, $list_body);
 
        echo <<<HTML
 $header
 $blog_info
-<div class="blog_post elgg-content">
+<div class="blog-post elgg-content">
        $body
 </div>
 HTML;
index 9bef21da9d9b898fe6e88c64583fb65a251458ca..8a59cd36412043d3ab18b8753712ad572cf2f8d5 100644 (file)
@@ -10,7 +10,7 @@
  * <div class="elgg-list-content">Excerpt text</div>
  *
  * @uses $vars['entity']    ElggEntity
- * @uses $vars['title']     Title link (optional)
+ * @uses $vars['title']     Title link (optional) false = no title, '' = default
  * @uses $vars['metadata']  HTML for entity metadata and actions (optional)
  * @uses $vars['subtitle']  HTML for the subtitle (optional)
  * @uses $vars['tags']      HTML for the tags (optional)
@@ -20,7 +20,7 @@
 $entity = $vars['entity'];
 
 $title_link = elgg_get_array_value('title', $vars, '');
-if (!$title_link) {
+if ($title_link === '') {
        $params = array(
                'text' => $entity->title,
                'href' => $entity->getURL(),