-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
executable file
·31 lines (25 loc) · 920 Bytes
/
Copy pathfunctions.php
File metadata and controls
executable file
·31 lines (25 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
function get_calendar_list($calendar, $include_google = FALSE) {
$calendars = array();
if (!empty($calendar) && !empty($calendar->calendarList)) {
try {
$calendarList = $calendar->calendarList->listCalendarList();
foreach ($calendarList->items as $item) {
if (!$include_google) {
if (!str_contains($item->id, 'calendar.google.com')) {
array_push($calendars, $item->id);
}
} else {
array_push($calendars, $item->id);
}
}
} catch (Exception $e) {
}
}
return $calendars;
}
function print_calendar_options($calendarList, $calendarId) {
foreach ($calendarList as $item) {
echo '<option value="' . $item . '"' . (($item === $calendarId) ? ' selected' : '') . '>' . $item . '</option>';
}
}