]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add xcal namespaces to location and url in event
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 20 Jan 2016 20:07:55 +0000 (21:07 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 20 Jan 2016 20:07:55 +0000 (21:07 +0100)
Also, for fun, add stuff for RSS event module, see:
   http://web.resource.org/rss/1.0/modules/event/

plugins/Event/actions/newevent.php

index 02daeb6d964bd84b9afdc82b80d0866a436180b6..023aee6c75f033334c16a69c5756d1a136d95716 100644 (file)
@@ -133,15 +133,29 @@ class NeweventAction extends FormAction
         $actobj->type = Happening::OBJECT_TYPE;
         $actobj->title = $title;
         $actobj->summary = $description;
-
         $actobj->extra[] = array('dtstart',
-                              array('xmlns' => 'urn:ietf:params:xml:ns:xcal'),
-                              common_date_iso8601($start_str));
+                                array('xmlns' => 'urn:ietf:params:xml:ns:xcal'),
+                                common_date_iso8601($start_str));
         $actobj->extra[] = array('dtend',
-                              array('xmlns' => 'urn:ietf:params:xml:ns:xcal'),
-                              common_date_iso8601($end_str));
-        $actobj->extra[] = array('location', false, $location);
-        $actobj->extra[] = array('url', false, $url);
+                                array('xmlns' => 'urn:ietf:params:xml:ns:xcal'),
+                                common_date_iso8601($end_str));
+        $actobj->extra[] = array('location',
+                                array('xmlns' => 'urn:ietf:params:xml:ns:xcal'),
+                                $location);
+        $actobj->extra[] = array('url',
+                                array('xmlns' => 'urn:ietf:params:xml:ns:xcal'),
+                                $url);
+
+        /* We don't use these ourselves, but we add them to be nice RSS/XML citizens */
+        $actobj->extra[] = array('startdate',
+                                array('xmlns' => 'http://purl.org/rss/1.0/modules/event/'),
+                                common_date_iso8601($start_str));
+        $actobj->extra[] = array('enddate',
+                                array('xmlns' => 'http://purl.org/rss/1.0/modules/event/'),
+                                common_date_iso8601($end_str));
+        $actobj->extra[] = array('location',
+                                array('xmlns' => 'http://purl.org/rss/1.0/modules/event/'),
+                                $location);
 
         $act->objects = array($actobj);