From: <ji...@us...> - 2009-01-02 07:12:18
|
Update of /cvsroot/phpicalendar/phpicalendar/includes In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7815/includes Modified Files: event.php Log Message: add download event to event popup Index: event.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/includes/event.php,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** event.php 29 Dec 2008 03:07:34 -0000 1.48 --- event.php 2 Jan 2009 07:12:12 -0000 1.49 *************** *** 12,15 **** --- 12,16 ---- $organizer = unserialize($event['organizer']); $attendee = unserialize($event['attendee']); + $uid = stripslashes($_POST['uid']); // Format event time *************** *** 72,75 **** --- 73,105 ---- } + $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'); *************** *** 84,87 **** --- 114,118 ---- 'status' => $event['status'], 'location' => $event['location'], + 'event_download' => $event_download, 'url' => $event['url'], 'cal_title_full' => $event['calname'].' '.$lang['l_calendar'], |