function exportEvent($event_id) { PHPWS_Core::initModClass('calendar', 'Event.php'); $event = new Calendar_Event($event_id, $this); if ($event->id) { $tpl = $event->icalTags(); } else { $tpl['EMPTY'] = ' '; } $content = PHPWS_Template::process($tpl, 'calendar', 'ical.tpl'); header("Content-type: text/calendar"); header('Content-Disposition: attachment; filename="icalexport.ics"'); echo $content; exit; }