Skip to content

Commit

Permalink
PM-43524 fixed hardcoded strings in lti_select.php.
Browse files Browse the repository at this point in the history
  • Loading branch information
jvs-kialo committed Nov 27, 2023
1 parent cabf69c commit e8cd3cb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### v1.0.24 (Build - 2023111701)
### v1.0.24 (Build - 2023111702)

* Send plugin's version and "platform" information using standard LTI claims.
* Replaced hardcoded strings in lti_select.php.

### v1.0.23 (Build - 2023102005)

Expand Down
6 changes: 6 additions & 0 deletions lang/en/kialo.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,19 @@
// Displayed while redirecting to Kialo during the LTI flows.
$string['redirect_title'] = "Loading";
$string['redirect_loading'] = "Loading";
$string['close_prompt'] = 'You can close this window now.';

// Errors.
$string['errors:nopermissiontoview'] = "You do not have permission to view this activity.";
$string['errors:ltiauth'] = "Authentication failed due to an unexpected error. Please try again.";
$string['errors:resourcelink'] = "Activity cannot be displayed due to an unexpected error. Please try again.";
$string['errors:deeplinking'] = "Something went wrong with the discussion selection. Please try again.";
$string['errors:noguestaccess'] = "Guests cannot access this activity. Please log in.";
$string['errors:invalidrequest'] = "Invalid request";
$string['errors:missingdeploymentid'] = "Missing deployment id";
$string['errors:missingcourseid'] = "Missing course id";
$string['errors:missingidtoken'] = "Missing id token";
$string['errors:missingsessiondata'] = "Missing session data";

// Privacy API.
$string['privacy:metadata:kialo'] =
Expand Down
14 changes: 7 additions & 7 deletions lti_select.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,19 @@
</script>";

// The user should basically not see this, or just very briefly.
echo '<br><br><br><br><center>You can close this window now.</center>';
echo "<br><br><br><br><center>" . get_string('close_prompt', 'mod_kialo') . "</center>";
} else {
$error = "Invalid request";
$error = "errors:invalidrequest";
if (empty($deploymentid)) {
$error = "Missing deployment id";
$error = "errors:missingdeploymentid";
} else if (empty($courseid)) {
$error = "Missing course id";
$error = "errors:missingcourseid";
} else if (empty($idtoken)) {
$error = "Missing id token";
$error = "errors:missingidtoken";
} else if (empty($_SESSION['kialo_deployment_id'])) {
$error = "Missing session data";
$error = "errors:missingsessiondata";
}

// Should not happen (but could if someone intentionally calls this page with wrong params). Display moodle error page.
throw new \moodle_exception('errors:deeplinking', 'kialo', "", null, $error);
throw new \moodle_exception('errors:deeplinking', 'kialo', "", null, get_string($error, 'mod_kialo'));
}
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
$plugin->component = 'mod_kialo';

// See https://moodledev.io/docs/apis/commonfiles/version.php.
$plugin->version = 2023111701; // Must be incremented for each new release!
$plugin->version = 2023111702; // Must be incremented for each new release!
$plugin->release = '1.0.24'; // Semantic version.

// Officially we require PHP 7.4. The first Moodle version that requires this as a minimum is Moodle 4.1.
Expand Down

0 comments on commit e8cd3cb

Please sign in to comment.