MDL-45429 block_glossary_random: check capability before suggesting to edit

This commit is contained in:
Marina Glancy 2014-05-06 16:05:20 +08:00
parent af41a7ef13
commit a9b8d52d84

View file

@ -148,7 +148,11 @@ class block_glossary_random extends block_base {
if (empty($this->config->glossary)) {
$this->content = new stdClass();
if ($this->user_can_edit()) {
$this->content->text = get_string('notyetconfigured','block_glossary_random');
} else {
$this->content->text = '';
}
$this->content->footer = '';
return $this->content;
}
@ -175,7 +179,11 @@ class block_glossary_random extends block_base {
$this->instance_config_commit();
$this->content = new stdClass();
if ($this->user_can_edit()) {
$this->content->text = get_string('notyetconfigured','block_glossary_random');
} else {
$this->content->text = '';
}
$this->content->footer = '';
return $this->content;
}