Fix for reopened bug MDL-7878, "Link identification and skipping" - includes site and course index.php.

This commit is contained in:
nfreear 2007-10-22 09:21:11 +00:00
parent 5c3550191a
commit 317d5ddcb3
4 changed files with 9 additions and 6 deletions

View File

@ -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();

View File

@ -134,7 +134,7 @@
}
break;
case 'middle':
echo '<td id="middle-column">';
echo '<td id="middle-column">'. skip_main_destination();
if (!empty($THEME->customcorners)) print_custom_corners_start();

View File

@ -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 '<a class="skip" href="#maincontent">'.get_string('tocontent', 'access').'</a>';
}
// SELF-REPORTING SECTION

View File

@ -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 '<span id="maincontent"></span>';
@ -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 = '<a class="skip" href="#maincontent">'.get_string('tocontent', 'access').'</a>';
if (! preg_match('/(.*<div.*?page.>)(.*)/s', $output, $matches)) {
preg_match('/(.*<body.*?>)(.*)/s', $output, $matches);
}
$output = $matches[1]."\n". $skiplink .$matches[2];
}*/
}
$output = force_strict_header($output);