]> git.mjollnir.org Git - moodle.git/commitdiff
Partial fix for reopened bug MDL-7878, "Link identification and skipping" - affects...
authornfreear <nfreear>
Mon, 22 Oct 2007 06:43:00 +0000 (06:43 +0000)
committernfreear <nfreear>
Mon, 22 Oct 2007 06:43:00 +0000 (06:43 +0000)
13 files changed:
course/format/lams/format.php
course/format/scorm/format.php
course/format/social/format.php
course/format/topics/format.php
course/format/weeks/format.php
course/format/weekscss/format.php
lang/en_utf8/access.php
lang/en_utf8/moodle.php
lib/pagelib.php
lib/weblib.php
theme/formal_white/fw_layout.css
theme/standard/styles_color.css
theme/standard/styles_layout.css

index fddd972757d39f5b855344f71f419e1bc37356c8..a4ef5b4c7d6f1c3e1e0cec0209b936329e239931 100644 (file)
@@ -75,7 +75,7 @@ if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
 }
 
 /// Start main column
-echo '<td id="middle-column"><a name="startofcontent"></a>';
+echo '<td id="middle-column">'. skip_main_destination();
 
 print_heading_block(get_string('lamsoutline','lams'), 'outline');
 
index 7c924a4eb557c9334b045c1986b029aa2ab9f7a3..299b6aedd15f837a8eece994260a4219947c6340 100644 (file)
@@ -35,7 +35,7 @@
         echo '</td>';
     }
 
-    echo '<td id="middle-column"><a name="startofcontent"></a>';
+    echo '<td id="middle-column">'. skip_main_destination();
     $moduleformat = $module.'_course_format_display';
     if (function_exists($moduleformat)) {
         $moduleformat($USER,$course);
index 92549ff97d09cd033ef81d6e399004cc672be760..bebc79d599918110a2a0f770a114ad387b6d299f 100644 (file)
@@ -40,7 +40,7 @@
 
     echo '<td id="middle-column">';
     if (!empty($THEME->customcorners)) print_custom_corners_start();
-    echo '<a name="startofcontent"></a>';
+    echo skip_main_destination();
     if ($forum = forum_get_course_forum($course->id, 'social')) {
         print_heading_block(get_string('socialheadline'));
         
index 91fd095dc1f47acf49cec378d76acacd67a22330..4bba4c20aa6d124ac29139980fc5a31438f19651 100644 (file)
@@ -93,7 +93,7 @@
 /// Start main column
     echo '<td id="middle-column">';
     if (!empty($THEME->customcorners)) print_custom_corners_start();
-    echo '<a name="startofcontent"></a>';
+    echo skip_main_destination();
 
     print_heading_block(get_string('topicoutline'), 'outline');
 
index 5a83f23bbf68d53bf358fa369d63335c10ddbe62..48b64a6424656f63dd09ff2ba6d0e0e3f26d59df 100644 (file)
@@ -80,7 +80,7 @@
 
     if (!empty($THEME->customcorners)) print_custom_corners_start();
         
-    echo '<a name="startofcontent"></a>';
+    echo skip_main_destination();
 
     print_heading_block(get_string('weeklyoutline'), 'outline');
 
index fe10b0135ea127c2f3117f9ff2bfcc6845c546c2..a120bfd21027628f92d8844cd03d90c01df77876 100644 (file)
@@ -85,7 +85,7 @@
     }
 
 /// Start main column
-    echo '<div id="middle-column"><a name="startofcontent"></a>';
+    echo '<div id="middle-column">'. skip_main_destination();
 
     print_heading_block(get_string('weeklyoutline'), 'outline');
 
index 681a2db833fc749ff1bdfee83de6678d58650854..2f6b613e26d082b4903a74a42432161ef5916df6 100644 (file)
@@ -21,7 +21,7 @@ $string['skipblock'] = 'Skip block';
 $string['skipnavigation'] = 'Skip navigation';
 $string['tabledata'] = 'Data table, $a';
 $string['tablelayout'] = 'Layout table, $a';
-$string['tocontent'] = 'Go to main content';
+$string['tocontent'] = 'Skip to main content';
 $string['tonavigation'] = 'Go to navigation';
 $string['youarehere'] = 'You are here';
 
index 9c931b7e3840a0a305e12130ba5fa5de524ab84a..555a5c560a7f6f8f13e506a63f3cdfbf0cd89389 100644 (file)
@@ -1332,7 +1332,6 @@ $string['sizegb'] = 'GB';
 $string['sizekb'] = 'KB';
 $string['sizemb'] = 'MB';
 $string['skipped'] = 'Skipped';
-$string['skiptomaincontent'] = 'Skip forward to main content';
 $string['skypeid'] = 'Skype ID';
 $string['socialheadline'] = 'Social forum - latest topics';
 $string['someallowguest'] = 'Some courses may allow guest access';
index 645855002eb9fe1792655178772b02221d025515..06c910a334416b4beee9ab64361a3fbf500e0335 100644 (file)
@@ -439,7 +439,7 @@ 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 '<div class="accesshide"><a href="#startofcontent">'.get_string('skiptomaincontent').'</a></div>';
+        echo '<a class="skip" href="#maincontent">'.get_string('tocontent', 'access').'</a>';
     }
 
     // SELF-REPORTING SECTION
index 72b20cef1931f0c06a1f5189ccdb1dea3a48fb55..98c42d1c760a43193986fdc10592bfd42743cbea 100644 (file)
@@ -2257,6 +2257,13 @@ function get_html_lang($dir = false) {
     return ($direction.' lang="'.$language.'" xml:lang="'.$language.'"');
 }
 
+/**
+ * Return the markup for the destination of the 'Skip to main content' links.
+ */
+function skip_main_destination() {
+    return '<span id="maincontent"></span>';
+}
+
 
 /// STANDARD WEB PAGE PARTS ///////////////////////////////////////////////////
 
@@ -2497,6 +2504,15 @@ 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) {
+        $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);
 
     if (!empty($CFG->messaging)) {
index 466eb78478ff4ec60ed924b325be7f3ffa33217d..3ce62431b40ccd7e727829ca8ee300b0ae778bfa 100644 (file)
@@ -97,12 +97,6 @@ input, select {
  *** Header
  ***/
 
-.headerskip {
-  position:absolute;
-  right:20em;
-  font-size:0.8em;
-}
-
 #header-home {
   /* padding:1em 0.5em; */
   height:100px;
index f572aae2eb86782b40082e7b79a16406d4493b7a..03e42872f1aba47a5a5f9562ef4519a5342ca515 100644 (file)
@@ -203,12 +203,6 @@ table.formtable tbody th {
   color:#aaa;
 }
 
-.headerskip a:link,
-.headerskip a:visited,
-.headerskip a:hover {
-  color: #FFF;
-}
-
 .navigation select {
   background-color:#FFFFFF;
 }
index 08ea60e373d76c22bb7066cb004515d571a662a2..086cceec228db2a3c93d6ff2cb9bfbd02c2327b0 100644 (file)
@@ -668,12 +668,6 @@ div.phpinfo .center th {
  *** Header
  ***/
 
-.headerskip {
-  position:absolute;
-  right:20em;
-  font-size:0.8em;
-}
-
 #header-home {
 }
 
@@ -1179,16 +1173,17 @@ body#admin-modules table.generaltable td.c0
  ***/
 
 /*Accessibility: Skip block link, for keyboard-only users. */
-a.skip-block {
+a.skip-block, a.skip {
   position: absolute;
   top: -1000em;
   font-size: 0.85em;
 }
-a.skip-block:focus, a.skip-block:active {
+a.skip-block:focus, a.skip-block:active,
+a.skip:focus, a.skip:active {
   position: static;
   display: block;
 }
-.skip-block-to {
+.skip-block-to, #maincontent {
   display: block;
   height: 1px;
 }