diff --git a/course/index.php b/course/index.php
index e695380f46f..5c8407ca262 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 0eee277158a..581b596103b 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 06c910a3344..159494a0530 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 ''.get_string('tocontent', 'access').'';
}
// SELF-REPORTING SECTION
diff --git a/lib/weblib.php b/lib/weblib.php
index 98c42d1c760..18c7c76b582 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 = ''.get_string('tocontent', 'access').'';
if (! preg_match('/(.*)(.*)/s', $output, $matches)) {
preg_match('/(.*)(.*)/s', $output, $matches);
}
$output = $matches[1]."\n". $skiplink .$matches[2];
- }*/
+ }
$output = force_strict_header($output);
|