summaryrefslogtreecommitdiff
path: root/lib/attachmentlist.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@status.net>2010-11-09 10:45:19 -0800
committerBrion Vibber <brion@status.net>2010-11-09 10:45:19 -0800
commitf25accc43ea1e66f290c8bc1d284ae04b4bf004f (patch)
treee8b369f4cf7342017569ee5a8d21380bbed5d59e /lib/attachmentlist.php
parent504529e8cd8fbaf5e8e1b980260d1d87d9e880ac (diff)
split out InlineAttachmentList from AttachmentList
Diffstat (limited to 'lib/attachmentlist.php')
-rw-r--r--lib/attachmentlist.php32
1 files changed, 20 insertions, 12 deletions
diff --git a/lib/attachmentlist.php b/lib/attachmentlist.php
index 8e6ad038a..f9ef7499e 100644
--- a/lib/attachmentlist.php
+++ b/lib/attachmentlist.php
@@ -79,23 +79,33 @@ class AttachmentList extends Widget
$atts = new File;
$att = $atts->getAttachments($this->notice->id);
if (empty($att)) return 0;
+ $this->showListStart();
+
+ foreach ($att as $n=>$attachment) {
+ $item = $this->newListItem($attachment);
+ $item->show();
+ }
+
+ $this->showListEnd();
+
+ return count($att);
+ }
+
+ function showListStart()
+ {
$this->out->elementStart('dl', array('id' =>'attachments',
'class' => 'entry-content'));
// TRANS: DT element label in attachment list.
$this->out->element('dt', null, _('Attachments'));
$this->out->elementStart('dd');
$this->out->elementStart('ol', array('class' => 'attachments'));
+ }
- foreach ($att as $n=>$attachment) {
- $item = $this->newListItem($attachment);
- $item->show();
- }
-
+ function showListEnd()
+ {
$this->out->elementEnd('dd');
$this->out->elementEnd('ol');
$this->out->elementEnd('dl');
-
- return count($att);
}
/**
@@ -181,11 +191,9 @@ class AttachmentListItem extends Widget
*/
function show()
{
- if ($this->attachment->isEnclosure()) {
- $this->showStart();
- $this->showNoticeAttachment();
- $this->showEnd();
- }
+ $this->showStart();
+ $this->showNoticeAttachment();
+ $this->showEnd();
}
function linkAttr() {