summaryrefslogtreecommitdiff
path: root/lib/attachmentlist.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-05-26 23:24:01 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-05-26 23:24:01 -0400
commit648d967226f3b47aa6237d2be9d1a82df4f78402 (patch)
tree2592f56f0073ee21ce320a158233fdb1bd2710c4 /lib/attachmentlist.php
parent6335c9cf59b384da24506c4a3f799315fbbc4b09 (diff)
parent0b53a820c2b4224b66b2a24f67302b4c5ca1deed (diff)
Merge branch '0.8.x' into userdesign
Conflicts: lib/attachmentlist.php lib/noticelist.php
Diffstat (limited to 'lib/attachmentlist.php')
-rw-r--r--lib/attachmentlist.php31
1 files changed, 12 insertions, 19 deletions
diff --git a/lib/attachmentlist.php b/lib/attachmentlist.php
index 8d6d19f2a..dcf59b1bc 100644
--- a/lib/attachmentlist.php
+++ b/lib/attachmentlist.php
@@ -79,9 +79,9 @@ class AttachmentList extends Widget
function show()
{
-// $this->out->elementStart('div', array('id' =>'attachments_primary'));
- $this->out->elementStart('div', array('id' =>'content'));
- $this->out->element('h2', null, _('Attachments'));
+ $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;
@@ -91,8 +91,9 @@ class AttachmentList extends Widget
$item->show();
}
+ $this->out->elementEnd('dd');
$this->out->elementEnd('ul');
- $this->out->elementEnd('div');
+ $this->out->elementEnd('dl');
return count($att);
}
@@ -170,7 +171,7 @@ class AttachmentListItem extends Widget
}
function linkTitle() {
- return 'Our page for ' . $this->title();
+ return $this->title();
}
/**
@@ -190,33 +191,25 @@ class AttachmentListItem extends Widget
}
function linkAttr() {
- return array('class' => 'attachment', 'href' => common_local_url('attachment', array('attachment' => $this->attachment->id)));
+ return array('class' => 'attachment', 'href' => $this->attachment->url, 'id' => 'attachment-' . $this->attachment->id);
}
function showLink() {
- $attr = $this->linkAttr();
- $text = $this->linkTitle();
- $this->out->elementStart('h4');
- $this->out->element('a', $attr, $text);
-
- if ($this->attachment->url !== $this->title())
- $this->out->element('span', null, " ({$this->attachment->url})");
-
- $this->out->elementEnd('h4');
+ $this->out->elementStart('a', $this->linkAttr());
+ $this->out->element('span', null, $this->linkTitle());
+ $this->showRepresentation();
+ $this->out->elementEnd('a');
}
function showNoticeAttachment()
{
$this->showLink();
- $this->showRepresentation();
}
function showRepresentation() {
$thumbnail = File_thumbnail::staticGet('file_id', $this->attachment->id);
if (!empty($thumbnail)) {
- $this->out->elementStart('a', $this->linkAttr()/*'href' => $this->linkTo()*/);
$this->out->element('img', array('alt' => 'nothing to say', 'src' => $thumbnail->url, 'width' => $thumbnail->width, 'height' => $thumbnail->height));
- $this->out->elementEnd('a');
}
}
@@ -258,7 +251,7 @@ class Attachment extends AttachmentListItem
}
function linkTitle() {
- return 'Direct link to ' . $this->title();
+ return $this->attachment->url;
}
function showRepresentation() {