From e0b8bc0a08457463fc2f533f94d5f58d8bd04449 Mon Sep 17 00:00:00 2001 From: Jerome Mouneyrac Date: Tue, 8 Oct 2013 16:53:06 +0800 Subject: [PATCH] MDL-41252 Simple changes to main course page to improve accessibility - original patch of Nate Baxley --- course/format/renderer.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/course/format/renderer.php b/course/format/renderer.php index fe693152222..cb00107623c 100644 --- a/course/format/renderer.php +++ b/course/format/renderer.php @@ -157,7 +157,8 @@ abstract class format_section_renderer_base extends plugin_renderer_base { } $o.= html_writer::start_tag('li', array('id' => 'section-'.$section->section, - 'class' => 'section main clearfix'.$sectionstyle)); + 'class' => 'section main clearfix'.$sectionstyle, 'role'=>'region', + 'aria-label'=> get_section_name($course, $section))); $leftcontent = $this->section_left_content($section, $course, $onsectionpage); $o.= html_writer::tag('div', $leftcontent, array('class' => 'left side')); @@ -301,14 +302,15 @@ abstract class format_section_renderer_base extends plugin_renderer_base { $classattr .= ' current'; } + $title = get_section_name($course, $section); $o = ''; - $o .= html_writer::start_tag('li', array('id' => 'section-'.$section->section, 'class' => $classattr)); + $o .= html_writer::start_tag('li', array('id' => 'section-'.$section->section, + 'class' => $classattr, 'role'=>'region', 'aria-label'=> $title)); $o .= html_writer::tag('div', '', array('class' => 'left side')); $o .= html_writer::tag('div', '', array('class' => 'right side')); $o .= html_writer::start_tag('div', array('class' => 'content')); - $title = get_section_name($course, $section); if ($section->uservisible) { $title = html_writer::tag('a', $title, array('href' => course_get_url($course, $section->section), 'class' => $linkclasses));