return $filepath;
}
+ public function getAttachmentUrl()
+ {
+ return common_local_url('attachment', array('attachment'=>$this->getID()));
+ }
+
public function getUrl($prefer_local=true)
{
if ($prefer_local && !empty($this->filename)) {
$object->type = self::mimeTypeToObjectType($file->mimetype);
$object->id = TagURI::mint(sprintf("file:%d", $file->id));
- $object->link = common_local_url('attachment', array('attachment' => $file->id));
+ $object->link = $file->getAttachmentUrl();
if ($file->title) {
$object->title = $file->title;
function linkAttr() {
return array('class' => 'attachment',
- 'href' => $this->attachment->getUrl(false),
- 'id' => 'attachment-' . $this->attachment->id,
+ 'href' => $this->attachment->getAttachmentUrl(),
+ 'id' => 'attachment-' . $this->attachment->getID(),
'title' => $this->linkTitle());
}