MDL-45982: Implement displaying of non error messages from a provider.
This commit is contained in:
+10
-1
@@ -32,6 +32,7 @@ $courseid = required_param('course', PARAM_INT);
|
||||
$instanceid = optional_param('instanceid', 0, PARAM_INT);
|
||||
|
||||
$errormsg = optional_param('lti_errormsg', '', PARAM_RAW);
|
||||
$msg = optional_param('lti_msg', '', PARAM_RAW);
|
||||
$unsigned = optional_param('unsigned', '0', PARAM_INT);
|
||||
|
||||
$launchcontainer = optional_param('launch_container', LTI_LAUNCH_CONTAINER_WINDOW, PARAM_INT);
|
||||
@@ -48,7 +49,7 @@ if (!empty($instanceid)) {
|
||||
|
||||
require_login($course);
|
||||
|
||||
if (!empty($errormsg)) {
|
||||
if (!empty($errormsg) || !empty($msg)) {
|
||||
$url = new moodle_url('/mod/lti/return.php', array('course' => $courseid));
|
||||
$PAGE->set_url($url);
|
||||
|
||||
@@ -67,7 +68,9 @@ if (!empty($errormsg)) {
|
||||
if (!empty($lti) and !empty($context)) {
|
||||
echo $OUTPUT->heading(format_string($lti->name, true, array('context' => $context)));
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($errormsg)) {
|
||||
echo get_string('lti_launch_error', 'lti');
|
||||
|
||||
echo htmlspecialchars($errormsg);
|
||||
@@ -91,6 +94,12 @@ if (!empty($errormsg)) {
|
||||
}
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
} else if (!empty($msg)) {
|
||||
|
||||
echo htmlspecialchars($msg);
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
} else {
|
||||
$courseurl = new moodle_url('/course/view.php', array('id' => $courseid));
|
||||
$url = $courseurl->out();
|
||||
|
||||
Reference in New Issue
Block a user