]> git.mjollnir.org Git - moodle.git/commitdiff
themes: MDL-19077 pass the region name ot the block output function.
authortjhunt <tjhunt>
Wed, 22 Jul 2009 07:13:43 +0000 (07:13 +0000)
committertjhunt <tjhunt>
Wed, 22 Jul 2009 07:13:43 +0000 (07:13 +0000)
Might be useful if a theme wants to render blocks differently in regions like 'top' or 'bottom'.

lib/deprecatedlib.php
lib/outputlib.php

index 44ea6bfa52dd6d33b563569c570cbe6dea23bb33..44ed07e52913dc4d363ba936d686f91d665ed108 100644 (file)
@@ -2252,7 +2252,7 @@ function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $fo
     }
     $bc->attributes = $attributes;
 
-    echo $OUTPUT->block($bc);
+    echo $OUTPUT->block($bc, BLOCK_POS_LEFT); // POS LEFT may be wrong, but no way to get a better guess here.
 }
 
 /**
@@ -2269,7 +2269,7 @@ function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $fo
  * @deprecated
  */
 function print_side_block_start($heading='', $attributes = array()) {
-    throw new coding_exception('print_side_block_start has been deprecated. Please cahnge your code to use $OUTPUT->block().');
+    throw new coding_exception('print_side_block_start has been deprecated. Please change your code to use $OUTPUT->block().');
 }
 
 /**
@@ -2282,7 +2282,7 @@ function print_side_block_start($heading='', $attributes = array()) {
  * @deprecated
  */
 function print_side_block_end($attributes = array(), $title='') {
-    throw new coding_exception('print_side_block_end has been deprecated. Please cahnge your code to use $OUTPUT->block().');
+    throw new coding_exception('print_side_block_end has been deprecated. Please change your code to use $OUTPUT->block().');
 }
 
 /**
index 726fb111bbb18ad88484d9c91f9d3059398188bd..844ec8df8a024e5e1e2ac0b189d70c5d349dec90 100644 (file)
@@ -2075,9 +2075,10 @@ class moodle_core_renderer extends moodle_renderer_base {
      * by a {@link block_contents} object.
      *
      * @param block_contents $bc HTML for the content
+     * @param string $region the region the block is appearing in.
      * @return string the HTML to be output.
      */
-    function block($bc) {
+    function block($bc, $region) {
         $bc = clone($bc); // Avoid messing up the object passed in.
         $bc->prepare();
 
@@ -2170,7 +2171,7 @@ class moodle_core_renderer extends moodle_renderer_base {
         $blockcontents = $this->page->blocks->get_content_for_region($region, $this);
         $output = '';
         foreach ($blockcontents as $bc) {
-            $output .= $this->block($bc);
+            $output .= $this->block($bc, $region);
         }
         return $output;
     }