Permalink
Browse files

Merge branch 'MDL-59668_master' of git://github.com/markn86/moodle

  • Loading branch information...
dmonllao committed Aug 7, 2017
2 parents c9d781d + 6d29ccc commit 68c406ffdda882e535082b5f2b4d8dc3413fe1d7
Showing with 19 additions and 8 deletions.
  1. +4 −1 mod/lti/launch.php
  2. +15 −7 mod/lti/view.php
@@ -51,6 +51,7 @@
require_once($CFG->dirroot.'/mod/lti/locallib.php');
$id = required_param('id', PARAM_INT); // Course Module ID.
$triggerview = optional_param('triggerview', 1, PARAM_BOOL);
$cm = get_coursemodule_from_id('lti', $id, 0, false, MUST_EXIST);
$lti = $DB->get_record('lti', array('id' => $cm->instance), '*', MUST_EXIST);
@@ -62,7 +63,9 @@
require_capability('mod/lti:view', $context);
// Completion and trigger events.
lti_view($lti, $course, $cm, $context);
if ($triggerview) {
lti_view($lti, $course, $cm, $context);
}
$lti->cmid = $cm->id;
lti_launch_tool($lti);
@@ -53,6 +53,7 @@
$id = optional_param('id', 0, PARAM_INT); // Course Module ID, or
$l = optional_param('l', 0, PARAM_INT); // lti ID.
$forceview = optional_param('forceview', 0, PARAM_BOOL);
if ($l) { // Two ways to specify the module.
$lti = $DB->get_record('lti', array('id' => $l), '*', MUST_EXIST);
@@ -89,11 +90,16 @@
$PAGE->set_pagelayout('frametop'); // Most frametops don't include footer, and pre-post blocks.
$PAGE->blocks->show_only_fake_blocks(); // Disable blocks for layouts which do include pre-post blocks.
} else if ($launchcontainer == LTI_LAUNCH_CONTAINER_REPLACE_MOODLE_WINDOW) {
redirect('launch.php?id=' . $cm->id);
if (!$forceview) {
$url = new moodle_url('/mod/lti/launch.php', array('id' => $cm->id));
redirect($url);
}
} else {
$PAGE->set_pagelayout('incourse');
}
lti_view($lti, $course, $cm, $context);
$pagetitle = strip_tags($course->shortname.': '.format_string($lti->name));
$PAGE->set_title($pagetitle);
$PAGE->set_heading($course->fullname);
@@ -111,18 +117,20 @@
}
if ( $launchcontainer == LTI_LAUNCH_CONTAINER_WINDOW ) {
echo "<script language=\"javascript\">//<![CDATA[\n";
echo "window.open('launch.php?id=".$cm->id."','lti-".$cm->id."');";
echo "//]]\n";
echo "</script>\n";
echo "<p>".get_string("basiclti_in_new_window", "lti")."</p>\n";
if (!$forceview) {
echo "<script language=\"javascript\">//<![CDATA[\n";
echo "window.open('launch.php?id=" . $cm->id . "&triggerview=0','lti-" . $cm->id . "');";
echo "//]]\n";
echo "</script>\n";
echo "<p>".get_string("basiclti_in_new_window", "lti")."</p>\n";
}
$url = new moodle_url('/mod/lti/launch.php', array('id' => $cm->id));
echo html_writer::start_tag('p');
echo html_writer::link($url, get_string("basiclti_in_new_window_open", "lti"), array('target' => '_blank'));
echo html_writer::end_tag('p');
} else {
// Request the launch content with an iframe tag.
echo '<iframe id="contentframe" height="600px" width="100%" src="launch.php?id='.$cm->id.'"></iframe>';
echo '<iframe id="contentframe" height="600px" width="100%" src="launch.php?id='.$cm->id.'&triggerview=0"></iframe>';
// Output script to make the iframe tag be as large as possible.
$resize = '

0 comments on commit 68c406f

Please sign in to comment.