X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FBlog%2Fblogentrylistitem.php;h=a89a562b77d003d9d3feaec831c2371ff08bd7c3;hb=7dcb27672fa3f234f1fdfab5024752614e805341;hp=44775d8a3de0e5c906c0e427cf3518b03825abf3;hpb=cd7d0eae4a8d46bb194dc49c7b4241527c032823;p=quix0rs-gnu-social.git diff --git a/plugins/Blog/blogentrylistitem.php b/plugins/Blog/blogentrylistitem.php index 44775d8a3d..a89a562b77 100644 --- a/plugins/Blog/blogentrylistitem.php +++ b/plugins/Blog/blogentrylistitem.php @@ -49,10 +49,11 @@ class BlogEntryListItem extends NoticeListItemAdapter { function showNotice() { - $this->out->elementStart('div', 'entry-title'); + $out = $this->nli->out; + $out->elementStart('div', 'entry-title'); $this->showAuthor(); $this->showContent(); - $this->out->elementEnd('div'); + $out->elementEnd('div'); } function showContent() @@ -60,7 +61,7 @@ class BlogEntryListItem extends NoticeListItemAdapter $notice = $this->nli->notice; $out = $this->nli->out; - $entry = BlogEntry::fromNotice($notice); + $entry = Blog_entry::fromNotice($notice); if (empty($entry)) { throw new Exception('BlogEntryListItem used for non-blog notice.'); @@ -70,10 +71,31 @@ class BlogEntryListItem extends NoticeListItemAdapter $out->element('a', array('href' => $notice->bestUrl()), $entry->title); $out->elementEnd('h4'); - $out->element('div', 'blog-entry-summary', $entry->summary); + // XXX: kind of a hack - // XXX: hide content initially; click More... for full text. + $actionName = $out->trimmed('action'); - $out->element('div', 'blog-entry-content', $entry->content); + 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...')); + } } }