function getGoogleSyncClass($save_user_id, $event, $selected_calendar = '')
 {
     global $adb;
     $GoogleSync4You = new GoogleSync4You();
     $have_access_data = $GoogleSync4You->setAccessDataForUser($save_user_id, true);
     if ($have_access_data) {
         $GoogleSync4You->connectToGoogle();
         if ($GoogleSync4You->is_logged) {
             $GoogleSync4You->setEvent($event);
             if ($selected_calendar == '') {
                 $selected_calendar = $GoogleSync4You->getSCalendar(1);
             }
             $is_disabled = $GoogleSync4You->isDisabled(1);
             //export
             if (!$is_disabled && $selected_calendar != '') {
                 return $GoogleSync4You;
             }
         }
     }
     return false;
 }
Beispiel #2
0
?>
        </div>
        <!-- Google Cal Sync info -->
        <div id="TabEventGoogleCalSync" style="display: none; width: 100%;padding-top:10px;">
        <?php 
if ($google_sync_id) {
    $user_fullname = getITSUserFullName($current_user->id);
    require_once 'modules/Calendar4You/GoogleSync4You.php';
    $GoogleSync4You = new GoogleSync4You();
    $have_access_data = $GoogleSync4You->setAccessDataForUser($current_user->id);
    if ($have_access_data) {
        $GoogleSync4You->connectToGoogle();
        if (!$GoogleSync4You->is_logged) {
            echo $GoogleSync4You->getStatus();
        } else {
            $GoogleSync4You->setEvent($id);
            $selected_calendar = $GoogleSync4You->getSCalendar("1");
            echo $mod_strings["LBL_TO_GOOGLE_CALENDAR"] . ": ";
            $listFeed = $GoogleSync4You->getGoogleCalendars();
            echo "<select name='selected_calendar' onChange='showGoogleSyncAccDiv(this.value)'>";
            echo "<option value=''></option>";
            foreach ($listFeed as $calendar) {
                if ($calendar->id == $selected_calendar) {
                    $selected = "selected";
                } else {
                    $selected = "";
                }
                echo "<option value='" . $calendar->id . "' " . $selected . ">" . $calendar->summary . "</option>";
            }
            echo "</select>";
            echo "<br /><br />";