MDL-53945 mnet: replace hardcoded admin dir with cfg

Several places in admin/mnet pull in required files using a hardcoded
admin dir string, as this is configurable it needs to use $CFG->admin
instead.

Places where the url is passed through moodle_url don't need to be
updated as that already automatically translates the urls for us.
This commit is contained in:
Adam Olley
2016-11-03 11:12:11 +10:30
parent a8c64d6267
commit c8b70b6ec2
4 changed files with 7 additions and 6 deletions
+2 -1
View File
@@ -60,7 +60,8 @@ 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 . '/admin/mnet/peers.php?hostid=' . $host->id));
return array('wwwroot' => get_string('hostexists', 'mnet',
$CFG->wwwroot . '/' . $CFG->admin . '/mnet/peers.php?hostid=' . $host->id));
}
return array();
}