MDL-59368 groups: Show no groups instead of ''

This is on the inplace editable for a users course groups.
This commit is contained in:
Damyon Wiese 2017-07-05 10:10:13 +08:00
parent 76c493b3f2
commit 4aad7c2be2

View file

@ -92,7 +92,11 @@ class user_groups_editable extends \core\output\inplace_editable {
$listofgroups[] = format_string($this->coursegroups[$id]->name, true, ['context' => $this->context]);
}
$this->displayvalue = implode($listofgroups, ', ');
if (!empty($listofgroups)) {
$this->displayvalue = implode($listofgroups, ', ');
} else {
$this->displayvalue = get_string('groupsnone');
}
return parent::export_for_template($output);
}