mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
Merge branch 'MDL-40867' of git://github.com/timhunt/moodle
This commit is contained in:
commit
86005f4884
@ -178,7 +178,7 @@ function lti_delete_instance($id) {
|
||||
* For this module we just need to support external urls as
|
||||
* activity icons
|
||||
*
|
||||
* @param cm_info $coursemodule
|
||||
* @param stdClass $coursemodule
|
||||
* @return cached_cm_info info
|
||||
*/
|
||||
function lti_get_coursemodule_info($coursemodule) {
|
||||
@ -186,7 +186,7 @@ function lti_get_coursemodule_info($coursemodule) {
|
||||
require_once($CFG->dirroot.'/mod/lti/locallib.php');
|
||||
|
||||
if (!$lti = $DB->get_record('lti', array('id' => $coursemodule->instance),
|
||||
'icon, secureicon, intro, introformat, name')) {
|
||||
'icon, secureicon, intro, introformat, name, toolurl, launchcontainer')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -205,6 +205,19 @@ function lti_get_coursemodule_info($coursemodule) {
|
||||
$info->content = format_module_intro('lti', $lti, $coursemodule->id, false);
|
||||
}
|
||||
|
||||
// Does the link open in a new window?
|
||||
$tool = lti_get_tool_by_url_match($lti->toolurl);
|
||||
if ($tool) {
|
||||
$toolconfig = lti_get_type_config($tool->id);
|
||||
} else {
|
||||
$toolconfig = array();
|
||||
}
|
||||
$launchcontainer = lti_get_launch_container($lti, $toolconfig);
|
||||
if ($launchcontainer == LTI_LAUNCH_CONTAINER_WINDOW) {
|
||||
$launchurl = new moodle_url('/mod/lti/launch.php', array('id' => $coursemodule->id));
|
||||
$info->onclick = "window.open('" . $launchurl->out(false) . "', 'lti'); return false;";
|
||||
}
|
||||
|
||||
$info->name = $lti->name;
|
||||
|
||||
return $info;
|
||||
|
Loading…
x
Reference in New Issue
Block a user