mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +02:00
MDL-45429 block_glossary_random: check capability before suggesting to edit
This commit is contained in:
parent
af41a7ef13
commit
a9b8d52d84
1 changed files with 10 additions and 2 deletions
|
@ -148,7 +148,11 @@ class block_glossary_random extends block_base {
|
||||||
|
|
||||||
if (empty($this->config->glossary)) {
|
if (empty($this->config->glossary)) {
|
||||||
$this->content = new stdClass();
|
$this->content = new stdClass();
|
||||||
$this->content->text = get_string('notyetconfigured','block_glossary_random');
|
if ($this->user_can_edit()) {
|
||||||
|
$this->content->text = get_string('notyetconfigured','block_glossary_random');
|
||||||
|
} else {
|
||||||
|
$this->content->text = '';
|
||||||
|
}
|
||||||
$this->content->footer = '';
|
$this->content->footer = '';
|
||||||
return $this->content;
|
return $this->content;
|
||||||
}
|
}
|
||||||
|
@ -175,7 +179,11 @@ class block_glossary_random extends block_base {
|
||||||
$this->instance_config_commit();
|
$this->instance_config_commit();
|
||||||
|
|
||||||
$this->content = new stdClass();
|
$this->content = new stdClass();
|
||||||
$this->content->text = get_string('notyetconfigured','block_glossary_random');
|
if ($this->user_can_edit()) {
|
||||||
|
$this->content->text = get_string('notyetconfigured','block_glossary_random');
|
||||||
|
} else {
|
||||||
|
$this->content->text = '';
|
||||||
|
}
|
||||||
$this->content->footer = '';
|
$this->content->footer = '';
|
||||||
return $this->content;
|
return $this->content;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue