当前位置: 首页>>代码示例>>PHP>>正文


PHP OC_Calendar_Calendar::getEventSourceInfo方法代码示例

本文整理汇总了PHP中OC_Calendar_Calendar::getEventSourceInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Calendar_Calendar::getEventSourceInfo方法的具体用法?PHP OC_Calendar_Calendar::getEventSourceInfo怎么用?PHP OC_Calendar_Calendar::getEventSourceInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OC_Calendar_Calendar的用法示例。


在下文中一共展示了OC_Calendar_Calendar::getEventSourceInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: explode

/**
 * Copyright (c) 2012 Georg Ehrke <ownclouddev@georgswebsite.de>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */
$data = $_POST['data'];
$data = explode(',', $data);
$data = end($data);
$data = base64_decode($data);
OCP\JSON::checkLoggedIn();
OCP\App::checkAppEnabled('calendar');
$import = new OC_Calendar_Import($data);
$import->setUserID(OCP\User::getUser());
$import->setTimeZone(OC_Calendar_App::$tz);
$import->disableProgressCache();
if (!$import->isValid()) {
    OCP\JSON::error();
    exit;
}
$newcalendarname = strip_tags($import->createCalendarName());
$newid = OC_Calendar_Calendar::addCalendar(OCP\User::getUser(), $newcalendarname, 'VEVENT,VTODO,VJOURNAL', null, 0, $import->createCalendarColor());
$import->setCalendarID($newid);
$import->import();
$count = $import->getCount();
if ($count == 0) {
    OC_Calendar_Calendar::deleteCalendar($newid);
    OCP\JSON::error(array('message' => OC_Calendar_App::$l10n->t('The file contained either no events or all events are already saved in your calendar.')));
} else {
    OCP\JSON::success(array('message' => $count . ' ' . OC_Calendar_App::$l10n->t('events has been saved in the new calendar') . ' ' . $newcalendarname, 'eventSource' => OC_Calendar_Calendar::getEventSourceInfo(OC_Calendar_Calendar::find($newid))));
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:31,代码来源:dropimport.php

示例2: foreach

/**
 * 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.
 */
// Check if we are a user
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();
if (trim($_POST['name']) == '') {
    OCP\JSON::error(array('message' => 'empty'));
    exit;
}
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser());
foreach ($calendars as $cal) {
    if ($cal['displayname'] == $_POST['name']) {
        OCP\JSON::error(array('message' => 'namenotavailable'));
        exit;
    }
}
$userid = OCP\USER::getUser();
$calendarid = OC_Calendar_Calendar::addCalendar($userid, strip_tags($_POST['name']), 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']);
OC_Calendar_Calendar::setCalendarActive($calendarid, 1);
$calendar = OC_Calendar_Calendar::find($calendarid);
$tmpl = new OCP\Template('calendar', 'part.choosecalendar.rowfields');
$tmpl->assign('calendar', $calendar);
$tmpl->assign('shared', false);
OCP\JSON::success(array('page' => $tmpl->fetchPage(), 'eventSource' => OC_Calendar_Calendar::getEventSourceInfo($calendar)));
开发者ID:omusico,项目名称:isle-web-framework,代码行数:29,代码来源:new.php

示例3: array

 * 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.
 */
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");
}
开发者ID:jaeindia,项目名称:ownCloud-Enhancements,代码行数:31,代码来源:index.php

示例4: catch

<?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');
OCP\JSON::callCheck();
$calendarid = $_POST['calendarid'];
$calendar = OC_Calendar_App::getCalendar($calendarid, true);
if (!$calendar) {
    OCP\JSON::error(array('message' => 'permission denied'));
    exit;
}
try {
    OC_Calendar_Calendar::setCalendarActive($calendarid, $_POST['active']);
} catch (Exception $e) {
    OCP\JSON::error(array('message' => $e->getMessage()));
    exit;
}
$calendar = OC_Calendar_App::getCalendar($calendarid);
OCP\JSON::success(array('active' => $calendar['active'], 'eventSource' => OC_Calendar_Calendar::getEventSourceInfo($calendar)));
开发者ID:enoch85,项目名称:owncloud-testserver,代码行数:25,代码来源:activation.php


注:本文中的OC_Calendar_Calendar::getEventSourceInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。