MDL-63037 mnet: fix hostexists string usage

This commit is contained in:
Jake Dallimore 2022-11-08 17:01:40 +08:00
parent fee1b8ce5f
commit d2dd970b19
2 changed files with 3 additions and 4 deletions

View File

@ -59,9 +59,8 @@ class mnet_simple_host_form extends moodleform {
$wwwroot = 'http://'.$wwwroot;
}
if ($host = $DB->get_record('mnet_host', array('wwwroot' => $wwwroot))) {
global $CFG;
return array('wwwroot' => get_string('hostexists', 'mnet',
new moodle_url('/admin/mnet/peers.php', array('hostid' => $host->id))));
$str = get_string('hostexists', 'mnet', (new moodle_url('/admin/mnet/peers.php', ['hostid' => $host->id]))->out());
return array('wwwroot' => $str);
}
return array();
}

View File

@ -82,7 +82,7 @@ $string['hideremote'] = 'Hide remote users';
$string['host'] = 'host';
$string['hostcoursenotfound'] = 'Host or course not found';
$string['hostdeleted'] = 'Host deleted';
$string['hostexists'] = 'A record already exists for a host with that hostname (it may be deleted). <a href="{$a}">click here</a> to edit that record.';
$string['hostexists'] = 'A record already exists for a host with that hostname (it may be deleted). <a href="{$a}">Click here</a> to edit that record.';
$string['hostlist'] = 'List of networked hosts';
$string['hostname'] = 'Hostname';
$string['hostnamehelp'] = 'The fully-qualified domain name of the remote host, e.g. www.example.com';