]> git.mjollnir.org Git - moodle.git/commitdiff
Fix for reopened bug MDL-7878, "Link identification and skipping" - includes site...
authornfreear <nfreear>
Mon, 22 Oct 2007 09:21:11 +0000 (09:21 +0000)
committernfreear <nfreear>
Mon, 22 Oct 2007 09:21:11 +0000 (09:21 +0000)
course/index.php
index.php
lib/pagelib.php
lib/weblib.php

index e695380f46fbfcba53c0871fe668d0559b77dbf7..5c8407ca2622ea87d7ad9e0374caf44f2164de4d 100644 (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();
index 0eee277158abe559f0a02fae2732ad3c5b648dd9..581b596103b6b049ab0b4eceddcb5c9d69f8c18d 100644 (file)
--- a/index.php
+++ b/index.php
     }
             break;
             case 'middle':
-    echo '<td id="middle-column">';
+    echo '<td id="middle-column">'. skip_main_destination();
 
     if (!empty($THEME->customcorners)) print_custom_corners_start();
 
index 06c910a334416b4beee9ab64361a3fbf500e0335..159494a0530f4c0a09425515d28b7e6325e41ef4 100644 (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
index 98c42d1c760a43193986fdc10592bfd42743cbea..18c7c76b582741700f34acadd6d80692ce606d23 100644 (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);