Partial fix for reopened bug MDL-7878, "Link identification and skipping" - affects all course formats + other files. Merged.

This commit is contained in:
nfreear
2007-10-22 06:51:09 +00:00
parent a358f9b4e2
commit b39a4fec6a
13 changed files with 28 additions and 30 deletions
+1 -1
View 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');
+1 -1
View 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);
+1 -1
View 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'));
+1 -1
View 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');
+1 -1
View 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');
+1 -1
View 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');
+1 -1
View 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';
-1
View 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';
+1 -1
View 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
+16
View 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)) {
-6
View 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;
-6
View 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;
}
+4 -9
View 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;
}