diff --git a/admin/mnet/peer_forms.php b/admin/mnet/peer_forms.php index 8e3066a9b84f0..4e2e1738978b3 100644 --- a/admin/mnet/peer_forms.php +++ b/admin/mnet/peer_forms.php @@ -38,9 +38,10 @@ function definition() { $mform = $this->_form; - $mform->addElement('text', 'wwwroot', get_string('hostname', 'mnet')); + $mform->addElement('text', 'wwwroot', get_string('hostname', 'mnet'), array('maxlength' => 255, 'size' => 50)); $mform->setType('wwwroot', PARAM_URL); $mform->addRule('wwwroot', null, 'required', null, 'client'); + $mform->addRule('wwwroot', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); $mform->addElement('select', 'applicationid', get_string('applicationtype', 'mnet'), $DB->get_records_menu('mnet_application', array(), 'id,display_name')); @@ -81,11 +82,13 @@ function definition() { $mform->addElement('hidden', 'applicationid'); $mform->addElement('hidden', 'oldpublickey'); - $mform->addElement('text', 'name', get_string('site')); + $mform->addElement('text', 'name', get_string('site'), array('maxlength' => 80, 'size' => 50)); $mform->setType('name', PARAM_NOTAGS); + $mform->addRule('name', get_string('maximumchars', '', 80), 'maxlength', 80, 'client'); - $mform->addElement('text', 'wwwroot', get_string('hostname', 'mnet')); + $mform->addElement('text', 'wwwroot', get_string('hostname', 'mnet'), array('maxlength' => 255, 'size' => 50)); $mform->setType('wwwroot', PARAM_URL); + $mform->addRule('wwwroot', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); $themes = array('' => get_string('forceno')); foreach (array_keys(get_plugin_list('theme')) as $themename) { diff --git a/admin/mnet/peers.php b/admin/mnet/peers.php index 242ee1b414344..4d402edb672af 100644 --- a/admin/mnet/peers.php +++ b/admin/mnet/peers.php @@ -240,7 +240,8 @@ } // process all hosts first since it's the easiest if ($host->id == $CFG->mnet_all_hosts_id) { - $table->data[] = array(html_writer::tag('a', $host->name, array('href'=>$hosturl)), '', '', ''); + $table->data[] = array(html_writer::link($hosturl, get_string('allhosts', 'core_mnet')), '*', '', ''); + continue; } // populate the list of deleted hosts @@ -252,11 +253,11 @@ if ($host->last_connect_time == 0) { $last_connect = get_string('never'); } else { - $last_connect = date('H:i:s d/m/Y', $host->last_connect_time); + $last_connect = userdate($host->last_connect_time, get_string('strftimedatetime', 'core_langconfig')); } $table->data[] = array( html_writer::link($hosturl, $host->name), - html_writer::link($hosturl, $host->wwwroot), + html_writer::link($host->wwwroot, $host->wwwroot), $last_connect, $OUTPUT->single_button(new moodle_url('/admin/mnet/delete.php', array('hostid' => $host->id)), get_string('delete')) ); diff --git a/admin/settings/mnet.php b/admin/settings/mnet.php index c8adb6af627f6..dfbc57f7855a7 100644 --- a/admin/settings/mnet.php +++ b/admin/settings/mnet.php @@ -22,6 +22,9 @@ $hosts = mnet_get_hosts(); foreach ($hosts as $host) { + if ($host->id == $CFG->mnet_all_hosts_id) { + $host->name = get_string('allhosts', 'core_mnet'); + } $ADMIN->add('mnetpeercat', new admin_externalpage( 'mnetpeer' . $host->id, diff --git a/lang/en/mnet.php b/lang/en/mnet.php index 0d9c914baf63a..f087849c0ff64 100644 --- a/lang/en/mnet.php +++ b/lang/en/mnet.php @@ -28,6 +28,7 @@ $string['addhost'] = 'Add host'; $string['addnewhost'] = 'Add a new host'; $string['addtoacl'] = 'Add to access control'; +$string['allhosts'] = 'All hosts'; $string['allhosts_no_options'] = 'No options are available when viewing multiple hosts'; $string['allow'] = 'Allow'; $string['applicationtype'] = 'Application type'; @@ -79,7 +80,7 @@ $string['hideremote'] = 'Hide remote users'; $string['host'] = 'host'; $string['hostcoursenotfound'] = 'Host or course not found'; -$string['hostdeleted'] = 'Ok - host deleted'; +$string['hostdeleted'] = 'Host deleted'; $string['hostexists'] = 'A record already exists for a host with that hostname (it may be deleted). click here to edit that record.'; $string['hostlist'] = 'List of networked hosts'; $string['hostname'] = 'Hostname';