MDL-86454 badges: Hide revoke button if not available
This commit is contained in:
+8
-3
@@ -151,12 +151,17 @@ class core_badges_renderer extends plugin_renderer_base {
|
||||
'value' => $this->output->larrow() . ' ' . get_string('award', 'badges'),
|
||||
'class' => 'actionbutton btn btn-secondary')
|
||||
);
|
||||
$actioncell->text .= html_writer::empty_tag('input', array(
|
||||
if (has_capability('moodle/badges:revokebadge', $this->page->context)) {
|
||||
$actioncell->text .= html_writer::empty_tag(
|
||||
'input',
|
||||
[
|
||||
'type' => 'submit',
|
||||
'name' => 'revoke',
|
||||
'value' => get_string('revoke', 'badges') . ' ' . $this->output->rarrow(),
|
||||
'class' => 'actionbutton btn btn-secondary')
|
||||
);
|
||||
'class' => 'actionbutton btn btn-secondary',
|
||||
]
|
||||
);
|
||||
}
|
||||
$actioncell->text .= html_writer::end_tag('div', array());
|
||||
$actioncell->attributes['class'] = 'actions';
|
||||
$potentialcell = new html_table_cell();
|
||||
|
||||
Reference in New Issue
Block a user