本文整理汇总了PHP中OC_Calendar_Calendar::getCalendarColorOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Calendar_Calendar::getCalendarColorOptions方法的具体用法?PHP OC_Calendar_Calendar::getCalendarColorOptions怎么用?PHP OC_Calendar_Calendar::getCalendarColorOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_Calendar_Calendar
的用法示例。
在下文中一共展示了OC_Calendar_Calendar::getCalendarColorOptions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
/**
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
* 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();
示例2: OC_Calendar_Import
<?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']);
?>
">