aboutsummaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2009-01-02 07:12:12 +0000
committerJim Hu <jimhu@users.sourceforge.net>2009-01-02 07:12:12 +0000
commitc60246816752a18ba37b8f3508799acd17686b30 (patch)
treeb010ee90fb0b568bd3a84f4f4c52b18b80d0645a /includes
parent281d63eedb805ec330a5572b85f48896981fca16 (diff)
downloadphpicalendar-c60246816752a18ba37b8f3508799acd17686b30.tar.gz
phpicalendar-c60246816752a18ba37b8f3508799acd17686b30.tar.bz2
phpicalendar-c60246816752a18ba37b8f3508799acd17686b30.zip
add download event to event popup
Diffstat (limited to 'includes')
-rw-r--r--includes/event.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/includes/event.php b/includes/event.php
index c15f3d2..7cafa8a 100644
--- a/includes/event.php
+++ b/includes/event.php
@@ -11,6 +11,7 @@ require_once(BASE.'functions/template.php');
$event = unserialize(stripslashes($_POST['event_data']));
$organizer = unserialize($event['organizer']);
$attendee = unserialize($event['attendee']);
+$uid = stripslashes($_POST['uid']);
// Format event time
// All day
@@ -71,6 +72,35 @@ switch ($event['status']){
$event['status'] = '' ;
}
+$event_download = '';
+if($phpiCal_config->event_download == 'yes') $event_download = "
+<form action='' method='post'>
+<input type=hidden name='event_data' value = '".$_POST['event_data']."' />
+<input type=hidden name='uid' value = '".$_POST['uid']."' />
+<input type='submit' name='submit' value='".$lang['l_download_event']."' />
+<form>";
+
+if (isset($_POST['submit'])){
+header("Content-Type: text/calendar; charset=utf-8; name=$uid");
+header("Content-Disposition: attachment; filename=$uid");
+echo
+"BEGIN:VCALENDAR
+VERSION:2.0
+X-WR-CALNAME:".$event['calname']."
+BEGIN:VEVENT
+UID:$uid
+SUMMARY:".$event['event_text']."
+CATEGORIES:".$event['calname']."
+DTSTART;TZID=".$event['timezone'].":".date("Ymd\THis",$event['start_unixtime'])."
+DTEND;TZID=".$event['timezone'].":".date("Ymd\THis",$event['start_unixtime'])."
+CLASS:".$event['class']."
+".$event['other']."
+SEQUENCE:1
+CREATED:20081128T075152
+END:VEVENT
+END:VCALENDAR
+";exit;
+}
$page = new Page(BASE.'templates/'.$phpiCal_config->template.'/event.tpl');
$page->replace_tags(array(
@@ -83,6 +113,7 @@ $page->replace_tags(array(
'attendee' => $attendee,
'status' => $event['status'],
'location' => $event['location'],
+ 'event_download' => $event_download,
'url' => $event['url'],
'cal_title_full' => $event['calname'].' '.$lang['l_calendar'],
'template' => $phpiCal_config->template,

© 2014-2022 Faster IT GmbH | imprint | privacy policy