diff options
author | Sem <sembrestels@riseup.net> | 2013-11-09 16:24:39 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2013-11-09 16:24:39 +0100 |
commit | a9ac4c861335e60373c1e99b61372e6e0d6ac9f4 (patch) | |
tree | 84e660ad22367aab1697a1f910125f520243b882 /mod/event_calendar/views/ical/object | |
parent | 1f40407cb2d2f0edfc4cc5346f332f5c6adab022 (diff) | |
parent | b011a80767e1062a394b7bbbc3be3d2959a5f773 (diff) | |
download | elgg-a9ac4c861335e60373c1e99b61372e6e0d6ac9f4.tar.gz elgg-a9ac4c861335e60373c1e99b61372e6e0d6ac9f4.tar.bz2 |
Add 'mod/event_calendar/' from commit 'b011a80767e1062a394b7bbbc3be3d2959a5f773'
git-subtree-dir: mod/event_calendar
git-subtree-mainline: 1f40407cb2d2f0edfc4cc5346f332f5c6adab022
git-subtree-split: b011a80767e1062a394b7bbbc3be3d2959a5f773
Diffstat (limited to 'mod/event_calendar/views/ical/object')
-rw-r--r-- | mod/event_calendar/views/ical/object/event_calendar.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/mod/event_calendar/views/ical/object/event_calendar.php b/mod/event_calendar/views/ical/object/event_calendar.php new file mode 100644 index 000000000..36d71a66c --- /dev/null +++ b/mod/event_calendar/views/ical/object/event_calendar.php @@ -0,0 +1,44 @@ +<?php +$event = $vars['entity']; +if ($event->organizer) { + $organizer = "\nORGANIZER;CN={$event->organizer}\n"; +} else { + $organizer = ''; +} + +if ($event->description) { + // make sure that we are using Unix line endings + $description = str_replace("\r\n","\n",$event->description); + $description = str_replace("\r","\n",$description); + + // now convert to icalendar format + $description = str_replace("\n",'\n',$description); + $description = wordwrap($description,75,"\r\n ",TRUE); +} else { + $description = ''; +} +?> +BEGIN:VEVENT +UID:<?php echo elgg_get_site_url().'event_calendar/view/'.$event->guid; ?> + +URL:<?php echo elgg_get_site_url().'event_calendar/view/'.$event->guid; ?> + +DTSTAMP:<?php echo date("Ymd\THis\Z", $event->getTimeUpdated())?> + +CREATED:<?php echo date("Ymd\THis\Z", $event->getTimeCreated())?> + +LAST-MODIFIED:<?php echo date("Ymd\THis\Z", $event->getTimeUpdated()) ?> + +DTSTART;VALUE=DATE:<?php echo date("Ymd\THis\Z", $event->start_date); ?> + +DTEND;VALUE=DATE:<?php echo date("Ymd\THis\Z", $event->real_end_time); ?> + +SUMMARY:<?php echo $event->title; ?> + +DESCRIPTION:<?php echo $description; ?> + +LOCATION:<?php echo $event->venue; ?><?php echo $organizer; ?> + +CATEGORIES:<?php implode(",",$event->tags); ?> + +END:VEVENT |