]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/inlineattachmentlist.php
Merge branch 'master' into social-master
[quix0rs-gnu-social.git] / lib / inlineattachmentlist.php
index a0243c825f673cffcfbf5398555ace1321540a8f..9016daf3f19845ef4289e1b48b36fe628fdc2e83 100644 (file)
@@ -35,12 +35,8 @@ class InlineAttachmentList extends AttachmentList
 {
     function showListStart()
     {
-        $this->out->elementStart('div', array('class' => 'entry-content thumbnails'));
-    }
-
-    function showListEnd()
-    {
-        $this->out->elementEnd('div');
+        $this->out->element('h3', null, _('Attachments'));
+        parent::showListStart();
     }
 
     /**
@@ -50,7 +46,7 @@ class InlineAttachmentList extends AttachmentList
      *
      * @return ListItem a list item for displaying the attachment
      */
-    function newListItem($attachment)
+    function newListItem(File $attachment)
     {
         return new InlineAttachmentListItem($attachment, $this->out);
     }
@@ -58,37 +54,9 @@ class InlineAttachmentList extends AttachmentList
 
 class InlineAttachmentListItem extends AttachmentListItem
 {
-    protected $thumb;
-
-    function show()
-    {
-        $this->thumb = parent::getThumbInfo();
-        if (!empty($this->thumb)) {
-            parent::show();
-        }
-
-    }
-
-    function getThumbInfo()
-    {
-        return $this->thumb;
-    }
-
     function showLink() {
-        $this->out->elementStart('a', $this->linkAttr());
+        $this->out->element('a', $this->linkAttr(), $this->title());
         $this->showRepresentation();
-        $this->out->elementEnd('a');
-    }
-
-    /**
-     * Build HTML attributes for the link
-     * @return array
-     */
-    function linkAttr()
-    {
-        $attr = parent::linkAttr();
-        $attr['class'] = 'attachment-thumbnail';
-        return $attr;
     }
 
     /**
@@ -100,7 +68,7 @@ class InlineAttachmentListItem extends AttachmentListItem
     {
         // XXX: RDFa
         // TODO: add notice_type class e.g., notice_video, notice_image
-        $this->out->elementStart('span', array('class' => 'inline-attachment'));
+        $this->out->elementStart('li', array('class' => 'inline-attachment'));
     }
 
     /**
@@ -112,6 +80,6 @@ class InlineAttachmentListItem extends AttachmentListItem
      */
     function showEnd()
     {
-        $this->out->elementEnd('span');
+        $this->out->elementEnd('li');
     }
 }