MDL-56449 mod_assign: fix formatting of group warnings

This commit is contained in:
Davo Smith 2017-01-05 15:30:09 +00:00
parent e7f3fd59d4
commit 255d3aaaed

View File

@ -644,13 +644,17 @@ class mod_assign_renderer extends plugin_renderer_base {
$cell2 = new html_table_cell(format_string($group->name, false, $status->context));
} else if ($status->preventsubmissionnotingroup) {
if (count($status->usergroups) == 0) {
$notification = new \core\output\notification(get_string('noteam', 'assign'), 'error');
$notification->set_show_closebutton(false);
$cell2 = new html_table_cell(
html_writer::span(get_string('noteam', 'assign'), 'alert alert-error')
$this->output->render($notification)
);
$warningmsg = $this->output->notification(get_string('noteam_desc', 'assign'), 'error');
} else if (count($status->usergroups) > 1) {
$notification = new \core\output\notification(get_string('multipleteams', 'assign'), 'error');
$notification->set_show_closebutton(false);
$cell2 = new html_table_cell(
html_writer::span(get_string('multipleteams', 'assign'), 'alert alert-error')
$this->output->render($notification)
);
$warningmsg = $this->output->notification(get_string('multipleteams_desc', 'assign'), 'error');
}