From: Jan Schneider Date: Fri, 28 May 2010 14:16:09 +0000 (+0200) Subject: Import/export geolocation to/from iCalendar. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=3f607ff2091c7fa146063b496359438f477276eb;p=horde.git Import/export geolocation to/from iCalendar. --- 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');