Merge branch 'MDL-32689' of git://github.com/jrchamp/moodle

This commit is contained in:
Dan Poltawski
2012-05-03 13:10:56 +08:00
+13 -3
View File
@@ -250,8 +250,9 @@ class block_base {
}
}
if (empty($CFG->allowuserblockhiding) ||
(empty($bc->content) && empty($bc->footer))) {
if (empty($CFG->allowuserblockhiding)
|| (empty($bc->content) && empty($bc->footer))
|| !$this->instance_can_be_collapsed()) {
$bc->collapsible = block_contents::NOT_HIDEABLE;
} else if (get_user_preferences('block' . $bc->blockinstanceid . 'hidden', false)) {
$bc->collapsible = block_contents::HIDDEN;
@@ -630,7 +631,7 @@ class block_base {
}
/**
* If overridden and set to true by the block it will not be hidable when
* If overridden and set to false by the block it will not be hidable when
* editing is turned on.
*
* @return bool
@@ -639,6 +640,15 @@ class block_base {
return true;
}
/**
* If overridden and set to false by the block it will not be collapsible.
*
* @return bool
*/
public function instance_can_be_collapsed() {
return true;
}
/** @callback callback functions for comments api */
public static function comment_template($options) {
$ret = <<<EOD