summaryrefslogtreecommitdiff
path: root/lib/attachmentlist.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-06-09 21:51:24 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-06-09 21:51:24 -0700
commit4df1ea49ec75ec9dd64bc8f58c01e64ea18bedc7 (patch)
tree91535b33cd2b62b0726821e4d217d587da7cd61b /lib/attachmentlist.php
parentb3628b78448266fda2368f1317e70d1cca45ac17 (diff)
parented627bb4bd6424325478412055d295b185f9f662 (diff)
Merge branch '0.8.x' into userdesign
Conflicts: actions/designsettings.php
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 {