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


PHP vcalendar::runparse方法代碼示例

本文整理匯總了PHP中vcalendar::runparse方法的典型用法代碼示例。如果您正苦於以下問題:PHP vcalendar::runparse方法的具體用法?PHP vcalendar::runparse怎麽用?PHP vcalendar::runparse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vcalendar的用法示例。


在下文中一共展示了vcalendar::runparse方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: GetMessage

 function GetMessage($folderid, $id, $truncsize, $mimesupport = 0)
 {
     debugLog('CalDAV::GetMessage(' . $folderid . ', ' . $id . ', ..)');
     if (trim($id) == "") {
         return;
     }
     if ($folderid == "calendar") {
         $output = $this->_events[$id]['data'];
     } elseif ($folderid == "tasks") {
         $output = $this->_tasks[$id]['data'];
     } else {
         return;
     }
     //debugLog("CalDAV::Got File ".$id." now parseing ".$output);
     $v = new vcalendar();
     $v->runparse($output);
     $v->sort();
     if ($folderid == "tasks") {
         while ($vtodo = $v->getComponent('vtodo', $vcounter)) {
             $message = $this->converttotask($vtodo, $truncsize);
             $vcounter++;
         }
     } else {
         $vcounter = 1;
         $fullexceptionsarray = array();
         while ($vevent = $v->getComponent('vevent', $vcounter)) {
             $val = $vevent->getProperty("RECURRENCE-ID");
             if ($val === false) {
                 $message = $this->converttoappointment($vevent, $truncsize);
             } else {
                 $tmp = $this->converttoappointment($vevent, $truncsize);
                 $tmp->deleted = "0";
                 //The exceptionstarttime is the ORIGINAL starttime of the event
                 //On Thunderbird this is equal to the RECCURENCE-ID (which is in $val)
                 $tmp->exceptionstarttime = mktime($val['hour'], $val['min'], $val['sec'], $val['month'], $val['day'], $val['year']);
                 unset($tmp->uid);
                 unset($tmp->exceptions);
                 array_push($fullexceptionsarray, $tmp);
                 unset($tmp);
             }
             $vcounter++;
         }
         $message->exceptions = array_merge($message->exceptions, $fullexceptionsarray);
     }
     if ($vtimezone = $v->getComponent('vtimezone')) {
         $message = $this->setoutlooktimezone($message, $vtimezone);
     }
     debugLog("CalDAV::Finsihed Converting " . $id . " now returning");
     return $message;
 }
開發者ID:netconstructor,項目名稱:activesync,代碼行數:50,代碼來源:caldav.php


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