From 5c3550191af5cc3891cd7bc99447b4b50d243561 Mon Sep 17 00:00:00 2001 From: nfreear Date: Mon, 22 Oct 2007 06:43:00 +0000 Subject: [PATCH] Partial fix for reopened bug MDL-7878, "Link identification and skipping" - affects all course formats + other files. --- course/format/lams/format.php | 2 +- course/format/scorm/format.php | 2 +- course/format/social/format.php | 2 +- course/format/topics/format.php | 2 +- course/format/weeks/format.php | 2 +- course/format/weekscss/format.php | 2 +- lang/en_utf8/access.php | 2 +- lang/en_utf8/moodle.php | 1 - lib/pagelib.php | 2 +- lib/weblib.php | 16 ++++++++++++++++ theme/formal_white/fw_layout.css | 6 ------ theme/standard/styles_color.css | 6 ------ theme/standard/styles_layout.css | 13 ++++--------- 13 files changed, 28 insertions(+), 30 deletions(-) diff --git a/course/format/lams/format.php b/course/format/lams/format.php index fddd972757..a4ef5b4c7d 100644 --- a/course/format/lams/format.php +++ b/course/format/lams/format.php @@ -75,7 +75,7 @@ if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) { } /// Start main column -echo ''; +echo ''. skip_main_destination(); print_heading_block(get_string('lamsoutline','lams'), 'outline'); diff --git a/course/format/scorm/format.php b/course/format/scorm/format.php index 7c924a4eb5..299b6aedd1 100644 --- a/course/format/scorm/format.php +++ b/course/format/scorm/format.php @@ -35,7 +35,7 @@ echo ''; } - echo ''; + echo ''. skip_main_destination(); $moduleformat = $module.'_course_format_display'; if (function_exists($moduleformat)) { $moduleformat($USER,$course); diff --git a/course/format/social/format.php b/course/format/social/format.php index 92549ff97d..bebc79d599 100644 --- a/course/format/social/format.php +++ b/course/format/social/format.php @@ -40,7 +40,7 @@ echo ''; if (!empty($THEME->customcorners)) print_custom_corners_start(); - echo ''; + echo skip_main_destination(); if ($forum = forum_get_course_forum($course->id, 'social')) { print_heading_block(get_string('socialheadline')); diff --git a/course/format/topics/format.php b/course/format/topics/format.php index 91fd095dc1..4bba4c20aa 100644 --- a/course/format/topics/format.php +++ b/course/format/topics/format.php @@ -93,7 +93,7 @@ /// Start main column echo ''; if (!empty($THEME->customcorners)) print_custom_corners_start(); - echo ''; + echo skip_main_destination(); print_heading_block(get_string('topicoutline'), 'outline'); diff --git a/course/format/weeks/format.php b/course/format/weeks/format.php index 5a83f23bbf..48b64a6424 100644 --- a/course/format/weeks/format.php +++ b/course/format/weeks/format.php @@ -80,7 +80,7 @@ if (!empty($THEME->customcorners)) print_custom_corners_start(); - echo ''; + echo skip_main_destination(); print_heading_block(get_string('weeklyoutline'), 'outline'); diff --git a/course/format/weekscss/format.php b/course/format/weekscss/format.php index fe10b0135e..a120bfd210 100644 --- a/course/format/weekscss/format.php +++ b/course/format/weekscss/format.php @@ -85,7 +85,7 @@ } /// Start main column - echo '
'; + echo '
'. skip_main_destination(); print_heading_block(get_string('weeklyoutline'), 'outline'); diff --git a/lang/en_utf8/access.php b/lang/en_utf8/access.php index 681a2db833..2f6b613e26 100644 --- a/lang/en_utf8/access.php +++ b/lang/en_utf8/access.php @@ -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'; diff --git a/lang/en_utf8/moodle.php b/lang/en_utf8/moodle.php index 9c931b7e38..555a5c560a 100644 --- a/lang/en_utf8/moodle.php +++ b/lang/en_utf8/moodle.php @@ -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'; diff --git a/lib/pagelib.php b/lib/pagelib.php index 645855002e..06c910a334 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -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 ''; + echo ''; } // SELF-REPORTING SECTION diff --git a/lib/weblib.php b/lib/weblib.php index 72b20cef19..98c42d1c76 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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 ''; +} + /// 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 = ''; + if (! preg_match('/(.*)(.*)/s', $output, $matches)) { + preg_match('/(.*)(.*)/s', $output, $matches); + } + $output = $matches[1]."\n". $skiplink .$matches[2]; + }*/ + $output = force_strict_header($output); if (!empty($CFG->messaging)) { diff --git a/theme/formal_white/fw_layout.css b/theme/formal_white/fw_layout.css index 466eb78478..3ce62431b4 100644 --- a/theme/formal_white/fw_layout.css +++ b/theme/formal_white/fw_layout.css @@ -97,12 +97,6 @@ input, select { *** Header ***/ -.headerskip { - position:absolute; - right:20em; - font-size:0.8em; -} - #header-home { /* padding:1em 0.5em; */ height:100px; diff --git a/theme/standard/styles_color.css b/theme/standard/styles_color.css index f572aae2eb..03e42872f1 100644 --- a/theme/standard/styles_color.css +++ b/theme/standard/styles_color.css @@ -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; } diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index 08ea60e373..086cceec22 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -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; } -- 2.39.5