MDL-70172 output: Fix empty links

The approach taken is inline with font-awesome documentation:
https://fontawesome.com/how-to-use/on-the-web/other-topics/accessibility
This commit is contained in:
Shamim Rezaie 2020-12-10 04:02:09 +11:00
parent 95dd305cc6
commit 2896cb83cc
2 changed files with 12 additions and 4 deletions

View File

@ -2016,10 +2016,17 @@ function course_get_cm_move(cm_info $mod, $sr = null) {
$pixicon = 't/move';
}
$attributes = [
'class' => 'editing_move',
'data-action' => 'move',
'data-sectionreturn' => $sr,
'title' => $str->move,
'aria-label' => $str->move,
];
return html_writer::link(
new moodle_url($baseurl, array('copy' => $mod->id)),
$OUTPUT->pix_icon($pixicon, $str->move, 'moodle', array('class' => 'iconsmall', 'title' => '')),
array('class' => 'editing_move', 'data-action' => 'move', 'data-sectionreturn' => $sr)
new moodle_url($baseurl, ['copy' => $mod->id]),
$OUTPUT->pix_icon($pixicon, '', 'moodle', ['class' => 'iconsmall']),
$attributes
);
}
return '';

View File

@ -2294,7 +2294,8 @@ class core_course_renderer extends plugin_renderer_base {
if ($editing && has_capability('moodle/course:update', $context)) {
$streditsummary = get_string('editsummary');
$editsectionurl = new moodle_url('/course/editsection.php', ['id' => $section->id]);
$output .= html_writer::link($editsectionurl, $this->pix_icon('t/edit', $streditsummary)) .
$attributes = ['title' => $streditsummary, 'aria-label' => $streditsummary];
$output .= html_writer::link($editsectionurl, $this->pix_icon('t/edit', ''), $attributes) .
"<br /><br />";
}