Skip to content

Commit

Permalink
Merge branch 'MDL-68343-38' of git://github.com/rezaies/moodle into M…
Browse files Browse the repository at this point in the history
…OODLE_38_STABLE
  • Loading branch information
sarjona committed May 27, 2020
2 parents 13b2617 + f9b144d commit 9e2cb20
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
5 changes: 3 additions & 2 deletions grade/lib.php
Expand Up @@ -1791,8 +1791,9 @@ public function get_grade_analysis_icon(grade_grade $grade) {
return '';
}

return $OUTPUT->action_icon($url, new pix_icon('t/preview',
get_string('gradeanalysis', 'core_grades')));
$title = get_string('gradeanalysis', 'core_grades');
return $OUTPUT->action_icon($url, new pix_icon('t/preview', ''), null,
['title' => $title, 'aria-label' => $title]);
}

/**
Expand Down
7 changes: 4 additions & 3 deletions grade/report/singleview/classes/local/screen/grade.php
Expand Up @@ -208,11 +208,12 @@ public function format_line($item) {
$url = new moodle_url("/user/view.php", array('id' => $item->id, 'course' => $this->courseid));
$iconstring = get_string('filtergrades', 'gradereport_singleview', $fullname);
$grade->label = $fullname;
$userpic = $OUTPUT->user_picture($item, ['link' => false, 'visibletoscreenreaders' => false]);

$line = array(
$OUTPUT->action_icon($this->format_link('user', $item->id), new pix_icon('t/editstring', $iconstring)),
$OUTPUT->user_picture($item, array('visibletoscreenreaders' => false)) .
html_writer::link($url, $fullname),
$OUTPUT->action_icon($this->format_link('user', $item->id), new pix_icon('t/editstring', ''), null,
['title' => $iconstring, 'aria-label' => $iconstring]),
html_writer::link($url, $userpic . $fullname),
$this->item_range()
);
$lineclasses = array(
Expand Down
3 changes: 2 additions & 1 deletion grade/report/singleview/classes/local/screen/tablelike.php
Expand Up @@ -172,7 +172,8 @@ public function html() {

$summary = $this->summary();
if (!empty($summary)) {
$table->summary = $summary;
$table->caption = $summary;
$table->captionhide = true;
}

// To be used for extra formatting.
Expand Down
3 changes: 2 additions & 1 deletion grade/report/singleview/classes/local/screen/user.php
Expand Up @@ -190,7 +190,8 @@ public function format_line($item) {
$grade->label = $item->get_name();

$line = array(
$OUTPUT->action_icon($this->format_link('grade', $item->id), new pix_icon('t/editstring', $iconstring)),
$OUTPUT->action_icon($this->format_link('grade', $item->id), new pix_icon('t/editstring', ''), null,
['title' => $iconstring, 'aria-label' => $iconstring]),
$this->format_icon($item) . $lockicon . $itemlabel,
$this->category($item),
new range($item)
Expand Down
2 changes: 1 addition & 1 deletion grade/report/singleview/templates/text_attribute.mustache
Expand Up @@ -28,6 +28,6 @@
"disabled": "true"
}
}}
<label for="{{name}}" class="accesshide">{{label}}</label>
{{#label}}<label for="{{name}}" class="accesshide">{{label}}</label>{{/label}}
<input id="{{name}}" name="{{name}}" type="text" value="{{value}}" class="form-control" {{#tabindex}}tabindex="{{.}}"{{/tabindex}} {{#disabled}}disabled{{/disabled}}>
<input type="hidden" name="old{{name}}" value="{{value}}">
20 changes: 10 additions & 10 deletions lib/outputcomponents.php
Expand Up @@ -2207,8 +2207,9 @@ public static function table(html_table $table) {
$heading->header = true;
}

if ($heading->header && empty($heading->scope)) {
$heading->scope = 'col';
$tagtype = 'td';
if ($heading->header && (string)$heading->text != '') {
$tagtype = 'th';
}

$heading->attributes['class'] .= ' header c' . $key;
Expand All @@ -2224,16 +2225,15 @@ public static function table(html_table $table) {
$heading->attributes['class'] .= ' ' . $table->colclasses[$key];
}
$heading->attributes['class'] = trim($heading->attributes['class']);
$attributes = array_merge($heading->attributes, array(
'style' => $table->align[$key] . $table->size[$key] . $heading->style,
'scope' => $heading->scope,
'colspan' => $heading->colspan,
));
$attributes = array_merge($heading->attributes, [
'style' => $table->align[$key] . $table->size[$key] . $heading->style,
'colspan' => $heading->colspan,
]);

$tagtype = 'td';
if ($heading->header === true) {
$tagtype = 'th';
if ($tagtype == 'th') {
$attributes['scope'] = !empty($heading->scope) ? $heading->scope : 'col';
}

$output .= html_writer::tag($tagtype, $heading->text, $attributes) . "\n";
}
$output .= html_writer::end_tag('tr') . "\n";
Expand Down

0 comments on commit 9e2cb20

Please sign in to comment.