@@ -1,24 +1,24 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once(__DIR__ . '/.ignore.calendar-ics-authentication.inc.php'); |
|
4 | -require_once(__DIR__ . '/config.inc.php'); |
|
3 | +require_once(__DIR__.'/.ignore.calendar-ics-authentication.inc.php'); |
|
4 | +require_once(__DIR__.'/config.inc.php'); |
|
5 | 5 | |
6 | -require_once(APP_PATH . '/include/canvas-api.inc.php'); |
|
7 | -require_once(APP_PATH . '/include/mysql.inc.php'); |
|
6 | +require_once(APP_PATH.'/include/canvas-api.inc.php'); |
|
7 | +require_once(APP_PATH.'/include/mysql.inc.php'); |
|
8 | 8 | |
9 | -require_once(__DIR__ . '/common.inc.php'); |
|
9 | +require_once(__DIR__.'/common.inc.php'); |
|
10 | 10 | |
11 | 11 | // FIXME: should filter so that the syncs for the server we're running against (INDEX_WEB_PATH) are called (or is that already happening?) |
12 | 12 | $schedulesResponse = mysqlQuery(" |
13 | 13 | SELECT * |
14 | 14 | FROM `schedules` |
15 | 15 | WHERE |
16 | - `schedule` = '" . mysqlEscapeString($argv[INDEX_SCHEDULE]) . "' |
|
16 | + `schedule` = '" . mysqlEscapeString($argv[INDEX_SCHEDULE])."' |
|
17 | 17 | ORDER BY |
18 | 18 | `synced` ASC |
19 | 19 | "); |
20 | 20 | |
21 | -while($schedule = $schedulesResponse->fetch_assoc()) { |
|
21 | +while ($schedule = $schedulesResponse->fetch_assoc()) { |
|
22 | 22 | $calendarResponse = mysqlQuery(" |
23 | 23 | SELECT * |
24 | 24 | FROM `calendars` |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | `id` = '{$schedule['calendar']}' |
27 | 27 | "); |
28 | 28 | if ($calendar = $calendarResponse->fetch_assoc()) { |
29 | - shell_exec('curl -u ' . MYSQL_USER . ':' . MYSQL_PASSWORD . ' -k "https://skunkworks.stmarksschool.org/canvas/ics-sync/import.php?cal=' . urlencode($calendar['ics_url']) . '&canvas_url=' . urlencode($calendar['canvas_url']) . '&schedule=' . urlencode($schedule['id']) . '"'); |
|
29 | + shell_exec('curl -u '.MYSQL_USER.':'.MYSQL_PASSWORD.' -k "https://skunkworks.stmarksschool.org/canvas/ics-sync/import.php?cal='.urlencode($calendar['ics_url']).'&canvas_url='.urlencode($calendar['canvas_url']).'&schedule='.urlencode($schedule['id']).'"'); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once(__DIR__ . '/.ignore.calendar-ics-authentication.inc.php'); |
|
4 | -require_once(__DIR__ . '/config.inc.php'); |
|
3 | +require_once(__DIR__.'/.ignore.calendar-ics-authentication.inc.php'); |
|
4 | +require_once(__DIR__.'/config.inc.php'); |
|
5 | 5 | |
6 | -require_once(APP_PATH . '/include/page-generator.inc.php'); |
|
7 | -require_once(APP_PATH . '/include/canvas-api.inc.php'); |
|
8 | -require_once(APP_PATH . '/include/mysql.inc.php'); |
|
6 | +require_once(APP_PATH.'/include/page-generator.inc.php'); |
|
7 | +require_once(APP_PATH.'/include/canvas-api.inc.php'); |
|
8 | +require_once(APP_PATH.'/include/mysql.inc.php'); |
|
9 | 9 | |
10 | 10 | $eventsApi = new CanvasApiProcess(CANVAS_API_URL, CANVAS_API_TOKEN); |
11 | 11 | $api = new CanvasApiProcess(CANVAS_API_URL, CANVAS_API_TOKEN); |
@@ -20,14 +20,14 @@ discard block |
||
20 | 20 | ) |
21 | 21 | ); |
22 | 22 | do { |
23 | - foreach($events as $event) { |
|
23 | + foreach ($events as $event) { |
|
24 | 24 | $api->delete("calendar_events/{$event['id']}", |
25 | 25 | array( |
26 | - 'cancel_reason' => TOOL_NAME . " course_url={$_REQUEST['course_url']}" |
|
26 | + 'cancel_reason' => TOOL_NAME." course_url={$_REQUEST['course_url']}" |
|
27 | 27 | ) |
28 | 28 | ); |
29 | 29 | } |
30 | -} while($events = $eventsApi->nextPage()); |
|
30 | +} while ($events = $eventsApi->nextPage()); |
|
31 | 31 | |
32 | 32 | echo('Calendar purged.'); |
33 | 33 |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once(__DIR__ . '/config.inc.php'); |
|
3 | +require_once(__DIR__.'/config.inc.php'); |
|
4 | 4 | |
5 | -require_once(APP_PATH . '/include/page-generator.inc.php'); |
|
5 | +require_once(APP_PATH.'/include/page-generator.inc.php'); |
|
6 | 6 | |
7 | 7 | // TODO: might be nice to have an option to remove a previously synced ICS feed |
8 | 8 |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once(__DIR__ . '/.ignore.calendar-ics-authentication.inc.php'); |
|
4 | -require_once(__DIR__ . '/config.inc.php'); |
|
3 | +require_once(__DIR__.'/.ignore.calendar-ics-authentication.inc.php'); |
|
4 | +require_once(__DIR__.'/config.inc.php'); |
|
5 | 5 | |
6 | -require_once(APP_PATH . '/include/page-generator.inc.php'); |
|
7 | -require_once(APP_PATH . '/include/canvas-api.inc.php'); |
|
6 | +require_once(APP_PATH.'/include/page-generator.inc.php'); |
|
7 | +require_once(APP_PATH.'/include/canvas-api.inc.php'); |
|
8 | 8 | |
9 | 9 | |
10 | 10 | if (isset($_REQUEST['course_url'])) { |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | displayPage(' |
16 | 16 | <h3>Course Calendar ICS Feed</h3> |
17 | 17 | <p>You can subscribe to the calendar for <a href="https://' . |
18 | - parse_url(CANVAS_API_URL, PHP_URL_HOST) . '/courses/' . $courseId . |
|
19 | - '">' . $course['name'] . '</a> at <a href="' . |
|
20 | - $webcalFeed . '">' . $webcalFeed . |
|
18 | + parse_url(CANVAS_API_URL, PHP_URL_HOST).'/courses/'.$courseId. |
|
19 | + '">'.$course['name'].'</a> at <a href="'. |
|
20 | + $webcalFeed.'">'.$webcalFeed. |
|
21 | 21 | '</a> in any calendar application that supports external ICS feeds.</p>' |
22 | 22 | ); |
23 | 23 | exit; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | } |
28 | 28 | } else { |
29 | 29 | displayPage(' |
30 | - <form method="post" action="' . $_SERVER['PHP_SELF'] . '"> |
|
30 | + <form method="post" action="' . $_SERVER['PHP_SELF'].'"> |
|
31 | 31 | <label for="course_url">Course URL <span class="comment">The URL to the course whose calendar you would like to export as an ICS feed</span></label> |
32 | 32 | <input id="course_url" name="course_url" type="text" /> |
33 | 33 | <input type="submit" value="Generate ICS Feed" /> |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /* this will break if there are mod_rewrites, but will do for now... */ |
4 | -define('APP_URL', 'http://' . $_SERVER['SERVER_NAME'] . str_replace(realpath($_SERVER['DOCUMENT_ROOT']), '', realpath(__DIR__))); |
|
4 | +define('APP_URL', 'http://'.$_SERVER['SERVER_NAME'].str_replace(realpath($_SERVER['DOCUMENT_ROOT']), '', realpath(__DIR__))); |
|
5 | 5 | define('APP_PATH', realpath(__DIR__)); |
6 | 6 | |
7 | 7 | /* customize generated pages */ |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once(__DIR__ . '/../config.inc.php'); |
|
3 | +require_once(__DIR__.'/../config.inc.php'); |
|
4 | 4 | |
5 | 5 | header('Content-type: text/css'); |
6 | 6 | header('X-Content-Type-Options: nosniff'); // because IE is not trusting |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once(__DIR__ . '/../config.inc.php'); |
|
3 | +require_once(__DIR__.'/../config.inc.php'); |
|
4 | 4 | |
5 | 5 | header('Content-type: text/css'); |
6 | 6 | header('X-Content-Type-Options: nosniff'); // because IE is not trusting |
@@ -1,42 +1,42 @@ |
||
1 | 1 | <?php |
2 | 2 | if (!defined('BASE')) define('BASE', './'); |
3 | -$current_view ='print'; |
|
3 | +$current_view = 'print'; |
|
4 | 4 | require_once(BASE.'functions/date_functions.php'); |
5 | 5 | require_once(BASE.'functions/init.inc.php'); |
6 | -$start_week_time = strtotime(dateOfWeek($getdate, $phpiCal_config->week_start_day)); |
|
7 | -$end_week_time = $start_week_time + (6 * 25 * 60 * 60); |
|
8 | -$parse_month = date ("Ym", strtotime($getdate)); |
|
6 | +$start_week_time = strtotime(dateOfWeek($getdate, $phpiCal_config->week_start_day)); |
|
7 | +$end_week_time = $start_week_time + (6*25*60*60); |
|
8 | +$parse_month = date("Ym", strtotime($getdate)); |
|
9 | 9 | $events_week = 0; |
10 | -$unix_time = strtotime($getdate); |
|
10 | +$unix_time = strtotime($getdate); |
|
11 | 11 | $printview = $phpiCal_config->default_view; |
12 | 12 | if (isset($_GET['printview'])) $printview = $_GET['printview']; |
13 | 13 | |
14 | 14 | if ($printview == 'day') { |
15 | - $display_date = localizeDate ($dateFormat_day, strtotime($getdate)); |
|
15 | + $display_date = localizeDate($dateFormat_day, strtotime($getdate)); |
|
16 | 16 | $next = date("Ymd", strtotime("+1 day", $unix_time)); |
17 | 17 | $prev = date("Ymd", strtotime("-1 day", $unix_time)); |
18 | 18 | $week_start = ''; |
19 | - $week_end = ''; |
|
19 | + $week_end = ''; |
|
20 | 20 | } elseif ($printview == 'week') { |
21 | 21 | $start_week = localizeDate($dateFormat_week, $start_week_time); |
22 | 22 | $end_week = localizeDate($dateFormat_week, $end_week_time); |
23 | - $display_date = "$start_week - $end_week"; |
|
23 | + $display_date = "$start_week - $end_week"; |
|
24 | 24 | $week_start = date("Ymd", $start_week_time); |
25 | 25 | $week_end = date("Ymd", $end_week_time); |
26 | 26 | $next = date("Ymd", strtotime("+1 week", $unix_time)); |
27 | 27 | $prev = date("Ymd", strtotime("-1 week", $unix_time)); |
28 | 28 | } elseif ($printview == 'month') { |
29 | - $display_date = localizeDate ($dateFormat_month, strtotime($getdate)); |
|
29 | + $display_date = localizeDate($dateFormat_month, strtotime($getdate)); |
|
30 | 30 | $next = date("Ymd", strtotime("+1 month", $unix_time)); |
31 | 31 | $prev = date("Ymd", strtotime("-1 month", $unix_time)); |
32 | - $week_start = ''; |
|
33 | - $week_end = ''; |
|
32 | + $week_start = ''; |
|
33 | + $week_end = ''; |
|
34 | 34 | } elseif ($printview == 'year') { |
35 | - $display_date = localizeDate ($dateFormat_year, strtotime($getdate)); |
|
35 | + $display_date = localizeDate($dateFormat_year, strtotime($getdate)); |
|
36 | 36 | $next = date("Ymd", strtotime("+1 year", $unix_time)); |
37 | 37 | $prev = date("Ymd", strtotime("-1 year", $unix_time)); |
38 | - $week_start = ''; |
|
39 | - $week_end = ''; |
|
38 | + $week_start = ''; |
|
39 | + $week_end = ''; |
|
40 | 40 | } |
41 | 41 | require_once(BASE.'functions/ical_parser.php'); |
42 | 42 | require_once(BASE.'functions/list_functions.php'); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | /* Rewritten by J. Hu 4/2/06*/ |
4 | 4 | $current_view = 'rss_index'; |
5 | -define('BASE','../'); |
|
5 | +define('BASE', '../'); |
|
6 | 6 | require_once(BASE.'functions/init.inc.php'); |
7 | 7 | require_once(BASE.'functions/calendar_functions.php'); |
8 | 8 | |
@@ -11,10 +11,10 @@ discard block |
||
11 | 11 | } |
12 | 12 | |
13 | 13 | if (empty($default_path)) { |
14 | - if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on' ) { |
|
15 | - $default_path = 'https://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/rss/')); |
|
14 | + if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') { |
|
15 | + $default_path = 'https://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], '/rss/')); |
|
16 | 16 | } else { |
17 | - $default_path = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'],'/rss/')); |
|
17 | + $default_path = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], '/rss/')); |
|
18 | 18 | } |
19 | 19 | } |
20 | 20 | |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $display_date = "RSS Info"; |
23 | 23 | |
24 | 24 | $rss_list = "<table width='90%'>\n"; |
25 | -$xml_icon ="<img src = 'feed.png' alt='rss icon'>"; |
|
25 | +$xml_icon = "<img src = 'feed.png' alt='rss icon'>"; |
|
26 | 26 | $cals[] = ''; |
27 | 27 | $cal_displaynames[] = $all_cal_comb_lang; |
28 | 28 | foreach ($cals as $k=>$file) { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | // $cal is a urlencoded version of $cal_filename |
31 | 31 | // $cal_displayname is $cal_filename with occurrences of "32" replaced with " " |
32 | 32 | |
33 | - $rss_list .= '<tr><td rowspan ="3"><font class="V12" color="blue"><b>'.$cal_displaynames[$k].' '. $lang['l_calendar'].'</b></font></td>'; |
|
33 | + $rss_list .= '<tr><td rowspan ="3"><font class="V12" color="blue"><b>'.$cal_displaynames[$k].' '.$lang['l_calendar'].'</b></font></td>'; |
|
34 | 34 | |
35 | 35 | /* Changed to show links without urlencode, but links valid urls */ |
36 | 36 | $rss_list .= "<td>".$lang['l_day']."</td>"; |