MDL-15352: add warning message when no peer are set

This commit is contained in:
jerome 2008-10-30 02:54:11 +00:00
parent e3ca0f3a04
commit d8a560c64e
2 changed files with 7 additions and 1 deletions

View file

@ -300,8 +300,13 @@ class repository_remotemoodle extends repository {
$peers[$host->id] = $host->name;
}
$mform->addElement('select', 'peer', get_string('peer', 'repository_remotemoodle'),$peers);
$mform->addRule('peer', get_string('required'), 'required', null, 'client');
if (empty($peers)) {
$mform->addElement('static', null, '', get_string('nopeer','repository_remotemoodle'));
}
}
/**