MDL-50970 core_block: New Web Service core_block_get_course_blocks

This commit is contained in:
Juan Leyva
2017-04-03 09:27:53 +02:00
parent bf919ddf02
commit 8446ba3641
6 changed files with 311 additions and 2 deletions
+18
View File
@@ -319,6 +319,24 @@ class block_manager {
return $this->visibleblockcontent[$region];
}
/**
* Returns an array of block content objects for all the existings regions
*
* @param renderer_base $output the rendered to use
* @return array of block block_contents objects for all the blocks in all regions.
* @since Moodle 3.3
*/
public function get_content_for_all_regions($output) {
$contents = array();
$this->check_is_loaded();
foreach ($this->regions as $region => $val) {
$this->ensure_content_created($region, $output);
$contents[$region] = $this->visibleblockcontent[$region];
}
return $contents;
}
/**
* Helper method used by get_content_for_region.
* @param string $region region name