2011-09-02 14:55:56 +04:00
|
|
|
<?php
|
2011-09-24 00:59:24 +04:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later.
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*/
|
|
|
|
|
2011-12-01 19:06:27 +04:00
|
|
|
require_once ('../../lib/base.php');
|
2011-09-18 23:31:56 +04:00
|
|
|
OC_Util::checkLoggedIn();
|
2011-10-01 01:05:10 +04:00
|
|
|
OC_Util::checkAppEnabled('calendar');
|
2011-12-01 19:06:27 +04:00
|
|
|
$cal = isset($_GET['calid']) ? $_GET['calid'] : NULL;
|
|
|
|
$event = isset($_GET['eventid']) ? $_GET['eventid'] : NULL;
|
2011-10-02 01:19:06 +04:00
|
|
|
if(isset($cal)){
|
2011-12-19 01:58:20 +04:00
|
|
|
$calendar = OC_Calendar_App::getCalendar($cal);
|
2011-10-02 01:19:06 +04:00
|
|
|
$calobjects = OC_Calendar_Object::all($cal);
|
2011-12-01 19:06:27 +04:00
|
|
|
header('Content-Type: text/Calendar');
|
|
|
|
header('Content-Disposition: inline; filename=' . $calendar['displayname'] . '.ics');
|
2011-12-19 02:01:45 +04:00
|
|
|
foreach($calobjects as $calobject){
|
2011-12-28 01:18:01 +04:00
|
|
|
echo $calobject['calendardata'] . '\n';
|
2011-10-02 01:19:06 +04:00
|
|
|
}
|
|
|
|
}elseif(isset($event)){
|
2011-12-28 01:18:01 +04:00
|
|
|
$data = OC_Calendar_App::getEventObject($_GET['eventid']);
|
2011-12-01 19:06:27 +04:00
|
|
|
$calendarid = $data['calendarid'];
|
2011-12-19 01:58:20 +04:00
|
|
|
$calendar = OC_Calendar_App::getCalendar($calendarid);
|
2011-12-01 19:06:27 +04:00
|
|
|
header('Content-Type: text/Calendar');
|
|
|
|
header('Content-Disposition: inline; filename=' . $data['summary'] . '.ics');
|
|
|
|
echo $data['calendardata'];
|
2011-09-02 14:55:56 +04:00
|
|
|
}
|
2011-09-15 12:14:47 +04:00
|
|
|
?>
|