summaryrefslogtreecommitdiff
path: root/actions/foaf.php
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2009-11-19 17:35:45 +0000
committerSarven Capadisli <csarven@status.net>2009-11-19 17:35:45 +0000
commit318dd70de888513a5b0404c5eb1cdbb3c6e8e760 (patch)
tree9fbd3a33126978200ce5854ec87067935b592417 /actions/foaf.php
parent60391d0b96579aff2ee105ab64a89ffdb225bbdc (diff)
parentee22b2ccf9819cefba54ef38c6a57829c7d3fa73 (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'actions/foaf.php')
-rw-r--r--actions/foaf.php26
1 files changed, 22 insertions, 4 deletions
diff --git a/actions/foaf.php b/actions/foaf.php
index 356393304..e9f67b7f2 100644
--- a/actions/foaf.php
+++ b/actions/foaf.php
@@ -108,11 +108,29 @@ class FoafAction extends Action
if ($this->profile->bio) {
$this->element('bio:olb', null, $this->profile->bio);
}
- // XXX: more structured location data
- if ($this->profile->location) {
+
+ $location = $this->profile->getLocation();
+ if ($location) {
+ $attr = array();
+ if ($location->getRdfURL()) {
+ $attr['rdf:about'] = $location->getRdfURL();
+ }
+ $location_name = $location->getName();
+
$this->elementStart('based_near');
- $this->elementStart('geo:SpatialThing');
- $this->element('name', null, $this->profile->location);
+ $this->elementStart('geo:SpatialThing', $attr);
+ if ($location_name) {
+ $this->element('name', null, $location_name);
+ }
+ if ($location->lat) {
+ $this->element('geo:lat', null, $location->lat);
+ }
+ if ($location->lon) {
+ $this->element('geo:long', null, $location->lat);
+ }
+ if ($location->getURL()) {
+ $this->element('page', array('rdf:resource'=>$location->getURL()));
+ }
$this->elementEnd('geo:SpatialThing');
$this->elementEnd('based_near');
}