MDL-45982: Implement displaying of non error messages from a provider.

This commit is contained in:
Tim Lock
2014-06-13 10:08:03 +09:30
parent 89c7782a91
commit 23c3ce59ff
+10 -1
View File
@@ -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();