MDL-28292 - Blocks - Patch supplied by Chris Follin to fix blocks with empty titles...
authorJason Fowler <phalacee@gmail.com>
Thu, 3 Nov 2011 08:18:39 +0000 (16:18 +0800)
committerJason Fowler <phalacee@gmail.com>
Thu, 3 Nov 2011 08:18:39 +0000 (16:18 +0800)
blocks/html/block_html.php

index bead128..c896281 100644 (file)
@@ -121,4 +121,14 @@ class block_html extends block_base {
 
         return true;
     }
+    
+    /**
+     * The block should only be dockable when the title of the block is not empty
+     * and when parent allows docking.
+     *
+     * @return bool
+     */
+    public function instance_can_be_docked() {
+        return (!empty($this->config->title) && parent::instance_can_be_docked());
+    }
 }