summaryrefslogtreecommitdiff
path: root/lib/attachmentlist.php
diff options
context:
space:
mode:
authorRobin Millette <millette@controlyourself.ca>2009-05-26 21:20:04 -0400
committerRobin Millette <millette@controlyourself.ca>2009-05-26 21:20:04 -0400
commitaf700ea27703bbec5aa1078a84f9fd44c0260322 (patch)
treea227167390948f5791b8190435fbb9cfdbd0bc38 /lib/attachmentlist.php
parent4edb1c6e0cfcaee256757ed20b4ff8d482158906 (diff)
Let's you upload a file with a notice and have it shown with other attachments.
Diffstat (limited to 'lib/attachmentlist.php')
-rw-r--r--lib/attachmentlist.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/attachmentlist.php b/lib/attachmentlist.php
index d0478bad3..a58a50f6f 100644
--- a/lib/attachmentlist.php
+++ b/lib/attachmentlist.php
@@ -80,13 +80,15 @@ class AttachmentList extends Widget
function show()
{
+ $atts = new File;
+ $att = $atts->getAttachments($this->notice->id);
+ if (empty($att)) return 0;
+
$this->out->elementStart('dl', array('id' =>'attachment'));
$this->out->element('dt', null, _('Attachments'));
$this->out->elementStart('dd');
$this->out->elementStart('ul', array('class' => 'attachments'));
- $atts = new File;
- $att = $atts->getAttachments($this->notice->id);
foreach ($att as $n=>$attachment) {
$item = $this->newListItem($attachment);
$item->show();