Merge branch 'MDL-74162-master' of https://github.com/mihailges/moodle

This commit is contained in:
Sara Arjona 2022-03-14 16:41:47 +01:00
commit 066b9ac6ed

View file

@ -153,11 +153,11 @@ class standard_action_bar implements renderable, templatable {
* Render the add entry button * Render the add entry button
* *
* @param renderer_base $output * @param renderer_base $output
* @return \stdClass * @return \stdClass|null
*/ */
private function create_add_button(renderer_base $output): \stdClass { private function create_add_button(renderer_base $output): ?\stdClass {
if (!has_capability('mod/glossary:write', $this->context)) { if (!has_capability('mod/glossary:write', $this->context)) {
return ''; return null;
} }
$btn = new single_button(new moodle_url('/mod/glossary/edit.php', ['cmid' => $this->cm->id]), $btn = new single_button(new moodle_url('/mod/glossary/edit.php', ['cmid' => $this->cm->id]),
get_string('addsingleentry', 'glossary'), 'post', true); get_string('addsingleentry', 'glossary'), 'post', true);