Skip to content
Permalink
Browse files

MDL-39841 renderer: new method to renderer blocks with predictable st…

…ructure
  • Loading branch information...
Sam Hemelryk
Sam Hemelryk committed Jun 6, 2013
1 parent 1430866 commit cd79352fbd88d70c7243f8c9620f8902a9f08892
Showing with 19 additions and 0 deletions.
  1. +19 −0 lib/outputrenderers.php
@@ -3028,6 +3028,25 @@ protected function render_tabobject(tabobject $tabobject) {
return $str;
}
/**
* Get the HTML for blocks in the given region.
*
* @since 2.5.1 2.6
* @param string $region The region to get HTML for.
* @return string HTML.
*/
public function blocks($region, $classes = array(), $tag = 'aside') {
$classes = (array)$classes;
$classes[] = 'block-region';
$attributes = array(
'id' => 'block-region-'.preg_replace('#[^a-zA-Z0-9_\-]+#', '-', $region),
'class' => join(' ', $classes),
'data-blockregion' => $region,
'data-droptarget' => '1'
);
return html_writer::tag($tag, $this->blocks_for_region($region), $attributes);
}
}
/**

0 comments on commit cd79352

Please sign in to comment.
You can’t perform that action at this time.