From 4463768baed036b487d473a60b30f0c314ee1673 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Thu, 19 Nov 2009 12:00:25 -0500 Subject: tobyink's location RDF patch --- lib/location.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lib/location.php') diff --git a/lib/location.php b/lib/location.php index bbfc15a36..191550d6d 100644 --- a/lib/location.php +++ b/lib/location.php @@ -52,6 +52,7 @@ class Location public $location_id; public $location_ns; private $_url; + private $_rdfurl; var $names = array(); @@ -185,4 +186,27 @@ class Location return $url; } + + /** + * Get an URL for this location, suitable for embedding in RDF + * + * @return string URL for this location or NULL + */ + + function getRdfURL() + { + // Keep one cached + + if (is_string($this->_rdfurl)) { + return $this->_rdfurl; + } + + $url = null; + + Event::handle('LocationRdfUrl', array($this, &$url)); + + $this->_rdfurl = $url; + + return $url; + } } -- cgit v1.2.3-54-g00ecf