mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'MDL-65024-master' of git://github.com/jleyva/moodle
This commit is contained in:
commit
cc56e409c3
2 changed files with 5 additions and 1 deletions
|
@ -958,6 +958,7 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
|
||||||
foreach ($sections[2]['modules'] as $module) {
|
foreach ($sections[2]['modules'] as $module) {
|
||||||
if ($module['id'] == $urlcm->id and $module['modname'] == 'url') {
|
if ($module['id'] == $urlcm->id and $module['modname'] == 'url') {
|
||||||
$this->assertContains('width=100,height=100', $module['onclick']);
|
$this->assertContains('width=100,height=100', $module['onclick']);
|
||||||
|
$this->assertContains('moodle.org', $module['customdata']);
|
||||||
$testexecuted = $testexecuted + 1;
|
$testexecuted = $testexecuted + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,7 +212,7 @@ function url_get_coursemodule_info($coursemodule) {
|
||||||
require_once("$CFG->dirroot/mod/url/locallib.php");
|
require_once("$CFG->dirroot/mod/url/locallib.php");
|
||||||
|
|
||||||
if (!$url = $DB->get_record('url', array('id'=>$coursemodule->instance),
|
if (!$url = $DB->get_record('url', array('id'=>$coursemodule->instance),
|
||||||
'id, name, display, displayoptions, externalurl, parameters, intro, introformat')) {
|
'id, name, course, display, displayoptions, externalurl, parameters, intro, introformat')) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,6 +243,9 @@ function url_get_coursemodule_info($coursemodule) {
|
||||||
$info->content = format_module_intro('url', $url, $coursemodule->id, false);
|
$info->content = format_module_intro('url', $url, $coursemodule->id, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$course = get_course($url->course); // Get cached course.
|
||||||
|
$info->customdata = array('fullurl' => str_replace('&', '&', url_get_full_url($url, $coursemodule, $course)));
|
||||||
|
|
||||||
return $info;
|
return $info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue