123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?php
- if (!defined('STATUSNET')) {
-
-
- exit(1);
- }
- class BlogEntryListItem extends NoticeListItemAdapter
- {
- function showNotice()
- {
- $out = $this->nli->out;
- $out->elementStart('div', 'entry-title');
- $this->showAuthor();
- $this->showContent();
- $out->elementEnd('div');
- }
- function showContent()
- {
- $notice = $this->nli->notice;
- $out = $this->nli->out;
- $entry = Blog_entry::fromNotice($notice);
- if (empty($entry)) {
- throw new Exception('BlogEntryListItem used for non-blog notice.');
- }
- $out->elementStart('h4', array('class' => 'blog-entry-title'));
- $out->element('a', array('href' => $notice->getUrl()), $entry->title);
- $out->elementEnd('h4');
-
- $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->getUrl();
- $out->element('a',
- array('href' => $url,
- 'class' => 'blog-entry-link'),
- _('More...'));
- }
- }
- }
|