aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-04 13:36:24 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-04 13:36:24 +0000
commit3d25a1293f4caf6b94e87bc214c1631ea1164229 (patch)
treefa73e6014ea12c5a97320d30ec2d1b26843160f2 /mod
parent9bb7b4c8afddc734adfd2717d766d1711cf8127c (diff)
downloadelgg-3d25a1293f4caf6b94e87bc214c1631ea1164229.tar.gz
elgg-3d25a1293f4caf6b94e87bc214c1631ea1164229.tar.bz2
fitting blog object display into new html structure
git-svn-id: http://code.elgg.org/elgg/trunk@7527 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r--mod/blog/views/default/blog/css.php4
-rw-r--r--mod/blog/views/default/object/blog.php81
2 files changed, 42 insertions, 43 deletions
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 = "<a href=\"".elgg_get_site_url()."pg/blog/$owner->username\">{$owner->name}</a>";
+$owner_blog_link = "<a href=\"" . elgg_get_site_url() . "pg/blog/$owner->username\">{$owner->name}</a>";
$author_text = elgg_echo('blog:author_by_line', array($owner_blog_link));
-if($blog->tags){
- $tags = "<p class=\"tags\">" . elgg_view('output/tags', array('tags' => $blog->tags)) . "</p>";
-}else{
+if ($blog->tags) {
+ $tags = "<p class=\"elgg-tags\">" . elgg_view('output/tags', array('tags' => $blog->tags)) . "</p>";
+} 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 = "<a href=\"{$blog->getURL()}#annotations\">" . elgg_echo("comments") . " (". $comments_count .")</a>";
- }else{
+ if ($comments_count != 0) {
+ $text = elgg_echo("comments") . " ($comments_count)";
+ $comments_link = "<a href=\"{$blog->getURL()}#annotations\">$text</a>";
+ } 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 = "<span class='entity-edit'><a href=\"$edit_url\">" . elgg_echo('edit') . '</a></span>';
@@ -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
-<div class="blogpost clearfix">
- <div id="content-header" class="clearfix">
- <div class="content-header-title"><h2>{$blog->title}</h2></div>
- </div>
- <div class="clearfix">
- <div class="entity-listing-icon">
- $owner_icon
- </div>
- <div class="entity-listing-info">
- <div class="entity-metadata">$edit</div>
- <p class="entity-subtext">
- $author_text
- $date
- $categories
- $comments_link
- </p>
- $tags
- </div>
- </div>
- <div class='blog_post'>$body</div>
+ $params = array(
+ 'title' => $blog->title,
+ 'buttons' => '',
+ );
+ $header = elgg_view('content/header', $params);
+
+echo <<<___HTML
+$header
+<div class="entity-listing-icon">
+ $owner_icon
+</div>
+<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>
+<div class='blog_post'>
+ $body
</div>
-___END;
+___HTML;
} else {
- echo <<<___END
+ echo <<<___HTML
<div class="blog $status_class entity-listing clearfix">
<div class="entity-listing-icon">
$owner_icon
@@ -119,5 +120,5 @@ ___END;
</div>
</div>
-___END;
+___HTML;
}