diff --git a/admin/roles/classes/capability_table_with_risks.php b/admin/roles/classes/capability_table_with_risks.php index b62ad19c4091d..db7e16bc83f99 100644 --- a/admin/roles/classes/capability_table_with_risks.php +++ b/admin/roles/classes/capability_table_with_risks.php @@ -183,9 +183,14 @@ protected function add_row_cells($capability) { public function get_risk_icon($type) { global $OUTPUT; - $text = $OUTPUT->pix_icon('i/' . str_replace('risk', 'risk_', $type), get_string($type . 'short', 'admin')); + $alt = get_string("{$type}short", "admin"); + $title = get_string($type, "admin"); + + $text = $OUTPUT->pix_icon('i/' . str_replace('risk', 'risk_', $type), $alt, 'moodle', [ + 'title' => $title, + ]); $action = new popup_action('click', $this->risksurl, 'docspopup'); - $riskicon = $OUTPUT->action_link($this->risksurl, $text, $action, array('title'=>get_string($type, 'admin'))); + $riskicon = $OUTPUT->action_link($this->risksurl, $text, $action); return $riskicon; }