]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Blog/blogentrylistitem.php
Merge branch '1.0.x' of gitorious.org:statusnet/mainline into 1.0.x
[quix0rs-gnu-social.git] / plugins / Blog / blogentrylistitem.php
index 44775d8a3de0e5c906c0e427cf3518b03825abf3..a89a562b77d003d9d3feaec831c2371ff08bd7c3 100644 (file)
@@ -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...'));
+        }
     }
 }