MDL-78106 gradereport_grader: Force direction when clicking sort arrow

This commit is contained in:
Kevin Percy 2023-08-25 14:03:06 +08:00
parent a9ea85a15d
commit 3f9dd2f210

View File

@ -598,6 +598,11 @@ abstract class grade_report {
$matrix = ['up' => 'desc', 'down' => 'asc'];
$strsort = get_string($matrix[$direction], 'moodle');
$arrow = $OUTPUT->pix_icon($pix[$direction], '', '', ['class' => 'sorticon']);
if (!empty($sortlink)) {
$sortlink->param('sort', ($direction == 'up' ? 'asc' : 'desc'));
}
return html_writer::link($sortlink, $arrow, ['title' => $strsort, 'aria-label' => $strsort, 'data-collapse' => 'sort',
'class' => 'arrow_link py-1']);
}