<?php /********************************************************************************* * The content of this file is subject to the Calendar4You Free license. * ("License"); You may not use this file except in compliance with the License * The Initial Developer of the Original Code is IT-Solutions4You s.r.o. * Portions created by IT-Solutions4You s.r.o. are Copyright(C) IT-Solutions4You s.r.o. * All Rights Reserved. ********************************************************************************/ include_once "modules/Calendar4You/GoogleSync4You.php"; global $current_user, $mod_strings; $GoogleSync4You = new GoogleSync4You(); $apikey = $_REQUEST["apikey"]; $keyfile = $_REQUEST["keyfile"]; $clientid = $_REQUEST["clientid"]; $refresh = $_REQUEST["refresh_token"]; $googleinsert = $_REQUEST["googleinsert"]; $login = $_REQUEST["login"]; $pass = $_REQUEST["pass"]; $GoogleSync4You->setAccessData($current_user->id, $login, $apikey, $keyfile, $clientid, $refresh, $googleinsert); $GoogleSync4You->connectToGoogle(); if ($GoogleSync4You->isLogged()) { $data["status"] = "ok"; $data["text"] = $mod_strings["LBL_CONNECTING_WORK_CORRECT"]; } else { $data["status"] = "error"; $data["text"] = $GoogleSync4You->getStatus(); } echo json_encode($data);
echo "<div id='google_info_" . $eventid . "_title' style='font-size:12px'>" . $event->title->text . "</div>"; echo $app_strings["Description"] . ": <span id='google_info_" . $eventid . "_desc'>" . $event->content->text . "</span><br />"; echo $app_strings[$is_full_day_event ? "LBL_START_DATE" : "LBL_START_DATE_TIME"] . ": " . $user_date_start; if (!$is_full_day_event) { echo " " . $time_arr['starthour'] . ":" . $time_arr['startmin'] . $time_arr['startfmt']; } echo "<br />"; echo $app_strings[$is_full_day_event ? "LBL_END_DATE" : "LBL_END_DATE_TIME"] . ": " . $user_date_end; if (!$is_full_day_event) { echo " " . $time_arr['endhour'] . ":" . $time_arr['endmin'] . $time_arr['endfmt']; } echo "<br />"; echo $c_mod_strings["Location"] . ": <span id='google_info_" . $eventid . "_location'>" . implode(",", $event->where) . "</span><br />"; //$Where[0]; } else { echo $GoogleSync4You->getStatus(); } function extract_recurrence($ical_string) { $vevent_rawstr = "/(?ims)BEGIN:VEVENT(.*)END:VEVENT/"; preg_match($vevent_rawstr, $ical_string, $matches); $vevent_str = $matches[1]; # now look for DTSTART, DTEND, RRULE, RDATE, EXDATE, and EXRULE $rep_tags = array('DTSTART', 'DTEND', 'RRULE', 'RDATE', 'EXDATE', 'EXRULE'); $recur_list = array(); foreach ($rep_tags as $rep) { $rep_regexp = "/({$rep}(.*))/i"; if (preg_match_all($rep_regexp, $vevent_str, $rmatches)) { foreach ($rmatches[0] as $match) { $recur_list[] = $match; }
<?php /********************************************************************************* * The content of this file is subject to the Calendar4You Free license. * ("License"); You may not use this file except in compliance with the License * The Initial Developer of the Original Code is IT-Solutions4You s.r.o. * Portions created by IT-Solutions4You s.r.o. are Copyright(C) IT-Solutions4You s.r.o. * All Rights Reserved. ********************************************************************************/ include_once 'modules/Calendar4You/GoogleSync4You.php'; global $current_user, $mod_strings; $GoogleSync4You = new GoogleSync4You(); $apikey = $_REQUEST['apikey']; $keyfile = $_REQUEST['keyfile']; $clientid = $_REQUEST['clientid']; $refresh = $_REQUEST['refresh_token']; $googleinsert = $_REQUEST['googleinsert']; $login = $_REQUEST['login']; $pass = $_REQUEST['pass']; $GoogleSync4You->setAccessData($current_user->id, $login, $apikey, $keyfile, $clientid, $refresh, $googleinsert); $GoogleSync4You->connectToGoogle(); if ($GoogleSync4You->isLogged()) { $data['status'] = 'ok'; $data['text'] = $mod_strings['LBL_CONNECTING_WORK_CORRECT']; } else { $data['status'] = 'error'; $data['text'] = $GoogleSync4You->getStatus(); } echo json_encode($data);