]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/foaf.php
Make page titles more consistent: no title case in four cases.
[quix0rs-gnu-social.git] / actions / foaf.php
index dd274706981584fb063d20c965d1e11a9047331a..e9f67b7f2bd0208e248bff5d30a8857a9e4d5113 100644 (file)
@@ -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');
         }
@@ -136,7 +154,7 @@ class FoafAction extends Action
         $person = $this->showMicrobloggingAccount($this->profile,
                                      common_root_url(), $this->user->uri, false);
 
-        // Get users who subscribe to user
+        // Get people who subscribe to user
 
         $sub = new Subscription();
         $sub->subscribed = $this->profile->id;
@@ -250,7 +268,7 @@ class FoafAction extends Action
         if ($isSubscriber) {
              $this->element('sioc:follows', array('rdf:resource'=>$this->user->uri . '#acct'));
         } else {
-            // Get users user is subscribed to
+            // Get people user is subscribed to
             $sub = new Subscription();
             $sub->subscriber = $profile->id;
             $sub->whereAdd('subscriber != subscribed');