當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OC_Calendar_App::loadCategoriesFromVCalendar方法代碼示例

本文整理匯總了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;
 }
開發者ID:omusico,項目名稱:isle-web-framework,代碼行數:29,代碼來源:object.php

示例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;
 }
開發者ID:noci2012,項目名稱:owncloud,代碼行數:17,代碼來源:object.php


注:本文中的OC_Calendar_App::loadCategoriesFromVCalendar方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。