]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19598: Error in logic that should hide 'skip link' when block doesn't have title
authorsam_marshall <sam_marshall>
Mon, 22 Jun 2009 17:09:32 +0000 (17:09 +0000)
committersam_marshall <sam_marshall>
Mon, 22 Jun 2009 17:09:32 +0000 (17:09 +0000)
lib/weblib.php

index bc878d96c173ce6149f96cf75c0b9edae15caf74..11f8ef930191f890344058f9e9fa543757dfdf16 100644 (file)
@@ -6538,16 +6538,12 @@ function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $fo
     //Accessibility: skip block link, with title-text (or $block_id) to differentiate links.
     static $block_id = 0;
     $block_id++;
-    if (empty($heading)) {
-        $skip_text = get_string('skipblock', 'access').' '.$block_id;
-    }
-    else {
-        $skip_text = get_string('skipa', 'access', strip_tags($title));
-    }
+    $skip_text = get_string('skipa', 'access', strip_tags($title));
     $skip_link = '<a href="#sb-'.$block_id.'" class="skip-block">'.$skip_text.'</a>';
     $skip_dest = '<span id="sb-'.$block_id.'" class="skip-block-to"></span>';
 
-    if (! empty($heading)) {
+    $strip_title = strip_tags($title);
+    if (! empty($strip_title)) {
         echo $skip_link;
     }
     //ELSE: a single link on a page "Skip block 4" is too confusing - ignore.