generate links for apinamespace.org/atom and /twitter in userxrd
This commit is contained in:
parent
eab8d752e8
commit
57859a4bc8
|
@ -97,11 +97,24 @@ class XrdAction extends Action
|
||||||
'href' => common_local_url('foaf',
|
'href' => common_local_url('foaf',
|
||||||
array('nickname' => $nick)));
|
array('nickname' => $nick)));
|
||||||
|
|
||||||
|
$xrd->links[] = array('rel' => 'http://apinamespace.org/atom',
|
||||||
|
'type' => 'application/atomsvc+xml',
|
||||||
|
'href' => common_local_url('ApiAtomService', array('id' => $nick)));
|
||||||
|
|
||||||
|
if (common_config('site', 'fancy')) {
|
||||||
|
$apiRoot = common_path('api/', true);
|
||||||
|
} else {
|
||||||
|
$apiRoot = common_path('index.php/api/', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
$xrd->links[] = array('rel' => 'http://apinamespace.org/twitter',
|
||||||
|
'href' => $apiRoot,
|
||||||
|
'property' => array(array('type' => 'http://apinamespace.org/twitter/username',
|
||||||
|
'value' => $nick)));
|
||||||
|
|
||||||
Event::handle('EndXrdActionLinks', array(&$xrd, $this->user));
|
Event::handle('EndXrdActionLinks', array(&$xrd, $this->user));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
header('Content-type: application/xrd+xml');
|
header('Content-type: application/xrd+xml');
|
||||||
print $xrd->toXML();
|
print $xrd->toXML();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user