From: nfreear Date: Mon, 22 Oct 2007 09:21:11 +0000 (+0000) Subject: Fix for reopened bug MDL-7878, "Link identification and skipping" - includes site... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=317d5ddcb363d465125e2e16de9f3e71ee06cc6d;p=moodle.git Fix for reopened bug MDL-7878, "Link identification and skipping" - includes site and course index.php. --- diff --git a/course/index.php b/course/index.php index e695380f46..5c8407ca26 100644 --- a/course/index.php +++ b/course/index.php @@ -62,6 +62,7 @@ $navigation = build_navigation($navlinks); print_header("$site->shortname: $strcategories", $strcourses, $navigation, '', '', true, update_categories_button()); print_heading($strcategories); + echo skip_main_destination(); print_box_start('categorybox'); print_whole_category_list(); print_box_end(); @@ -71,6 +72,7 @@ print_header("$site->shortname: $strfulllistofcourses", $strfulllistofcourses, build_navigation(array(array('name'=>$strfulllistofcourses, 'link'=>'','type'=>'misc'))), '', '', true, update_categories_button()); + echo skip_main_destination(); print_box_start('courseboxes'); print_courses(0); print_box_end(); diff --git a/index.php b/index.php index 0eee277158..581b596103 100644 --- a/index.php +++ b/index.php @@ -134,7 +134,7 @@ } break; case 'middle': - echo ''; + echo ''. skip_main_destination(); if (!empty($THEME->customcorners)) print_custom_corners_start(); diff --git a/lib/pagelib.php b/lib/pagelib.php index 06c910a334..159494a053 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -438,8 +438,6 @@ class page_course extends page_base { print_header($title, $this->courserecord->fullname, $navigation, '', $meta, true, $buttons, user_login_string($this->courserecord, $USER), false, $bodytags); - - echo ''; } // SELF-REPORTING SECTION diff --git a/lib/weblib.php b/lib/weblib.php index 98c42d1c76..18c7c76b58 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2259,6 +2259,9 @@ function get_html_lang($dir = false) { /** * Return the markup for the destination of the 'Skip to main content' links. + * Accessibility improvement for keyboard-only users. + * Used in course formats, /index.php and /course/index.php + * @return string HTML element. */ function skip_main_destination() { return ''; @@ -2504,14 +2507,14 @@ function print_header ($title='', $heading='', $navigation='', $focus='', $output = ob_get_contents(); ob_end_clean(); - /*// Skip to main content, TODO: 'site-index', 'course-index' - if ('course-view'==$pageid) { + // Skip to main content, see skip_main_destination(). + if ($pageid=='course-view' or $pageid=='site-index' or $pageid=='course-index') { $skiplink = ''; if (! preg_match('/(.*)(.*)/s', $output, $matches)) { preg_match('/(.*)(.*)/s', $output, $matches); } $output = $matches[1]."\n". $skiplink .$matches[2]; - }*/ + } $output = force_strict_header($output);