本文整理匯總了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']);
?>
">