summaryrefslogtreecommitdiff
path: root/lib/attachmentlist.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/attachmentlist.php')
-rw-r--r--lib/attachmentlist.php28
1 files changed, 23 insertions, 5 deletions
diff --git a/lib/attachmentlist.php b/lib/attachmentlist.php
index dcf59b1bc..e1726df28 100644
--- a/lib/attachmentlist.php
+++ b/lib/attachmentlist.php
@@ -79,20 +79,21 @@ class AttachmentList extends Widget
function show()
{
- $this->out->elementStart('dl', array('id' =>'attachment'));
+ $atts = new File;
+ $att = $atts->getAttachments($this->notice->id);
+ if (empty($att)) return 0;
+ $this->out->elementStart('dl', array('id' =>'attachments'));
$this->out->element('dt', null, _('Attachments'));
$this->out->elementStart('dd');
- $this->out->elementStart('ul', array('class' => 'attachments'));
+ $this->out->elementStart('ol', array('class' => 'attachments'));
- $atts = new File;
- $att = $atts->getAttachments($this->notice->id);
foreach ($att as $n=>$attachment) {
$item = $this->newListItem($attachment);
$item->show();
}
$this->out->elementEnd('dd');
- $this->out->elementEnd('ul');
+ $this->out->elementEnd('ol');
$this->out->elementEnd('dl');
return count($att);
@@ -266,6 +267,23 @@ class Attachment extends AttachmentListItem
case 'image/jpeg':
$this->out->element('img', array('src' => $this->attachment->url, 'alt' => 'alt'));
break;
+
+ case 'application/ogg':
+ case 'audio/x-speex':
+ case 'video/mpeg':
+ case 'audio/mpeg':
+ case 'video/mp4':
+ case 'video/quicktime':
+ $arr = array('type' => $this->attachment->mimetype,
+ 'data' => $this->attachment->url,
+ 'width' => 320,
+ 'height' => 240
+ );
+ $this->out->elementStart('object', $arr);
+ $this->out->element('param', array('name' => 'src', 'value' => $this->attachment->url));
+ $this->out->element('param', array('name' => 'autoStart', 'value' => 1));
+ $this->out->elementEnd('object');
+ break;
}
}
} else {