diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php index 4bedea8b25a..74b65029f29 100644 --- a/blocks/moodleblock.class.php +++ b/blocks/moodleblock.class.php @@ -197,13 +197,6 @@ class block_base { * Display the block! */ function _print_block() { - // Wrap the title in a floating DIV, in case we have edit controls to display - // These controls will always be wrapped on a right-floating DIV - $title = '
'.$this->title.'
'; - if ($this->edit_controls !== NULL) { - $title .= $this->edit_controls; - } - // is_empty() includes a call to get_content() if ($this->is_empty()) { if (empty($this->edit_controls)) { @@ -219,7 +212,7 @@ class block_base { print_side_block(NULL, $this->content->text, NULL, NULL, $this->content->footer, $this->html_attributes()); } else { // The full treatment, please - print_side_block($title, $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()); } } } @@ -230,11 +223,28 @@ class block_base { * block is in place, even if empty. */ function _print_shadow() { - $title = '
'.$this->title.'
'; + print_side_block($this->_title_html(), ' ', NULL, NULL, '', array('class' => 'hidden')); + } + + + function _title_html() { + global $CFG; + + $title = '
'; + + if (!empty($CFG->allowuserblockhiding)) { + $title .= '
'; + } + + $title .= $this->title; + if ($this->edit_controls !== NULL) { $title .= $this->edit_controls; } - print_side_block($title, ' ', NULL, NULL, '', array('class' => 'hidden')); + + $title .= '
'; + + return $title; } /** @@ -552,13 +562,6 @@ class block_list extends block_base { } function _print_block() { - // Wrap the title in a floating DIV, in case we have edit controls to display - // These controls will always be wrapped on a right-floating DIV - $title = '
'.$this->title.'
'; - if ($this->edit_controls !== NULL) { - $title .= $this->edit_controls; - } - // is_empty() includes a call to get_content() if ($this->is_empty()) { if (empty($this->edit_controls)) { @@ -574,7 +577,7 @@ class block_list extends block_base { print_side_block(NULL, '', $this->content->items, $this->content->icons, $this->content->footer, $this->html_attributes()); } else { // The full treatment, please - print_side_block($title, '', $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()); } } } diff --git a/lib/weblib.php b/lib/weblib.php index 64866725226..5a82912342b 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -738,7 +738,7 @@ function popup_form($common, $options, $formname, $selected='', $nothing='choose ' method="get"'. ' target="'.$CFG->framename.'"'. ' name="'.$formname.'"'. - ' class="popupform" style="display: inline;">'; + ' class="popupform">'; $output = '