本文整理汇总了PHP中OC_Calendar_App::getCategoryOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Calendar_App::getCategoryOptions方法的具体用法?PHP OC_Calendar_App::getCategoryOptions怎么用?PHP OC_Calendar_App::getCategoryOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_Calendar_App
的用法示例。
在下文中一共展示了OC_Calendar_App::getCategoryOptions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* get the current settings
*
* @return array
*/
public function get()
{
$settings = array(array('id' => 'various', 'showHidden' => (int) $this->settings->getUserValue($this->userId, $this->appName, 'various_showHidden'), 'startOfWeek' => (int) $this->settings->getUserValue($this->userId, $this->appName, 'various_startOfWeek'), 'userID' => $this->userId, 'categories' => \OC_Calendar_App::getCategoryOptions()));
return $settings;
}
示例2: array
OCP\User::checkLoggedIn();
OCP\App::checkAppEnabled('calendar');
// Create default calendar ...
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), 1);
if (count($calendars) == 0) {
OC_Calendar_Calendar::addCalendar(OCP\USER::getUser(), 'Default calendar');
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), 1);
}
$eventSources = array();
foreach ($calendars as $calendar) {
$eventSources[] = OC_Calendar_Calendar::getEventSourceInfo($calendar);
}
$eventSources[] = array('url' => '?app=calendar&getfile=ajax/events.php?calendar_id=shared_rw', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable' => 'true');
$eventSources[] = array('url' => '?app=calendar&getfile=ajax/events.php?calendar_id=shared_r', 'backgroundColor' => '#1D2D44', 'borderColor' => '#888', 'textColor' => 'white', 'editable' => 'false');
OCP\Util::emitHook('OC_Calendar', 'getSources', array('sources' => &$eventSources));
$categories = OC_Calendar_App::getCategoryOptions();
//Fix currentview for fullcalendar
if (OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "oneweekview") {
OCP\Config::setUserValue(OCP\USER::getUser(), "calendar", "currentview", "agendaWeek");
}
if (OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "onemonthview") {
OCP\Config::setUserValue(OCP\USER::getUser(), "calendar", "currentview", "month");
}
if (OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "listview") {
OCP\Config::setUserValue(OCP\USER::getUser(), "calendar", "currentview", "list");
}
OCP\Util::addscript('3rdparty/fullcalendar', 'fullcalendar');
OCP\Util::addStyle('3rdparty/fullcalendar', 'fullcalendar');
OCP\Util::addscript('3rdparty/timepicker', 'jquery.ui.timepicker');
OCP\Util::addStyle('3rdparty/timepicker', 'jquery.ui.timepicker');
if (OCP\Config::getUserValue(OCP\USER::getUser(), "calendar", "timezone") == null || OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection') == 'true') {
示例3: array
OCP\Util::emitHook('OC_Calendar', 'getSources', array('sources' => &$eventSources));
$firstDay = null;
$firstDayConfig = OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'firstday', 'mo');
switch ($firstDayConfig) {
case 'su':
$firstDay = 0;
break;
case 'tu':
$firstDay = 2;
break;
case 'we':
$firstDay = 3;
break;
case 'th':
$firstDay = 4;
break;
case 'fr':
$firstDay = 5;
break;
case 'sa':
$firstDay = 6;
break;
default:
$firstDay = 1;
break;
}
$array = array("defaultView" => "\"" . OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') . "\"", "eventSources" => json_encode($eventSources), "categories" => json_encode(OC_Calendar_App::getCategoryOptions()), "dayNames" => json_encode(array((string) $l->t('Sunday'), (string) $l->t('Monday'), (string) $l->t('Tuesday'), (string) $l->t('Wednesday'), (string) $l->t('Thursday'), (string) $l->t('Friday'), (string) $l->t('Saturday'))), "dayNamesShort" => json_encode(array((string) $l->t('Sun.'), (string) $l->t('Mon.'), (string) $l->t('Tue.'), (string) $l->t('Wed.'), (string) $l->t('Thu.'), (string) $l->t('Fri.'), (string) $l->t('Sat.'))), "monthNames" => json_encode(array((string) $l->t('January'), (string) $l->t('February'), (string) $l->t('March'), (string) $l->t('April'), (string) $l->t('May'), (string) $l->t('June'), (string) $l->t('July'), (string) $l->t('August'), (string) $l->t('September'), (string) $l->t('October'), (string) $l->t('November'), (string) $l->t('December'))), "monthNamesShort" => json_encode(array((string) $l->t('Jan.'), (string) $l->t('Feb.'), (string) $l->t('Mar.'), (string) $l->t('Apr.'), (string) $l->t('May.'), (string) $l->t('Jun.'), (string) $l->t('Jul.'), (string) $l->t('Aug.'), (string) $l->t('Sep.'), (string) $l->t('Oct.'), (string) $l->t('Nov.'), (string) $l->t('Dec.'))), "agendatime" => "\"" . ((int) OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt') . "{ -" . ((int) OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt') . "}" . "\"", "defaulttime" => "\"" . ((int) OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt') . "\"", "allDayText" => "\"" . addslashes($l->t('All day')) . "\"", "newcalendar" => "\"" . addslashes($l->t('New Calendar')) . "\"", "missing_field" => "\"" . addslashes($l->t('Missing or invalid fields')) . "\"", "missing_field_title" => "\"" . addslashes($l->t('Title')) . "\"", "missing_field_calendar" => "\"" . addslashes($l->t('Calendar')) . "\"", "missing_field_fromdate" => "\"" . addslashes($l->t('From Date')) . "\"", "missing_field_fromtime" => "\"" . addslashes($l->t('From Time')) . "\"", "missing_field_todate" => "\"" . addslashes($l->t('To Date')) . "\"", "missing_field_totime" => "\"" . addslashes($l->t('To Time')) . "\"", "missing_field_startsbeforeends" => "\"" . addslashes($l->t('The event ends before it starts')) . "\"", "missing_field_dberror" => "\"" . addslashes($l->t('There was a database fail')) . "\"", "missing_field_interval" => "\"" . addslashes($l->t('Interval is not valid. It must be a positive integer!')) . "\"", "totalurl" => "\"" . OCP\Util::linkToRemote('caldav') . "calendars" . "\"", "firstDay" => $firstDay);
// Echo it
foreach ($array as $setting => $value) {
echo "var " . $setting . "=" . $value . ";\n";
}