]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/attachmentlist.php
Merge branch 'fixes/private_scope_on_tags' into social-master
[quix0rs-gnu-social.git] / lib / attachmentlist.php
index 6609cb40daecc66c64492d02bcbf7338b3772d4d..a784066fdadf78b413051a53682e82e1b11062c5 100644 (file)
@@ -74,28 +74,38 @@ class AttachmentList extends Widget
      */
     function show()
     {
-       $att = $this->notice->attachments();
-        if (empty($att)) return 0;
+       $attachments = $this->notice->attachments();
+        $representable = false;
+        foreach ($attachments as $key=>$att) {
+            // Only show attachments representable with a title
+            if ($att->getTitle() === null) {
+                unset($attachments[$key]);
+            }
+        }
+        if (!count($attachments)) {
+            return 0;
+        }
+
         $this->showListStart();
 
-        foreach ($att as $n=>$attachment) {
-            $item = $this->newListItem($attachment);
+        foreach ($attachments as $att) {
+            $item = $this->newListItem($att);
             $item->show();
         }
 
         $this->showListEnd();
 
-        return count($att);
+        return count($attachments);
     }
 
     function showListStart()
     {
-        $this->out->elementStart('ol', array('class' => 'attachments'));
+        $this->out->elementStart('div', array('class' => 'attachments'));
     }
 
     function showListEnd()
     {
-        $this->out->elementEnd('ol');
+        $this->out->elementEnd('div');
     }
 
     /**