From 3d25a1293f4caf6b94e87bc214c1631ea1164229 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 4 Dec 2010 13:36:24 +0000 Subject: fitting blog object display into new html structure git-svn-id: http://code.elgg.org/elgg/trunk@7527 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/blog/views/default/blog/css.php | 4 +- mod/blog/views/default/object/blog.php | 81 +++++++++++++++++----------------- 2 files changed, 42 insertions(+), 43 deletions(-) (limited to 'mod/blog/views/default') diff --git a/mod/blog/views/default/blog/css.php b/mod/blog/views/default/blog/css.php index 0cd539ca4..5808cc167 100644 --- a/mod/blog/views/default/blog/css.php +++ b/mod/blog/views/default/blog/css.php @@ -5,9 +5,6 @@ * @package Blog */ ?> -.blogpost { - border-bottom:1px dotted #CCCCCC; -} .blogpost .entity-listing-icon { margin-top:6px; } @@ -16,6 +13,7 @@ } .blog_post { border-top:1px solid #CCCCCC; + border-bottom:1px dotted #CCCCCC; margin:10px 0 0; padding-bottom:40px; padding-top:10px; diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php index b4ce94236..975ea713a 100644 --- a/mod/blog/views/default/object/blog.php +++ b/mod/blog/views/default/object/blog.php @@ -5,11 +5,11 @@ * @package Blog */ -$full = (isset($vars['full'])) ? $vars['full'] : FALSE; -$blog = (isset($vars['entity'])) ? $vars['entity'] : FALSE; +$full = elgg_get_array_value('full', $vars, FALSE); +$blog = elgg_get_array_value('entity', $vars, FALSE); if (!$blog) { - return ''; + return TRUE; } $owner = get_entity($blog->owner_guid); @@ -20,11 +20,11 @@ $excerpt = $blog->excerpt; $body = autop($blog->description); $owner_icon = elgg_view('profile/icon', array('entity' => $owner, 'size' => 'tiny')); -$owner_blog_link = "username\">{$owner->name}"; +$owner_blog_link = "username\">{$owner->name}"; $author_text = elgg_echo('blog:author_by_line', array($owner_blog_link)); -if($blog->tags){ - $tags = "

" . elgg_view('output/tags', array('tags' => $blog->tags)) . "

"; -}else{ +if ($blog->tags) { + $tags = "

" . elgg_view('output/tags', array('tags' => $blog->tags)) . "

"; +} else { $tags = ""; } $date = elgg_view_friendly_time($blog->publish_date); @@ -33,20 +33,20 @@ $date = elgg_view_friendly_time($blog->publish_date); if ($blog->comments_on != 'Off') { $comments_count = elgg_count_comments($blog); //only display if there are commments - if($comments_count != 0){ - $comments_link = "getURL()}#annotations\">" . elgg_echo("comments") . " (". $comments_count .")"; - }else{ + if ($comments_count != 0) { + $text = elgg_echo("comments") . " ($comments_count)"; + $comments_link = "getURL()}#annotations\">$text"; + } else { $comments_link = ''; } } else { $comments_link = ''; } -// links to delete or edit. - // access is always shown. $edit = elgg_view('output/access', array('entity' => $vars['entity'])); +// links to delete or edit. if ($blog->canEdit()) { $edit_url = elgg_get_site_url()."pg/blog/{$owner->username}/edit/{$blog->getGUID()}/"; $edit_link = "" . elgg_echo('edit') . ''; @@ -67,40 +67,41 @@ if ($blog->canEdit()) { $edit .= "$status $edit_link $delete_link"; } - // include a view for plugins to extend - $edit = elgg_view("blogs/options", array("object_type" => 'blog', 'entity' => $blog)) . - elgg_view_likes($blog) . // include likes - $edit; +// include a view for plugins to extend +$edit = elgg_view("blogs/options", array("object_type" => 'blog', 'entity' => $blog)) . + elgg_view_likes($blog) . $edit; if ($full) { -echo <<<___END -
-
-

{$blog->title}

-
-
-
- $owner_icon -
-
- -

- $author_text - $date - $categories - $comments_link -

- $tags -
-
-
$body
+ $params = array( + 'title' => $blog->title, + 'buttons' => '', + ); + $header = elgg_view('content/header', $params); + +echo <<<___HTML +$header +
+ $owner_icon +
+
+ +

+ $author_text + $date + $categories + $comments_link +

+ $tags +
+
+ $body
-___END; +___HTML; } else { - echo <<<___END + echo <<<___HTML
$owner_icon @@ -119,5 +120,5 @@ ___END;
-___END; +___HTML; } -- cgit v1.2.3