Skip to content

Commit

Permalink
Added hiddenfromstudents title on hidden tabs, for screenreaders
Browse files Browse the repository at this point in the history
  • Loading branch information
davidherney committed Jan 26, 2023
1 parent 5006e42 commit eee6d12
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion classes/output/courseformat/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ private function get_tabs(course_modinfo $modinfo, \renderer_base $output): \for
$formatoptions = course_get_format($course)->get_format_options($thissection);

$sectionname = get_section_name($course, $thissection);
$title = $sectionname;

if (!$thissection->visible || !$thissection->available) {
$title .= ': '. get_string('hiddenfromstudents');
}

$customstyles = '';
$level = 0;
Expand Down Expand Up @@ -309,7 +314,7 @@ private function get_tabs(course_modinfo $modinfo, \renderer_base $output): \for
}
}

$newtab = new \format_onetopic\singletab($section, $sectionname, $url, $sectionname,
$newtab = new \format_onetopic\singletab($section, $sectionname, $url, $title,
$availablemessage, $customstyles, $specialclass);
$newtab->active = !$inactivetab;

Expand Down

0 comments on commit eee6d12

Please sign in to comment.