@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | /** |
| 21 | 21 | * Generate a SECRETS_FILE from user input. |
| 22 | 22 | * |
| 23 | - * @param scalar $step optional Where are we in the SECRETS_FILE creation workflow? (defaults to SECRETS_NEEDED_STEP -- the beginning) |
|
| 23 | + * @param integer $step optional Where are we in the SECRETS_FILE creation workflow? (defaults to SECRETS_NEEDED_STEP -- the beginning) |
|
| 24 | 24 | * |
| 25 | 25 | * @throws CanvasAPIviaLTI_Installer_Exception If form submission does not contain all required MySQL credentals (host, username, password and database) |
| 26 | 26 | * @throws CanvasAPIviaLTI_Installer_Exception If SECRETS_FILE cannot be created |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | /** |
| 262 | 262 | * Obtain a Canvas API token, if needed. |
| 263 | 263 | * |
| 264 | - * @param scalar $step optional Where are we in the API token negotiation workflow? (defaults to API_DECISION_NEEDED_STEP -- the beginning) |
|
| 264 | + * @param integer $step optional Where are we in the API token negotiation workflow? (defaults to API_DECISION_NEEDED_STEP -- the beginning) |
|
| 265 | 265 | * @param boolean $skip optional Skip this step (defaults to FALSE) |
| 266 | 266 | * |
| 267 | 267 | * @throws CanvasAPIviaLTI_Installer_Exception If $step is not a pre-defined *_STEP constant |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | $htaccessFile = __DIR__ . '/.htaccess'; |
| 99 | - if(!file_put_contents($htaccessFile, "AuthType Basic\nAuthName \"{$secrets->app->name} Admin\"\nAuthUserFile $htpasswdFile\nRequire valid-user\n")) { |
|
| 99 | + if (!file_put_contents($htaccessFile, "AuthType Basic\nAuthName \"{$secrets->app->name} Admin\"\nAuthUserFile $htpasswdFile\nRequire valid-user\n")) { |
|
| 100 | 100 | throw new CanvasAPIviaLTI_Installer_Exception( |
| 101 | 101 | "Failed to create $htaccessFile", |
| 102 | 102 | CanvasAPIviaLTI_Installer_Exception::HTACCESS_FILE |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | } elseif (file_exists($ltiSchema)) { |
| 155 | 155 | $queries = explode(";", file_get_contents($ltiSchema)); |
| 156 | 156 | $created = true; |
| 157 | - foreach($queries as $query) { |
|
| 157 | + foreach ($queries as $query) { |
|
| 158 | 158 | if (!empty(trim($query))) { |
| 159 | 159 | if (!$sql->query($query)) { |
| 160 | 160 | throw new CanvasAPIviaLTI_Installer_Exception( |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
| 94 | - * @return string|boolean The API access token for this user, or FALSE if no token has been acquired |
|
| 94 | + * @return string|false The API access token for this user, or FALSE if no token has been acquired |
|
| 95 | 95 | **/ |
| 96 | 96 | public function getToken() { |
| 97 | 97 | if ($this->token) { |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | /** |
| 136 | - * @return string|boolean The URL of the API for which the user's API token is valid, or FALSE if no token has been acquired |
|
| 136 | + * @return string|false The URL of the API for which the user's API token is valid, or FALSE if no token has been acquired |
|
| 137 | 137 | **/ |
| 138 | 138 | function getAPIUrl() { |
| 139 | 139 | if ($this->apiUrl) { |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | UserAPIToken_Exception::TOKEN_REQUIRED |
| 117 | 117 | ); |
| 118 | 118 | } |
| 119 | - if($this->consumerKey && $this->id && $this->sql) { |
|
| 119 | + if ($this->consumerKey && $this->id && $this->sql) { |
|
| 120 | 120 | $_token = $this->sql->real_escape_string($token); |
| 121 | 121 | if (!$this->sql->query("UPDATE `" . self::USER_TOKENS_TABLE . "` set `token` = '$_token' WHERE `consumer_key` = '{$this->consumerKey}' AND `id` = '{$this->id}'")) { |
| 122 | 122 | throw new UserAPIToken_Exception( |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | `synced` ASC |
| 15 | 15 | "); |
| 16 | 16 | |
| 17 | -while($schedule = $schedulesResponse->fetch_assoc()) { |
|
| 17 | +while ($schedule = $schedulesResponse->fetch_assoc()) { |
|
| 18 | 18 | $calendarResponse = $sql->query(" |
| 19 | 19 | SELECT * |
| 20 | 20 | FROM `calendars` |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | $smarty->assign('category', ''); |
| 7 | 7 | $smarty->assign('formAction', $metadata['APP_URL'] . '/import.php'); |
| 8 | 8 | $smarty->assign('formHidden', array( |
| 9 | - 'canvas_url' => $_SESSION['canvasInstanceUrl']. '/courses/' . $_SESSION['toolProvider']->user->getResourceLink()->settings['custom_canvas_course_id'] |
|
| 9 | + 'canvas_url' => $_SESSION['canvasInstanceUrl'] . '/courses/' . $_SESSION['toolProvider']->user->getResourceLink()->settings['custom_canvas_course_id'] |
|
| 10 | 10 | )); |
| 11 | 11 | $smarty->display('course.tpl'); |
| 12 | 12 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | |
| 16 | 16 | /* ...otherwise, let's start with the SECRETS_FILE */ |
| 17 | 17 | } else { |
| 18 | - if(!file_exists(SECRETS_FILE)) { |
|
| 18 | + if (!file_exists(SECRETS_FILE)) { |
|
| 19 | 19 | if (isset($_REQUEST['step']) && $_REQUEST['step'] == CanvasAPIviaLTI_Installer::SECRETS_ENTERED_STEP) { |
| 20 | 20 | CanvasAPIviaLTI_Installer::createSecretsFile(CanvasAPIviaLTI_Installer::SECRETS_ENTERED_STEP); |
| 21 | 21 | } else { |
@@ -15,14 +15,14 @@ |
||
| 15 | 15 | ) |
| 16 | 16 | ); |
| 17 | 17 | do { |
| 18 | - foreach($events as $event) { |
|
| 18 | + foreach ($events as $event) { |
|
| 19 | 19 | $api->delete("calendar_events/{$event['id']}", |
| 20 | 20 | array( |
| 21 | 21 | 'cancel_reason' => $metadata['APP_NAME'] . " course_url={$_REQUEST['course_url']}" |
| 22 | 22 | ) |
| 23 | 23 | ); |
| 24 | 24 | } |
| 25 | - } while($events = $eventsApi->nextPage()); |
|
| 25 | + } while ($events = $eventsApi->nextPage()); |
|
| 26 | 26 | |
| 27 | 27 | $smarty->assign('content', 'Calendar purged.'); |
| 28 | 28 | } else { |
@@ -85,7 +85,7 @@ |
||
| 85 | 85 | $FIELD_MAP = array( |
| 86 | 86 | 'calendar_event[title]' => 'SUMMARY', |
| 87 | 87 | 'calendar_event[description]' => 'DESCRIPTION', |
| 88 | - 'calendar_event[start_at]' => array ( |
|
| 88 | + 'calendar_event[start_at]' => array( |
|
| 89 | 89 | 0 => 'X-CURRENT-DTSTART', |
| 90 | 90 | 1 => 'DTSTART' |
| 91 | 91 | ), |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | $_REQUEST['canvas_url'] = $argv[2]; |
| 7 | 7 | $_REQUEST['schedule'] = $argv[3]; |
| 8 | 8 | |
| 9 | - define ('IGNORE_LTI', true); |
|
| 9 | + define('IGNORE_LTI', true); |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | require_once 'common.inc.php'; |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | if ($canvasContext = getCanvasContext($_REQUEST['canvas_url'])) { |
| 101 | 101 | /* check ICS feed to be sure it exists */ |
| 102 | - if(urlExists($_REQUEST['cal'])) { |
|
| 102 | + if (urlExists($_REQUEST['cal'])) { |
|
| 103 | 103 | /* look up the canvas object -- mostly to make sure that it exists! */ |
| 104 | 104 | if ($canvasObject = $api->get($canvasContext['verification_url'])) { |
| 105 | 105 | |
@@ -185,10 +185,10 @@ discard block |
||
| 185 | 185 | // TODO:0 the best window for syncing would be the term of the course in question, right? issue:12 |
| 186 | 186 | // TODO:0 Arbitrarily selecting events in for a year on either side of today's date, probably a better system? issue:12 |
| 187 | 187 | foreach ($ics->selectComponents( |
| 188 | - date('Y')-1, // startYear |
|
| 188 | + date('Y') - 1, // startYear |
|
| 189 | 189 | date('m'), // startMonth |
| 190 | 190 | date('d'), // startDay |
| 191 | - date('Y')+1, // endYEar |
|
| 191 | + date('Y') + 1, // endYEar |
|
| 192 | 192 | date('m'), // endMonth |
| 193 | 193 | date('d'), // endDay |
| 194 | 194 | 'vevent', // cType |