Fix bug 5611 (Skip block), across 4 files. Extra parameter $title in weblib.php: print_side_block, edits to moodleblock.class.php, Standard style, en_utf8 language pack.

This commit is contained in:
nfreear 2006-06-09 14:25:18 +00:00
parent 9fd0678fdd
commit 782792047b
3 changed files with 24 additions and 16 deletions

View file

@ -218,8 +218,8 @@ class block_base {
// Header wants to hide, no edit controls to show, so no header it is // 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()); print_side_block(NULL, $this->content->text, NULL, NULL, $this->content->footer, $this->html_attributes());
} else { } else {
// The full treatment, please // 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()); 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. * block is in place, even if empty.
*/ */
function _print_shadow() { 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);
} }
@ -634,8 +634,8 @@ class block_list extends block_base {
// Header wants to hide, no edit controls to show, so no header it is // 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()); print_side_block(NULL, '', $this->content->items, $this->content->icons, $this->content->footer, $this->html_attributes());
} else { } else {
// The full treatment, please // 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()); print_side_block($this->_title_html(), '', $this->content->items, $this->content->icons, $this->content->footer, $this->html_attributes(), $this->title);
} }
} }
} }

View file

@ -4494,27 +4494,35 @@ function rebuildnolinktag($text) {
* Prints a nice side block with an optional header. The content can either * 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. * 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 string $content ?
* @param array $list ? * @param array $list ?
* @param array $icons ? * @param array $icons ?
* @param string $footer ? * @param string $footer ?
* @param array $attributes ? * @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. * @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; static $block_id = 0;
$block_id++; $block_id++;
$skip_text = get_string('skipblock','access').' '.$block_id; if (empty($heading)) {
$skip_link = '<a href="#sb-'.$block_id.'" class="skip-block" title="'.$skip_text.'"><span class="accesshide">'.$skip_text.'</span></a>'; $skip_text = get_string('skipblock', 'access').' '.$block_id;
$skip_dest = '<span id="sb-'.$block_id.'" class="skip-block-to"></span>';
if (! empty($heading)) {
$heading .= $skip_link;
} else {
echo $skip_link;
} }
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 . $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); print_side_block_start($heading, $attributes);

View file

@ -466,7 +466,7 @@ ul.list, ul.list li, ol.list, ol.list li {
text-align: left; text-align: left;
margin:0%; margin:0%;
padding:4px; padding:4px;
padding-bottom:0%; padding-top:0;
border-width: 1px; border-width: 1px;
border-style: solid; border-style: solid;
border-bottom: none; border-bottom: none;