Merge branch 'MDL-66936-master' of git://github.com/marinaglancy/moodle

This commit is contained in:
Jake Dallimore 2019-12-10 15:26:41 +08:00
commit 37588be383
3 changed files with 4 additions and 8 deletions

View File

@ -964,7 +964,6 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
foreach ($sections[2]['modules'] as $module) {
if ($module['id'] == $urlcm->id and $module['modname'] == 'url') {
$this->assertContains('width=100,height=100', $module['onclick']);
$this->assertContains('moodle.org', $module['customdata']);
$testexecuted = $testexecuted + 1;
}
}

View File

@ -212,7 +212,7 @@ function url_get_coursemodule_info($coursemodule) {
require_once("$CFG->dirroot/mod/url/locallib.php");
if (!$url = $DB->get_record('url', array('id'=>$coursemodule->instance),
'id, name, course, display, displayoptions, externalurl, parameters, intro, introformat')) {
'id, name, display, displayoptions, externalurl, parameters, intro, introformat')) {
return NULL;
}
@ -243,9 +243,6 @@ function url_get_coursemodule_info($coursemodule) {
$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;
}

View File

@ -460,18 +460,18 @@ function url_get_variable_values($url, $cm, $course, $config) {
$values = array (
'courseid' => $course->id,
'coursefullname' => format_string($course->fullname),
'coursefullname' => format_string($course->fullname, true, array('context' => $coursecontext)),
'courseshortname' => format_string($course->shortname, true, array('context' => $coursecontext)),
'courseidnumber' => $course->idnumber,
'coursesummary' => $course->summary,
'courseformat' => $course->format,
'lang' => current_language(),
'sitename' => format_string($site->fullname),
'sitename' => format_string($site->fullname, true, array('context' => $coursecontext)),
'serverurl' => $CFG->wwwroot,
'currenttime' => time(),
'urlinstance' => $url->id,
'urlcmid' => $cm->id,
'urlname' => format_string($url->name),
'urlname' => format_string($url->name, true, array('context' => $coursecontext)),
'urlidnumber' => $cm->idnumber,
);