Single anchor to include thumbnail and title for attachment

This commit is contained in:
Robin Millette 2009-05-25 15:38:50 -04:00
parent 7923e84fba
commit 594454ced3
1 changed files with 4 additions and 5 deletions

View File

@ -198,23 +198,22 @@ class AttachmentListItem extends Widget
$attr = $this->linkAttr(); $attr = $this->linkAttr();
$text = $this->linkTitle(); $text = $this->linkTitle();
$this->out->elementStart('h4'); $this->out->elementStart('h4');
$this->out->element('a', $attr, $text); $this->out->elementStart('a', $attr);
$this->out->element('span', null, $text);
$this->showRepresentation();
$this->out->elementEnd('a');
$this->out->elementEnd('h4'); $this->out->elementEnd('h4');
} }
function showNoticeAttachment() function showNoticeAttachment()
{ {
$this->showLink(); $this->showLink();
$this->showRepresentation();
} }
function showRepresentation() { function showRepresentation() {
$thumbnail = File_thumbnail::staticGet('file_id', $this->attachment->id); $thumbnail = File_thumbnail::staticGet('file_id', $this->attachment->id);
if (!empty($thumbnail)) { 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->element('img', array('alt' => 'nothing to say', 'src' => $thumbnail->url, 'width' => $thumbnail->width, 'height' => $thumbnail->height));
$this->out->elementEnd('a');
} }
} }