示例#1
0
 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;
 }
示例#2
0
     if ($calendar->id == $selected_calendar) {
         $selected = "selected";
     } else {
         $selected = "";
     }
     echo "<option value='" . $calendar->id . "' " . $selected . ">" . $calendar->summary . "</option>";
 }
 echo "</select>";
 echo "<br /><br />";
 if ($selected_calendar != "") {
     $display = "block";
 } else {
     $display = "none";
 }
 echo "<div id='google_sync_acc_div' style='display:" . $display . "'>";
 $is_export_disabled = $GoogleSync4You->isDisabled(1);
 if (!$is_export_disabled) {
     $checked1 = "checked";
 } else {
     $checked1 = "";
 }
 echo $app_strings["LBL_EXPORT"] . " &quot;" . $event_name . "&quot; ";
 echo $mod_strings["LBL_EVENTS_TO_GOOGLE"] . ": ";
 echo "<input type='checkbox' name='export_to_calendar' value='1' " . $checked1 . "><br>";
 $is_import_disabled = $GoogleSync4You->isDisabled(2);
 if (!$is_import_disabled) {
     $checked2 = "checked";
 } else {
     $checked2 = "";
 }
 echo $mod_strings["LBL_IMPORT_FROM_G_GOOGLE"] . " &quot;" . $event_name . "&quot; ";