X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Finlineattachmentlist.php;h=8b055a9cfc3244e737c4f2dbbbcf768b3d1b2fdf;hb=586fb5a5175d7a10f5f78dd026434e48202e5451;hp=a0243c825f673cffcfbf5398555ace1321540a8f;hpb=59043dca7fb6f974b11797c4d0f20e5b78b0611d;p=quix0rs-gnu-social.git diff --git a/lib/inlineattachmentlist.php b/lib/inlineattachmentlist.php index a0243c825f..8b055a9cfc 100644 --- a/lib/inlineattachmentlist.php +++ b/lib/inlineattachmentlist.php @@ -27,20 +27,14 @@ * @link http://status.net/ */ -if (!defined('STATUSNET')) { - exit(1); -} +if (!defined('GNUSOCIAL')) { exit(1); } class InlineAttachmentList extends AttachmentList { function showListStart() { - $this->out->elementStart('div', array('class' => 'entry-content thumbnails')); - } - - function showListEnd() - { - $this->out->elementEnd('div'); + $this->out->element('h4', 'attachments-title', _('Attachments')); + parent::showListStart(); } /** @@ -50,68 +44,8 @@ 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); } } - -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->showRepresentation(); - $this->out->elementEnd('a'); - } - - /** - * Build HTML attributes for the link - * @return array - */ - function linkAttr() - { - $attr = parent::linkAttr(); - $attr['class'] = 'attachment-thumbnail'; - return $attr; - } - - /** - * start a single notice. - * - * @return void - */ - function showStart() - { - // XXX: RDFa - // TODO: add notice_type class e.g., notice_video, notice_image - $this->out->elementStart('span', array('class' => 'inline-attachment')); - } - - /** - * finish the notice - * - * Close the last elements in the notice list item - * - * @return void - */ - function showEnd() - { - $this->out->elementEnd('span'); - } -}