// 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);
}
}
}
* block is in place, even if empty.
*/
function _print_shadow() {
- print_side_block($this->_title_html(), ' ', NULL, NULL, '', array('class' => 'hidden'));
+ print_side_block($this->_title_html(), ' ', NULL, NULL, '', array('class' => 'hidden'), $this->title);
}
// 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);
}
}
}
* 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);