From: nfreear Date: Fri, 9 Jun 2006 14:25:18 +0000 (+0000) Subject: Fix bug 5611 (Skip block), across 4 files. Extra parameter $title in weblib.php:... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=782792047bfa43317150bf9a56ecd27a5240e43a;p=moodle.git 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. --- diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php index 72149026f4..b18f85f032 100644 --- a/blocks/moodleblock.class.php +++ b/blocks/moodleblock.class.php @@ -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(), ' ', 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 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); } } } diff --git a/lib/weblib.php b/lib/weblib.php index 7408ee78d2..0459d110fc 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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

. * @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 = ''.$skip_text.''; + if (empty($heading)) { + $skip_text = get_string('skipblock', 'access').' '.$block_id; + } + else { + $skip_text = get_string('skipa', 'access', $title); + } + $skip_link = ''.$skip_text.''; $skip_dest = ''; + 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); diff --git a/theme/standard/styles_layout.css b/theme/standard/styles_layout.css index bc10bfd33b..58c571bff0 100644 --- a/theme/standard/styles_layout.css +++ b/theme/standard/styles_layout.css @@ -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;