本文整理汇总了PHP中OC_Calendar_App类的典型用法代码示例。如果您正苦于以下问题:PHP OC_Calendar_App类的具体用法?PHP OC_Calendar_App怎么用?PHP OC_Calendar_App使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OC_Calendar_App类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: createReminder
/**
* create reminder for task
* @param int $taskID
* @param string $type
* @param mixed $action
* @param mixed $date
* @param bool $invert
* @param string $related
* @param mixed $week
* @param mixed $day
* @param mixed $hour
* @param mixed $minute
* @param mixed $second
* @return bool
* @throws \Exception
*/
public function createReminder($taskID, $type, $action, $date, $invert, $related = null, $week, $day, $hour, $minute, $second)
{
$types = array('DATE-TIME', 'DURATION');
$vcalendar = \OC_Calendar_App::getVCalendar($taskID);
$vtodo = $vcalendar->VTODO;
$valarm = $vtodo->VALARM;
if (in_array($type, $types)) {
if ($valarm == null) {
$valarm = $vcalendar->createComponent('VALARM');
$valarm->ACTION = $action;
$valarm->DESCRIPTION = 'Default Event Notification';
$vtodo->add($valarm);
} else {
unset($valarm->TRIGGER);
}
$string = '';
if ($type == 'DATE-TIME') {
$string = $this->createReminderDateTime($date);
} elseif ($type == 'DURATION') {
$string = $this->createReminderDuration($week, $day, $hour, $minute, $second, $invert);
}
if ($related == 'END') {
$valarm->add('TRIGGER', $string, array('VALUE' => $type, 'RELATED' => $related));
} else {
$valarm->add('TRIGGER', $string, array('VALUE' => $type));
}
} else {
unset($vtodo->VALARM);
}
return $this->helper->editVCalendar($vcalendar, $taskID);
}
开发者ID:hesaid,项目名称:tasks-1,代码行数:47,代码来源:reminderservice.php
示例2: index
/**
* @NoAdminRequired
* @NoCSRFRequired
*/
public function index()
{
if (defined('DEBUG') && DEBUG) {
\OCP\Util::addScript('tasks', 'vendor/angularjs/angular');
\OCP\Util::addScript('tasks', 'vendor/angularjs/angular-route');
\OCP\Util::addScript('tasks', 'vendor/angularjs/angular-animate');
\OCP\Util::addScript('tasks', 'vendor/momentjs/moment');
\OCP\Util::addScript('tasks', 'vendor/bootstrap/ui-bootstrap-custom-tpls-0.10.0');
} else {
\OCP\Util::addScript('tasks', 'vendor/angularjs/angular.min');
\OCP\Util::addScript('tasks', 'vendor/angularjs/angular-route.min');
\OCP\Util::addScript('tasks', 'vendor/angularjs/angular-animate.min');
\OCP\Util::addScript('tasks', 'vendor/momentjs/moment.min');
\OCP\Util::addScript('tasks', 'vendor/bootstrap/ui-bootstrap-custom-tpls-0.10.0.min');
}
\OCP\Util::addScript('tasks', 'public/app');
\OCP\Util::addScript('tasks', 'vendor/appframework/app');
\OCP\Util::addScript('tasks', 'vendor/timepicker/jquery.ui.timepicker');
\OCP\Util::addStyle('tasks', 'style');
\OCP\Util::addStyle('tasks', 'vendor/bootstrap/bootstrap');
$date = new \DateTimeZone(\OC_Calendar_App::getTimezone());
$day = new \DateTime('today', $date);
$day = $day->format('d');
// TODO: Make a HTMLTemplateResponse class
$response = new TemplateResponse('tasks', 'main');
$response->setParams(array('DOM' => $day));
return $response;
}
开发者ID:msbt,项目名称:tasks,代码行数:32,代码来源:pagecontroller.php
示例3: deleteComment
/**
* delete comment of task by id
* @param int $taskID
* @param int $commentID
* @return bool
* @throws \Exception
*/
public function deleteComment($taskID, $commentID)
{
$vcalendar = \OC_Calendar_App::getVCalendar($taskID);
$vtodo = $vcalendar->VTODO;
$commentIndex = $this->getCommentById($vtodo, $commentID);
$comment = $vtodo->children[$commentIndex];
if ($comment['X-OC-USERID']->getValue() == $this->userId) {
unset($vtodo->children[$commentIndex]);
return $this->helper->editVCalendar($vcalendar, $taskID);
} else {
throw new \Exception('Not allowed.');
}
}
开发者ID:hesaid,项目名称:tasks-1,代码行数:20,代码来源:commentsservice.php
示例4: search
/**
* Search for query in tasks
*
* @param string $query
* @return array list of \OCA\Tasks\Controller\Task
*/
function search($query)
{
$calendars = \OC_Calendar_Calendar::allCalendars(\OC::$server->getUserSession()->getUser()->getUID(), true);
$user_timezone = \OC_Calendar_App::getTimezone();
// check if the calenar is enabled
if (count($calendars) == 0 || !\OCP\App::isEnabled('tasks')) {
return array();
}
$results = array();
foreach ($calendars as $calendar) {
// $calendar_entries = \OC_Calendar_Object::all($calendar['id']);
$objects = \OC_Calendar_Object::all($calendar['id']);
// $date = strtotime($query);
// // search all calendar objects, one by one
foreach ($objects as $object) {
// skip non-todos
if ($object['objecttype'] != 'VTODO') {
continue;
}
if (!($vtodo = Helper::parseVTODO($object))) {
continue;
}
$id = $object['id'];
$calendarId = $object['calendarid'];
// check these properties
$properties = array('SUMMARY', 'DESCRIPTION', 'LOCATION', 'CATEGORIES');
foreach ($properties as $property) {
$string = $vtodo->{$property};
if (stripos($string, $query) !== false) {
// $results[] = new \OCA\Tasks\Controller\Task($id,$calendarId,$vtodo,$property,$query,$user_timezone);
$results[] = Helper::arrayForJSON($id, $vtodo, $user_timezone, $calendarId);
continue 2;
}
}
$comments = $vtodo->COMMENT;
if ($comments) {
foreach ($comments as $com) {
if (stripos($com->getValue(), $query) !== false) {
// $results[] = new \OCA\Tasks\Controller\Task($id,$calendarId,$vtodo,'COMMENTS',$query,$user_timezone);
$results[] = Helper::arrayForJSON($id, $vtodo, $user_timezone, $calendarId);
continue 2;
}
}
}
}
}
usort($results, array($this, 'sort_completed'));
return $results;
}
开发者ID:sbambach,项目名称:tasks,代码行数:55,代码来源:searchcontroller.php
示例5: search
function search($query)
{
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), true);
if (count($calendars) == 0 || !OCP\App::isEnabled('calendar')) {
//return false;
}
$results = array();
$searchquery = array();
if (substr_count($query, ' ') > 0) {
$searchquery = explode(' ', $query);
} else {
$searchquery[] = $query;
}
$user_timezone = OC_Calendar_App::getTimezone();
$l = new OC_l10n('calendar');
foreach ($calendars as $calendar) {
$objects = OC_Calendar_Object::all($calendar['id']);
foreach ($objects as $object) {
if ($object['objecttype'] != 'VEVENT') {
continue;
}
if (substr_count(strtolower($object['summary']), strtolower($query)) > 0) {
$calendardata = OC_VObject::parse($object['calendardata']);
$vevent = $calendardata->VEVENT;
$dtstart = $vevent->DTSTART;
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
$start_dt = $dtstart->getDateTime();
$start_dt->setTimezone(new DateTimeZone($user_timezone));
$end_dt = $dtend->getDateTime();
$end_dt->setTimezone(new DateTimeZone($user_timezone));
if ($dtstart->getDateType() == Sabre\VObject\Property\DateTime::DATE) {
$end_dt->modify('-1 sec');
if ($start_dt->format('d.m.Y') != $end_dt->format('d.m.Y')) {
$info = $l->t('Date') . ': ' . $start_dt->format('d.m.Y') . ' - ' . $end_dt->format('d.m.Y');
} else {
$info = $l->t('Date') . ': ' . $start_dt->format('d.m.Y');
}
} else {
$info = $l->t('Date') . ': ' . $start_dt->format('d.m.y H:i') . ' - ' . $end_dt->format('d.m.y H:i');
}
$link = OCP\Util::linkTo('calendar', 'index.php') . '?showevent=' . urlencode($object['id']);
$results[] = new OC_Search_Result($object['summary'], $info, $link, (string) $l->t('Cal.'));
//$name,$text,$link,$type
}
}
}
return $results;
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:48,代码来源:search.php
示例6: getACL
/**
* Returns a list of ACE's for this node.
*
* Each ACE has the following properties:
* * 'privilege', a string such as {DAV:}read or {DAV:}write. These are
* currently the only supported privileges
* * 'principal', a url to the principal who owns the node
* * 'protected' (optional), indicating that this ACE is not allowed to
* be updated.
*
* @return array
*/
public function getACL()
{
$readprincipal = $this->getOwner();
$writeprincipal = $this->getOwner();
$uid = OC_Calendar_Calendar::extractUserID($this->getOwner());
if ($uid != OCP\USER::getUser()) {
$object = OC_VObject::parse($this->objectData['calendardata']);
$sharedCalendar = OCP\Share::getItemSharedWithBySource('calendar', $this->calendarInfo['id']);
$sharedAccessClassPermissions = OC_Calendar_App::getAccessClassPermissions($object->VEVENT->CLASS->value);
if ($sharedCalendar && $sharedCalendar['permissions'] & OCP\PERMISSION_READ && $sharedAccessClassPermissions & OCP\PERMISSION_READ) {
$readprincipal = 'principals/' . OCP\USER::getUser();
}
if ($sharedCalendar && $sharedCalendar['permissions'] & OCP\PERMISSION_UPDATE && $sharedAccessClassPermissions & OCP\PERMISSION_UPDATE) {
$writeprincipal = 'principals/' . OCP\USER::getUser();
}
}
return array(array('privilege' => '{DAV:}read', 'principal' => $readprincipal, 'protected' => true), array('privilege' => '{DAV:}write', 'principal' => $writeprincipal, 'protected' => true), array('privilege' => '{DAV:}read', 'principal' => $readprincipal . '/calendar-proxy-write', 'protected' => true), array('privilege' => '{DAV:}write', 'principal' => $writeprincipal . '/calendar-proxy-write', 'protected' => true), array('privilege' => '{DAV:}read', 'principal' => $readprincipal . '/calendar-proxy-read', 'protected' => true));
}
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:30,代码来源:object.php
示例7: isset
<?php
/**
* Copyright (c) 2012 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');
$cal = isset($_GET['calid']) ? $_GET['calid'] : null;
$event = isset($_GET['eventid']) ? $_GET['eventid'] : null;
if (!is_null($cal)) {
$calendar = OC_Calendar_App::getCalendar($cal, true);
if (!$calendar) {
header('HTTP/1.0 403 Forbidden');
exit;
}
header('Content-Type: text/calendar');
header('Content-Disposition: inline; filename=' . str_replace(' ', '-', $calendar['displayname']) . '.ics');
echo OC_Calendar_Export::export($cal, OC_Calendar_Export::CALENDAR);
} elseif (!is_null($event)) {
$data = OC_Calendar_App::getEventObject($_GET['eventid'], true);
if (!$data) {
header('HTTP/1.0 403 Forbidden');
exit;
}
header('Content-Type: text/calendar');
header('Content-Disposition: inline; filename=' . str_replace(' ', '-', $data['summary']) . '.ics');
echo OC_Calendar_Export::export($event, OC_Calendar_Export::EVENT);
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:31,代码来源:export.php
示例8: formatItems
/**
* @brief Converts the shared item sources back into the item in the specified format
* @param array Shared items
* @param int Format
* @return ?
*
* The items array is a 3-dimensional array with the item_source as the first key and the share id as the second key to an array with the share info.
* The key/value pairs included in the share info depend on the function originally called:
* If called by getItem(s)Shared: id, item_type, item, item_source, share_type, share_with, permissions, stime, file_source
* If called by getItem(s)SharedWith: id, item_type, item, item_source, item_target, share_type, share_with, permissions, stime, file_source, file_target
* This function allows the backend to control the output of shared items with custom formats.
* It is only called through calls to the public getItem(s)Shared(With) functions.
*/
public function formatItems($items, $format, $parameters = null)
{
$calendars = array();
if ($format == self::FORMAT_CALENDAR) {
foreach ($items as $item) {
$calendar = OC_Calendar_App::getCalendar($item['item_source'], false);
if (!$calendar) {
continue;
}
// TODO: really check $parameters['permissions'] == 'rw'/'r'
if ($parameters['permissions'] == 'rw') {
continue;
// TODO
}
$calendar['displaynamename'] = $item['item_target'];
$calendar['permissions'] = $item['permissions'];
$calendar['calendarid'] = $calendar['id'];
$calendar['owner'] = $calendar['userid'];
$calendars[] = $calendar;
}
}
return $calendars;
}
开发者ID:netcon-source,项目名称:apps,代码行数:36,代码来源:calendar.php
示例9: updateVCalendarFromRequest
public static function updateVCalendarFromRequest($request, $vcalendar)
{
$vtodo = $vcalendar->VTODO;
$vtodo->setDateTime('LAST-MODIFIED', 'now', \Sabre\VObject\Property\DateTime::UTC);
$vtodo->setDateTime('DTSTAMP', 'now', \Sabre\VObject\Property\DateTime::UTC);
$vtodo->setString('SUMMARY', $request['summary']);
$vtodo->setString('LOCATION', $request['location']);
$vtodo->setString('DESCRIPTION', $request['description']);
$vtodo->setString('CATEGORIES', $request["categories"]);
$vtodo->setString('PRIORITY', $request['priority']);
$vtodo->setString('PERCENT-COMPLETE', $request['complete']);
$due = $request['due'];
if ($due) {
$timezone = \OC_Calendar_App::getTimezone();
$timezone = new \DateTimeZone($timezone);
$due = new \DateTime($due, $timezone);
$vtodo->setDateTime('DUE', $due);
} else {
unset($vtodo->DUE);
}
$start = $request['start'];
if ($start) {
$timezone = \OC_Calendar_App::getTimezone();
$timezone = new \DateTimeZone($timezone);
$start = new \DateTime($start, $timezone);
$vtodo->setDateTime('DTSTART', $start);
} else {
unset($vtodo->DTSTART);
}
return $vcalendar;
}
开发者ID:WeatherellTechnology,项目名称:weatherstorm7,代码行数:31,代码来源:helper.php
示例10: getUserTimezone
/**
* Cache the user timezone to avoid multiple requests (it looks like it
* uses a DB call in config to return this)
*
* @staticvar null $timezone
* @return DateTimeZone
*/
public static function getUserTimezone()
{
static $timezone = null;
if ($timezone === null) {
$timezone = new \DateTimeZone(\OC_Calendar_App::getTimezone());
}
return $timezone;
}
开发者ID:enoch85,项目名称:owncloud-testserver,代码行数:15,代码来源:event.php
示例11: setComplete
public static function setComplete($vtodo, $percent_complete, $completed)
{
if (!empty($percent_complete)) {
$vtodo->setString('PERCENT-COMPLETE', $percent_complete);
} else {
$vtodo->__unset('PERCENT-COMPLETE');
}
if ($percent_complete == 100) {
if (!$completed) {
$completed = 'now';
}
} else {
$completed = null;
}
if ($completed) {
$timezone = OC_Calendar_App::getTimezone();
$timezone = new DateTimeZone($timezone);
$completed = new DateTime($completed, $timezone);
$vtodo->setDateTime('COMPLETED', $completed);
OCP\Util::emitHook('OC_Task', 'taskCompleted', $vtodo);
} else {
unset($vtodo->COMPLETED);
}
}
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:24,代码来源:app.php
示例12: foreach
if ($_POST['method'] == 'new') {
$calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser());
foreach ($calendars as $calendar) {
if ($calendar['displayname'] == $_POST['calname']) {
$id = $calendar['id'];
$newcal = false;
break;
}
$newcal = true;
}
if ($newcal) {
$id = OC_Calendar_Calendar::addCalendar(OCP\USER::getUser(), strip_tags($_POST['calname']), 'VEVENT,VTODO,VJOURNAL', null, 0, strip_tags($_POST['calcolor']));
OC_Calendar_Calendar::setCalendarActive($id, 1);
}
} else {
$calendar = OC_Calendar_App::getCalendar($_POST['id']);
if ($calendar['userid'] != OCP\USER::getUser()) {
OCP\JSON::error(array('error' => 'missingcalendarrights'));
exit;
}
$id = $_POST['id'];
$import->setOverwrite($_POST['overwrite']);
}
$import->setCalendarID($id);
try {
$import->import();
} catch (Exception $e) {
OCP\JSON::error(array('message' => OC_Calendar_App::$l10n->t('Import failed'), 'debug' => $e->getMessage()));
//write some log
}
$count = $import->getCount();
开发者ID:omusico,项目名称:isle-web-framework,代码行数:31,代码来源:import.php
示例13: DateInterval
* See the COPYING-README file.
*/
OCP\JSON::checkLoggedIn();
$id = $_POST['id'];
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
if ($access != 'owner' && $access != 'rw') {
OCP\JSON::error(array('message' => 'permission denied'));
exit;
}
$vcalendar = OC_Calendar_App::getVCalendar($id, false, false);
$vevent = $vcalendar->VEVENT;
$allday = $_POST['allDay'];
$delta = new DateInterval('P0D');
$delta->d = $_POST['dayDelta'];
$delta->i = $_POST['minuteDelta'];
OC_Calendar_App::isNotModified($vevent, $_POST['lastmodified']);
$dtstart = $vevent->DTSTART;
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
$start_type = $dtstart->getDateType();
$end_type = $dtend->getDateType();
if ($allday && $start_type != Sabre_VObject_Property_DateTime::DATE) {
$start_type = $end_type = Sabre_VObject_Property_DateTime::DATE;
$dtend->setDateTime($dtend->getDateTime()->modify('+1 day'), $end_type);
}
if (!$allday && $start_type == Sabre_VObject_Property_DateTime::DATE) {
$start_type = $end_type = Sabre_VObject_Property_DateTime::LOCALTZ;
}
$dtstart->setDateTime($dtstart->getDateTime()->add($delta), $start_type);
$dtend->setDateTime($dtend->getDateTime()->add($delta), $end_type);
unset($vevent->DURATION);
$vevent->setDateTime('LAST-MODIFIED', 'now', Sabre_VObject_Property_DateTime::UTC);
开发者ID:jaeindia,项目名称:ownCloud-Enhancements,代码行数:31,代码来源:move.php
示例14: foreach
} else {
echo '<ul>';
foreach ($_['categories'] as $categorie) {
echo '<li>' . $categorie . '</li>';
}
echo '</ul>';
}
?>
</td>
<th width="75px"> <?php
echo $l->t("Calendar");
?>
:</th>
<td>
<?php
$calendar = OC_Calendar_App::getCalendar($_['calendar'], false, false);
echo $calendar['displayname'] . ' ' . $l->t('of') . ' ' . $calendar['userid'];
?>
</td>
<th width="75px"> </th>
<td>
<input type="hidden" name="calendar" value="<?php
echo $_['calendar_options'][0]['id'];
?>
">
</td>
</tr>
</table>
<hr>
<table width="100%">
<tr>
开发者ID:noci2012,项目名称:owncloud,代码行数:31,代码来源:part.showevent.php
示例15: addslashes
var missing_field_dberror = '<?php
echo addslashes($l->t('There was a database fail'));
?>
';
var totalurl = '<?php
echo OCP\Util::linkToRemote('caldav');
?>
calendars';
var firstDay = '<?php
echo OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'firstday', 'mo') == 'mo' ? '1' : '0';
?>
';
$(document).ready(function() {
<?php
if (array_key_exists('showevent', $_)) {
$data = OC_Calendar_App::getEventObject($_['showevent']);
$date = substr($data['startdate'], 0, 10);
list($year, $month, $day) = explode('-', $date);
echo '$(\'#calendar_holder\').fullCalendar(\'gotoDate\', ' . $year . ', ' . --$month . ', ' . $day . ');';
echo '$(\'#dialog_holder\').load(OC.filePath(\'calendar\', \'ajax\', \'editeventform.php\') + \'?id=\' + ' . $_['showevent'] . ' , Calendar.UI.startEventDialog);';
}
?>
});
</script>
<div id="controls">
<div>
<form>
<div id="view">
<input type="button" value="<?php
echo $l->t('Week');
?>
开发者ID:jaeindia,项目名称:ownCloud-Enhancements,代码行数:31,代码来源:calendar.php
示例16:
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
$id = $_POST['id'];
if (!array_key_exists('calendar', $_POST)) {
$cal = OC_Calendar_Object::getCalendarid($id);
$_POST['calendar'] = $cal;
} else {
$cal = $_POST['calendar'];
}
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
if ($access != 'owner' && $access != 'rw') {
OCP\JSON::error(array('message' => 'permission denied'));
exit;
}
$errarr = OC_Calendar_Object::validateRequest($_POST);
if ($errarr) {
//show validate errors
OCP\JSON::error($errarr);
exit;
} else {
$data = OC_Calendar_App::getEventObject($id, false, false);
$vcalendar = OC_VObject::parse($data['calendardata']);
OC_Calendar_App::isNotModified($vcalendar->VEVENT, $_POST['lastmodified']);
OC_Calendar_Object::updateVCalendarFromRequest($_POST, $vcalendar);
OC_Calendar_Object::edit($id, $vcalendar->serialize());
if ($data['calendarid'] != $cal) {
OC_Calendar_Object::moveToCalendar($id, $cal);
}
OCP\JSON::success();
}
开发者ID:jaeindia,项目名称:ownCloud-Enhancements,代码行数:31,代码来源:edit.php
示例17: array
} else {
echo '<select id="category" name="categories[]" multiple="multiple" title="' . $l->t("Select category") . '">';
echo OCP\html_select_options($_['categories'], $_['categories'], array('combine' => true));
echo '</select>';
}
?>
</td>
<th width="75px"> <?php
echo $l->t("Calendar");
?>
:</th>
<td>
<select name="calendar" disabled="disabled">
<option>
<?php
$calendar = OC_Calendar_App::getCalendar($_['calendar']);
echo $calendar['displayname'] . ' ' . $l->t('of') . ' ' . $calendar['userid'];
?>
</option>
</select>
</td>
<th width="75px"> </th>
<td>
<input type="hidden" name="calendar" value="<?php
echo $_['calendar_options'][0]['id'];
?>
">
</td>
</tr>
</table>
开发者ID:jaeindia,项目名称:ownCloud-Enhancements,代码行数:31,代码来源:part.showevent.php
示例18: session_write_close
<?php
/**
* Copyright (c) 2011, 2012 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.
*/
require_once 'when/When.php';
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
session_write_close();
// Look for the calendar id
$calendar_id = OC_Calendar_App::getCalendar($_GET['calendar_id'], false, false);
if ($calendar_id !== false) {
if (!is_numeric($calendar_id['userid']) && $calendar_id['userid'] != OCP\User::getUser()) {
OCP\JSON::error();
exit;
}
} else {
$calendar_id = $_GET['calendar_id'];
}
$start = version_compare(PHP_VERSION, '5.3.0', '>=') ? DateTime::createFromFormat('U', $_GET['start']) : new DateTime('@' . $_GET['start']);
$end = version_compare(PHP_VERSION, '5.3.0', '>=') ? DateTime::createFromFormat('U', $_GET['end']) : new DateTime('@' . $_GET['end']);
$events = OC_Calendar_App::getrequestedEvents($_GET['calendar_id'], $start, $end);
$output = array();
foreach ($events as $event) {
$output = array_merge($output, OC_Calendar_App::generateEventOutput($event, $start, $end));
}
OCP\JSON::encodedPrint(OCP\Util::sanitizeHTML($output));
开发者ID:noci2012,项目名称:owncloud,代码行数:30,代码来源:events.php
示例19: array
<?php
/**
* ownCloud - Addressbook
*
* @author Jakob Sack
* @copyright 2011 Jakob Sack [email protected]
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Init owncloud
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('tasks');
OCP\JSON::callCheck();
$id = $_POST['id'];
$task = OC_Calendar_App::getEventObject($id);
OC_Calendar_Object::delete($id);
OCP\JSON::success(array('data' => array('id' => $id)));
开发者ID:omusico,项目名称:isle-web-framework,代码行数:30,代码来源:delete.php
示例20:
<?php
/**
* Copyright (c) 2011 Bart Visscher <[email protected]>
* 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($_GET['calendarid']);
$tmpl = new OCP\Template("calendar", "part.editcalendar");
$tmpl->assign('new', false);
$tmpl->assign('calendarcolor_options', $calendarcolor_options);
$tmpl->assign('calendar', $calendar);
$tmpl->printPage();
开发者ID:noci2012,项目名称:owncloud,代码行数:17,代码来源:edit.form.php
注:本文中的OC_Calendar_App类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论