MDL-76466 gradereport_user: Accordion icon uses language direction

This commit is contained in:
David Woloszyn 2022-11-24 20:38:59 +11:00
parent 422da2ed45
commit 177b1f5066
2 changed files with 4 additions and 2 deletions

View File

@ -863,6 +863,8 @@ class user extends grade_report {
// Category. // Category.
if ($type == 'category') { if ($type == 'category') {
// Determine directionality so that icons can be modified to suit language.
$arrow = right_to_left() ? 'left' : 'right';
// Alter style based on whether aggregation is first or last. // Alter style based on whether aggregation is first or last.
if ($this->switch) { if ($this->switch) {
$data['itemname']['class'] = $class . ' ' . "d$depth b1b b1t category"; $data['itemname']['class'] = $class . ' ' . "d$depth b1b b1t category";
@ -871,7 +873,7 @@ class user extends grade_report {
} }
$data['itemname']['colspan'] = ($this->maxdepth - $depth + count($this->tablecolumns)); $data['itemname']['colspan'] = ($this->maxdepth - $depth + count($this->tablecolumns));
$data['itemname']['content'] = $OUTPUT->render_from_template('gradereport_user/user_report_category_content', $data['itemname']['content'] = $OUTPUT->render_from_template('gradereport_user/user_report_category_content',
['categoryid' => $gradeobject->id, 'categoryname' => $fullname]); ['categoryid' => $gradeobject->id, 'categoryname' => $fullname, 'arrow' => $arrow]);
$data['itemname']['id'] = "cat_{$gradeobject->id}_{$this->user->id}"; $data['itemname']['id'] = "cat_{$gradeobject->id}_{$this->user->id}";
// Get the IDs of all parent categories of this grade category. // Get the IDs of all parent categories of this grade category.
$data['parentcategories'] = array_diff(array_filter(explode('/', $gradeobject->path)), [$gradeobject->id]); $data['parentcategories'] = array_diff(array_filter(explode('/', $gradeobject->path)), [$gradeobject->id]);

View File

@ -32,7 +32,7 @@
<i class="icon fa fa-chevron-down fa-fw" title="{{#str}} collapse, core {{/str}}" role="img" aria-label="{{#str}} collapse, core {{/str}}"></i> <i class="icon fa fa-chevron-down fa-fw" title="{{#str}} collapse, core {{/str}}" role="img" aria-label="{{#str}} collapse, core {{/str}}"></i>
</span> </span>
<span class="expanded text-nowrap" title="{{#str}} expand, core {{/str}}"> <span class="expanded text-nowrap" title="{{#str}} expand, core {{/str}}">
<i class="icon fa fa-chevron-right fa-fw" title="{{#str}} expand, core {{/str}}" role="img" aria-label="{{#str}} expand, core {{/str}}"></i> <i class="icon fa fa-chevron-{{arrow}} fa-fw" title="{{#str}} expand, core {{/str}}" role="img" aria-label="{{#str}} expand, core {{/str}}"></i>
</span> </span>
</a> </a>
<span>{{categoryname}}</span> <span>{{categoryname}}</span>