Example #1
0
<?php

/**
 * Copyright (c) 2011 Bart Visscher <*****@*****.**>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
$calendarcolor_options = OC_Calendar_Calendar::getCalendarColorOptions();
$calendar = OC_Calendar_App::getCalendar($_POST['calendarid']);
$tmpl = new OCP\Template("calendar", "part.editcalendar");
$tmpl->assign('new', false);
$tmpl->assign('calendarcolor_options', $calendarcolor_options);
$tmpl->assign('calendar', $calendar);
$tmpl->printPage();
Example #2
0
<?php

//Prerendering for iCalendar file
$file = \OC\Files\Filesystem::file_get_contents($_['path'] . '/' . $_['filename']);
if (!$file) {
    OCP\JSON::error(array('error' => '404'));
}
$import = new OC_Calendar_Import($file);
$import->setUserID(OCP\User::getUser());
$newcalendarname = OCP\Util::sanitizeHTML($import->createCalendarName());
$guessedcalendarname = OCP\Util::sanitizeHTML($import->guessCalendarName());
$calendarcolor = OCP\Util::sanitizeHTML($import->createCalendarColor());
//loading calendars for select box
$calendar_options = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
$calendar_options[] = array('id' => 'newcal', 'displayname' => $l->t('create a new calendar'));
$defaultcolors = OC_Calendar_Calendar::getCalendarColorOptions();
?>
<div id="calendar_import_dialog" title="<?php 
p($l->t("Import a calendar file"));
?>
">
<div id="calendar_import_form">
	<form>
		<input type="hidden" id="calendar_import_filename" value="<?php 
p($_['filename']);
?>
">
		<input type="hidden" id="calendar_import_path" value="<?php 
p($_['path']);
?>
">