From 6308539c1d669ad0b6072b48deeaa95969ebe318 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 15 Jul 2009 15:11:29 -0400 Subject: Added oEmbed discovery for attachments and notices --- actions/attachment.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'actions/attachment.php') diff --git a/actions/attachment.php b/actions/attachment.php index ee4cd9640..c9c416cb5 100644 --- a/actions/attachment.php +++ b/actions/attachment.php @@ -98,6 +98,28 @@ class AttachmentAction extends Action return $a->title(); } + function extraHead() + { + $this->element('link',array('rel'=>'alternate', + 'type'=>'application/json+oembed', + 'href'=>common_local_url( + 'api', + array('apiaction'=>'laconica','method'=>'oembed.json'), + array('url'=> + common_local_url('attachment', + array('attachment' => $this->attachment->id)))), + 'title'=>'oEmbed'),null); + $this->element('link',array('rel'=>'alternate', + 'type'=>'text/xml+oembed', + 'href'=>common_local_url( + 'api', + array('apiaction'=>'laconica','method'=>'oembed.xml'), + array('url'=> + common_local_url('attachment', + array('attachment' => $this->attachment->id)))), + 'title'=>'oEmbed'),null); + } + /** * Handle input * -- cgit v1.2.3-54-g00ecf