From 3f607ff2091c7fa146063b496359438f477276eb Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Fri, 28 May 2010 16:16:09 +0200 Subject: [PATCH] Import/export geolocation to/from iCalendar. --- kronolith/lib/Event.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kronolith/lib/Event.php b/kronolith/lib/Event.php index a979ec12a..6c9db6394 100644 --- a/kronolith/lib/Event.php +++ b/kronolith/lib/Event.php @@ -580,6 +580,9 @@ abstract class Kronolith_Event if (!empty($this->location)) { $vEvent->setAttribute('LOCATION', $v1 ? $this->location : Horde_String::convertCharset($this->location, Horde_Nls::getCharset(), 'utf-8')); } + if ($this->geoLocation) { + $vEvent->setAttribute('GEO', array('latitude' => $this->geoLocation['lat'], 'longitude' => $this->geoLocation['lon'])); + } // URL if (!empty($this->url)) { @@ -799,6 +802,12 @@ abstract class Kronolith_Event if (!is_array($location) && !($location instanceof PEAR_Error)) { $this->location = $location; } + $geolocation = $vEvent->getAttribute('GEO'); + if (!($geolocation instanceof PEAR_Error)) { + $this->geolocation = array( + 'lat' => $geolocation['latitude'], + 'lon' => $geolocation['longitude']); + } // Class $class = $vEvent->getAttribute('CLASS'); -- 2.11.0