本文整理汇总了PHP中OC_Calendar_Object::updateVCalendarFromRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Calendar_Object::updateVCalendarFromRequest方法的具体用法?PHP OC_Calendar_Object::updateVCalendarFromRequest怎么用?PHP OC_Calendar_Object::updateVCalendarFromRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_Calendar_Object
的用法示例。
在下文中一共展示了OC_Calendar_Object::updateVCalendarFromRequest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
*/
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();
}
示例2: array
$newdatestringarray[1] = "00:00";
} else {
if ($allday == true) {
$difference = 3600;
}
$allday = false;
}
} else {
$newdatestringarray = array();
$newdatestringarray[0] = $newdate;
$newdatestringarray[1] = $starttime;
}
$newdatearray = explode(".", $newdatestringarray[0]);
$newtimearray = explode(":", $newdatestringarray[1]);
$newstartunix = mktime($newtimearray[0], $newtimearray[1], 0, $newdatearray[1], $newdatearray[0], $newdatearray[2]);
$newendunix = $newstartunix + $difference;
if ($allday == true) {
$caldata["allday"] = true;
} else {
unset($caldata["allday"]);
}
$caldata["from"] = date("d-m-Y", $newstartunix);
$caldata["fromtime"] = date("H:i", $newstartunix);
$caldata["to"] = date("d-m-Y", $newendunix);
$caldata["totime"] = date("H:i", $newendunix);
//modified part of editevent.php
$vcalendar = Sabre_VObject_Reader::read($data["calendardata"]);
OC_Calendar_Object::updateVCalendarFromRequest($caldata, $vcalendar);
$result = OC_Calendar_Object::edit($id, $vcalendar->serialize());
OC_JSON::success();
//end part of editevent.php
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:31,代码来源:owncloud_apps_calendar_ajax_moveevent.php