]> git.mjollnir.org Git - moodle.git/commitdiff
Fix bug 5611 (Skip block), across 4 files. Extra parameter $title in weblib.php:...
authornfreear <nfreear>
Fri, 9 Jun 2006 14:25:18 +0000 (14:25 +0000)
committernfreear <nfreear>
Fri, 9 Jun 2006 14:25:18 +0000 (14:25 +0000)
blocks/moodleblock.class.php
lib/weblib.php
theme/standard/styles_layout.css

index 72149026f453efa1b5bea8bff5221ddb95195931..b18f85f0320c0dfc7cfd8858ae643f2773dd5250 100644 (file)
@@ -218,8 +218,8 @@ class block_base {
                 // Header wants to hide, no edit controls to show, so no header it is
                 print_side_block(NULL, $this->content->text, NULL, NULL, $this->content->footer, $this->html_attributes());
             } else {
-                // The full treatment, please
-                print_side_block($this->_title_html(), $this->content->text, NULL, NULL, $this->content->footer, $this->html_attributes());
+                // The full treatment, please. Include the title text.
+                print_side_block($this->_title_html(), $this->content->text, NULL, NULL, $this->content->footer, $this->html_attributes(), $this->title);
             }
         }
     }
@@ -230,7 +230,7 @@ class block_base {
      * block is in place, even if empty.
      */
     function _print_shadow() {
-        print_side_block($this->_title_html(), '&nbsp;', NULL, NULL, '', array('class' => 'hidden'));
+        print_side_block($this->_title_html(), '&nbsp;', NULL, NULL, '', array('class' => 'hidden'), $this->title);
     }
 
 
@@ -634,8 +634,8 @@ class block_list extends block_base {
                 // Header wants to hide, no edit controls to show, so no header it is
                 print_side_block(NULL, '', $this->content->items, $this->content->icons, $this->content->footer, $this->html_attributes());
             } else {
-                // The full treatment, please
-                print_side_block($this->_title_html(), '', $this->content->items, $this->content->icons, $this->content->footer, $this->html_attributes());
+                // The full treatment, please. Include the title text.
+                print_side_block($this->_title_html(), '', $this->content->items, $this->content->icons, $this->content->footer, $this->html_attributes(), $this->title);
             }
         }
     }
index 7408ee78d267f5fa0ce0d1488643414f54191aaf..0459d110fcdcafe8ad54d66329e747ad3985b2dd 100644 (file)
@@ -4494,27 +4494,35 @@ function rebuildnolinktag($text) {
  * Prints a nice side block with an optional header.  The content can either
  * be a block of HTML or a list of text with optional icons.
  *
- * @param  string $heading ?
+ * @param  string $heading Block $title embedded in HTML tags, for example <h2>.
  * @param  string $content ?
  * @param  array $list ?
  * @param  array $icons ?
  * @param  string $footer ?
  * @param  array $attributes ?
+ * @param  string $title Plain text title, as embedded in the $heading.
  * @todo Finish documenting this function. Show example of various attributes, etc.
  */
-function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $footer='', $attributes = array()) {
+function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $footer='', $attributes = array(), $title='') {
 
-    //Accessibility: skip block link, with $block_id to differentiate links.
+    //Accessibility: skip block link, with title-text (or $block_id) to differentiate links.
     static $block_id = 0;
     $block_id++;
-    $skip_text = get_string('skipblock','access').' '.$block_id;
-    $skip_link = '<a href="#sb-'.$block_id.'" class="skip-block" title="'.$skip_text.'"><span class="accesshide">'.$skip_text.'</span></a>'; 
+    if (empty($heading)) {
+        $skip_text = get_string('skipblock', 'access').' '.$block_id;
+    }
+    else {
+        $skip_text = get_string('skipa', 'access', $title);
+    }
+    $skip_link = '<a href="#sb-'.$block_id.'" class="skip-block" title="'.$skip_text.'"><span class="accesshide">'.$skip_text.'</span></a>';
     $skip_dest = '<span id="sb-'.$block_id.'" class="skip-block-to"></span>';
+
     if (! empty($heading)) {
-        $heading .= $skip_link;
-    } else {
+        $heading = $skip_link . $heading;
+    } 
+    /*else { //ELSE: I think a single link on a page, "Skip block 4" is too confusing - don't print.
         echo $skip_link;
-    }
+    }*/
 
     print_side_block_start($heading, $attributes);
 
index bc10bfd33ba76d08b6d0d00ebf0cc5f84a141e6b..58c571bff07a315eb201978050df15b878686866 100644 (file)
@@ -466,7 +466,7 @@ ul.list, ul.list li, ol.list, ol.list li {
   text-align: left;
   margin:0%;
   padding:4px;
-  padding-bottom:0%;
+  padding-top:0;
   border-width: 1px;
   border-style: solid;
   border-bottom: none;