MDL-53945 mnet: Use moodle_url to provide string with url

Using moodle_url where possible is preferable to hardcoding uri's as
moodle_url is able to take care of alot of the formatting for us.

In this instance, it handles the $CFG->admin url path for us.
This commit is contained in:
Adam Olley
2016-11-04 09:12:00 +10:30
parent c8b70b6ec2
commit d6e1f28ef4
+1 -1
View File
@@ -61,7 +61,7 @@ class mnet_simple_host_form extends moodleform {
if ($host = $DB->get_record('mnet_host', array('wwwroot' => $wwwroot))) {
global $CFG;
return array('wwwroot' => get_string('hostexists', 'mnet',
$CFG->wwwroot . '/' . $CFG->admin . '/mnet/peers.php?hostid=' . $host->id));
new moodle_url('/admin/mnet/peers.php', array('hostid' => $host->id))));
}
return array();
}