Skip to content

Commit

Permalink
Merge branch 'MDL-78550-master' of https://github.com/junpataleta/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyatregubov committed Aug 7, 2023
2 parents 1474f74 + eaa1ce1 commit 2e18ba8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
2 changes: 0 additions & 2 deletions grade/classes/output/gradebook_setup_action_bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public function export_for_template(\renderer_base $output): array {
'get',
\single_button::BUTTON_SECONDARY,
[
'class' => 'btn btn-secondary',
'data-courseid' => $courseid,
'data-itemid' => -1,
'data-trigger' => 'add-item-form',
Expand Down Expand Up @@ -99,7 +98,6 @@ public function export_for_template(\renderer_base $output): array {
'get',
\single_button::BUTTON_SECONDARY,
[
'class' => 'btn btn-secondary',
'data-courseid' => $courseid,
'data-category' => -1,
'data-trigger' => 'add-category-form',
Expand Down
9 changes: 5 additions & 4 deletions grade/edit/tree/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,13 @@ public function build_html_tree($element, $totals, $parents, $level, &$row_count
$parentcategories = array_merge($rowclasses, [$eid]);
$emptyrow->attributes['class'] = 'spacer ' . implode(' ', $parentcategories);
$emptyrow->attributes['data-hidden'] = 'false';
$emptyrow->attributes['aria-hidden'] = 'true';

$headercell = new html_table_cell();
$headercell->header = true;
$headercell->scope = 'row';
$headercell->attributes['class'] = 'cell column-rowspan rowspan';
$headercell->attributes['aria-hidden'] = 'true';
$headercell->rowspan = $row_count;
$emptyrow->cells[] = $headercell;

Expand All @@ -310,6 +312,7 @@ public function build_html_tree($element, $totals, $parents, $level, &$row_count
$endcell = new html_table_cell();
$endcell->colspan = (19 - $level);
$endcell->attributes['class'] = 'emptyrow colspan ' . $levelclass;
$endcell->attributes['aria-hidden'] = 'true';

$returnrows[] = new html_table_row(array($endcell));

Expand Down Expand Up @@ -740,13 +743,11 @@ public abstract function get_header_cell();
public function get_category_cell($category, $levelclass, $params) {
$cell = clone($this->categorycell);
$cell->attributes['class'] .= ' ' . $levelclass;
$cell->attributes['text'] = '';
return $cell;
}

public function get_item_cell($item, $params) {
$cell = clone($this->itemcell);
$cell->attributes['text'] = '';
if (isset($params['level'])) {
$level = $params['level'] + (($item->itemtype == 'category' || $item->itemtype == 'course') ? 0 : 1);
$cell->attributes['class'] .= ' level' . $level;
Expand Down Expand Up @@ -827,7 +828,7 @@ public function get_category_cell($category, $levelclass, $params) {
$masterlabel = $params['level'] === 1 ? get_string('all') : $params['name'];
// Build the master checkbox.
$mastercheckbox = new \core\output\checkbox_toggleall($togglegroup, true, [
'id' => $togglegroup,
'id' => 'select_category_' . $category->id,
'name' => $togglegroup,
'value' => 1,
'classes' => 'itemselect ignoredirty mr-2',
Expand Down Expand Up @@ -1203,7 +1204,7 @@ public function get_category_cell($category, $levelclass, $params) {
}
// Build the master checkbox.
$mastercheckbox = new \core\output\checkbox_toggleall($togglegroup, true, [
'id' => $togglegroup,
'id' => 'select_category_' . $category->id,
'name' => $togglegroup,
'value' => 1,
'classes' => 'itemselect ignoredirty',
Expand Down
16 changes: 6 additions & 10 deletions grade/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -954,19 +954,15 @@ function print_grade_page_head(int $courseid, string $active_type, ?string $acti
}
}

$heading = !empty($heading) ? $heading : '';

$output = '';
// Add a help dialogue box if provided.
if (isset($headerhelpidentifier)) {
if (isset($headerhelpidentifier) && !empty($heading)) {
$output = $OUTPUT->heading_with_help($heading, $headerhelpidentifier, $headerhelpcomponent);
} else {
if (isset($user)) {
$renderer = $PAGE->get_renderer('core_grades');
$output = $OUTPUT->heading($renderer->user_heading($user, $courseid));
} else {
$output = $OUTPUT->heading($heading);
}
} else if (isset($user)) {
$renderer = $PAGE->get_renderer('core_grades');
$output = $OUTPUT->heading($renderer->user_heading($user, $courseid));
} else if (!empty($heading)) {
$output = $OUTPUT->heading($heading);
}

if ($return) {
Expand Down
4 changes: 2 additions & 2 deletions lib/templates/moremenu_children.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
{{#children}}
{{^divider}}
{{#is_action_link}}
<a class="dropdown-item" role="menuitem" {{#actionattributes}}{{name}}="{{value}}"{{/actionattributes}} href="{{{url}}}{{{action}}}"
<a class="dropdown-item" role="menuitem" {{#actionattributes}}{{name}}="{{value}}" {{/actionattributes}} href="{{{url}}}{{{action}}}"
data-disableactive="true" tabindex="-1"
>
{{{text}}}
Expand Down Expand Up @@ -86,7 +86,7 @@
{{/istablist}}
{{^istablist}}
{{#is_action_link}}
<a role="menuitem" class="nav-link {{#classes}}{{.}} {{/classes}}" {{#actionattributes}}{{name}}="{{value}}"{{/actionattributes}} href="{{{url}}}{{{action}}}" data-disableactive="true" tabindex="-1">
<a role="menuitem" class="nav-link {{#classes}}{{.}} {{/classes}}" {{#actionattributes}}{{name}}="{{value}}" {{/actionattributes}} href="{{{url}}}{{{action}}}" data-disableactive="true" tabindex="-1">
{{{text}}}
</a>
{{#action_link_actions}}
Expand Down

0 comments on commit 2e18ba8

Please sign in to comment.