本文整理汇总了PHP中OC_Calendar_App::loadCategoriesFromVCalendar方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Calendar_App::loadCategoriesFromVCalendar方法的具体用法?PHP OC_Calendar_App::loadCategoriesFromVCalendar怎么用?PHP OC_Calendar_App::loadCategoriesFromVCalendar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OC_Calendar_App
的用法示例。
在下文中一共展示了OC_Calendar_App::loadCategoriesFromVCalendar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
/**
* @brief edits an object
* @param integer $id id of object
* @param string $data object
* @return boolean
*/
public static function edit($id, $data)
{
$oldobject = self::find($id);
$calid = self::getCalendarid($id);
$calendar = OC_Calendar_Calendar::find($calid);
$oldvobject = OC_VObject::parse($oldobject['calendardata']);
if ($calendar['userid'] != OCP\User::getUser()) {
$sharedCalendar = OCP\Share::getItemSharedWithBySource('calendar', $calid);
//calid, not objectid !!!! 1111 one one one eleven
$sharedAccessClassPermissions = OC_Calendar_Object::getAccessClassPermissions($oldvobject);
if (!$sharedCalendar || !($sharedCalendar['permissions'] & OCP\PERMISSION_UPDATE) || !($sharedAccessClassPermissions & OCP\PERMISSION_UPDATE)) {
throw new Exception(OC_Calendar_App::$l10n->t('You do not have the permissions to edit this event.'));
}
}
$object = OC_VObject::parse($data);
OC_Calendar_App::loadCategoriesFromVCalendar($id, $object);
list($type, $startdate, $enddate, $summary, $repeating, $uid) = self::extractData($object);
$stmt = OCP\DB::prepare('UPDATE `*PREFIX*clndr_objects` SET `objecttype`=?,`startdate`=?,`enddate`=?,`repeating`=?,`summary`=?,`calendardata`=?,`lastmodified`= ? WHERE `id` = ?');
$stmt->execute(array($type, $startdate, $enddate, $repeating, $summary, $data, time(), $id));
OC_Calendar_Calendar::touchCalendar($oldobject['calendarid']);
OCP\Util::emitHook('OC_Calendar', 'editEvent', $id);
return true;
}
示例2: edit
/**
* @brief edits an object
* @param integer $id id of object
* @param string $data object
* @return boolean
*/
public static function edit($id, $data)
{
$oldobject = self::find($id);
$object = OC_VObject::parse($data);
OC_Calendar_App::loadCategoriesFromVCalendar($object);
list($type, $startdate, $enddate, $summary, $repeating, $uid) = self::extractData($object);
$stmt = OCP\DB::prepare('UPDATE *PREFIX*calendar_objects SET objecttype=?,startdate=?,enddate=?,repeating=?,summary=?,calendardata=?, lastmodified = ? WHERE id = ?');
$stmt->execute(array($type, $startdate, $enddate, $repeating, $summary, $data, time(), $id));
OC_Calendar_Calendar::touchCalendar($oldobject['calendarid']);
return true;
}