You are here

function render_cache_block_block_list in Render cache 7.2

Load the list of blocks for a region, but do not render them.

Parameters

$region: The name of the region.

Return value

An array of block objects, indexed with the module name and block delta concatenated with an underscore, thus: MODULE_DELTA.

See also

block_list()

1 call to render_cache_block_block_list()
render_cache_block_get_blocks_by_region in modules/controller/render_cache_block/render_cache_block.module
Overrides block_get_blocks_by_region().

File

modules/controller/render_cache_block/render_cache_block.module, line 150
Hook implementations and frequently used functions for render cache page module.

Code

function render_cache_block_block_list($region) {
  $blocks =& drupal_static(__FUNCTION__);
  if (!isset($blocks)) {
    $blocks = _block_load_blocks();
  }

  // Create an empty array if there are no entries.
  if (!isset($blocks[$region])) {
    $blocks[$region] = array();
  }
  else {

    // Convert the blocks array into the right format.
    $region_blocks = array();
    foreach ($blocks[$region] as $key => $block) {
      $region_blocks["{$block->module}_{$block->delta}"] = $block;
    }
    $blocks[$region] = $region_blocks;
  }
  return $blocks[$region];
}