Permalink
Browse files

Merge branch 'w07_MDL-26223_20_calblock' of git://github.com/skodak/m…

…oodle
  • Loading branch information...
2 parents a49d8aa + 9c14c1c commit f0e28c7e67fec3ec88b57cc0ba4c2c2cb5d77089 @stronk7 stronk7 committed Feb 14, 2011
Showing with 8 additions and 7 deletions.
  1. +8 −7 blocks/moodleblock.class.php
@@ -209,15 +209,15 @@ function refresh_content() {
}
/**
- * Return a block_contents oject representing the full contents of this block.
+ * Return a block_contents object representing the full contents of this block.
*
* This internally calls ->get_content(), and then adds the editing controls etc.
*
* You probably should not override this method, but instead override
* {@link html_attributes()}, {@link formatted_contents()} or {@link get_content()},
* {@link hide_header()}, {@link (get_edit_controls)}, etc.
*
- * @return block_contents a represntation of the block, for rendering.
+ * @return block_contents a representation of the block, for rendering.
* @since Moodle 2.0.
*/
public function get_content_for_output($output) {
@@ -243,10 +243,11 @@ public function get_content_for_output($output) {
if ($this->page->user_is_editing()) {
$bc->controls = $this->page->blocks->edit_controls($this);
- }
-
- if ($this->is_empty() && !$bc->controls) {
- return null;
+ } else {
+ // we must not use is_empty on hidden blocks
+ if ($this->is_empty() && !$bc->controls) {
+ return null;
+ }
}
if (empty($CFG->allowuserblockhiding) ||
@@ -620,7 +621,7 @@ function config_print() {
/**
* Can be overridden by the block to prevent the block from being dockable.
- *
+ *
* @return bool
*/
public function instance_can_be_docked() {

0 comments on commit f0e28c7

Please sign in to comment.