summaryrefslogtreecommitdiff
path: root/lib/attachmentlist.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-05-26 17:28:12 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-05-26 17:28:12 -0400
commit0b53a820c2b4224b66b2a24f67302b4c5ca1deed (patch)
tree67086e31a9437327898920996bede11c1668f0e2 /lib/attachmentlist.php
parent40d4668c7c5cdd41d36b878ad87f7737117efc9c (diff)
parentc93031c2aa49b8a044e896ca1e07f5f4f429308e (diff)
Merge branch '0.8.x' of git@gitorious.org:laconica/dev into 0.8.x
Diffstat (limited to 'lib/attachmentlist.php')
-rw-r--r--lib/attachmentlist.php32
1 files changed, 12 insertions, 20 deletions
diff --git a/lib/attachmentlist.php b/lib/attachmentlist.php
index 9485fe3d6..d0478bad3 100644
--- a/lib/attachmentlist.php
+++ b/lib/attachmentlist.php
@@ -80,9 +80,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;
@@ -92,8 +92,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);
}
@@ -171,7 +172,7 @@ class AttachmentListItem extends Widget
}
function linkTitle() {
- return 'Our page for ' . $this->title();
+ return $this->title();
}
/**
@@ -191,34 +192,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');
}
}
@@ -260,7 +252,7 @@ class Attachment extends AttachmentListItem
}
function linkTitle() {
- return 'Direct link to ' . $this->title();
+ return $this->attachment->url;
}
function showRepresentation() {