From b5c5d8d3933c9694bd105fc1e1f06bc96da2dc79 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 24 Aug 2011 14:57:05 -0400 Subject: [PATCH] correctly show the blog content for blog entries --- plugins/Blog/blogentrylistitem.php | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/plugins/Blog/blogentrylistitem.php b/plugins/Blog/blogentrylistitem.php index 374c456028..a89a562b77 100644 --- a/plugins/Blog/blogentrylistitem.php +++ b/plugins/Blog/blogentrylistitem.php @@ -71,15 +71,31 @@ class BlogEntryListItem extends NoticeListItemAdapter $out->element('a', array('href' => $notice->bestUrl()), $entry->title); $out->elementEnd('h4'); - if (!empty($entry->summary)) { - $out->elementStart('div', 'blog-entry-summary'); - $out->raw($entry->summary); - $out->elementEnd('div'); - } else { - // XXX: hide content initially; click More... for full text. + // XXX: kind of a hack + + $actionName = $out->trimmed('action'); + + if ($actionName == 'shownotice' || + $actionName == 'showblogentry' || + $actionName == 'conversation') { + $out->elementStart('div', 'blog-entry-content'); $out->raw($entry->content); $out->elementEnd('div'); + + } else { + + if (!empty($entry->summary)) { + $out->elementStart('div', 'blog-entry-summary'); + $out->raw($entry->summary); + $out->elementEnd('div'); + } + + $url = ($entry->url) ? $entry->url : $notice->bestUrl(); + $out->element('a', + array('href' => $url, + 'class' => 'blog-entry-link'), + _('More...')); } } }