From 55655ba319d633b19f3fc0c38d57b7d93e9e56b3 Mon Sep 17 00:00:00 2001 From: Hannes Mannerheim Date: Fri, 9 Oct 2015 16:16:13 +0200 Subject: [PATCH] make event location federate --- plugins/Event/EventPlugin.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugins/Event/EventPlugin.php b/plugins/Event/EventPlugin.php index 5f20031693..75bdfd2ec3 100644 --- a/plugins/Event/EventPlugin.php +++ b/plugins/Event/EventPlugin.php @@ -157,6 +157,13 @@ class EventPlugin extends MicroAppPlugin throw new Exception(_m('No end date for event.')); } + // location is optional + $location = null; + $location_object = $happeningObj->element->getElementsByTagName('location'); + if($location_object->length > 0) { + $location = $location_object->item(0)->nodeValue; + } + $notice = null; switch ($activity->verb) { @@ -166,7 +173,7 @@ class EventPlugin extends MicroAppPlugin $dtstart->item(0)->nodeValue, $dtend->item(0)->nodeValue, $happeningObj->title, - null, + $location, $happeningObj->summary, null, $options); @@ -243,9 +250,9 @@ class EventPlugin extends MicroAppPlugin array('xmlns' => 'urn:ietf:params:xml:ns:xcal'), common_date_iso8601($happening->end_time)); - // FIXME: add location - // FIXME: add URL + $obj->extra[] = array('location', false, $happening->location); + // FIXME: add URL // XXX: probably need other stuff here return $obj; -- 2.39.5