function _block_get_renderable_array in Drupal 7
Gets an array of blocks suitable for drupal_render().
Parameters
$list: A list of blocks such as that returned by block_list().
Return value
A renderable array.
3 calls to _block_get_renderable_array()
- block_get_blocks_by_region in modules/
block/ block.module - Gets a renderable array of a region containing all enabled blocks.
- dashboard_page_build in modules/
dashboard/ dashboard.module - Implements hook_page_build().
- dashboard_show_block_content in modules/
dashboard/ dashboard.module - Ajax callback: Displays the rendered contents of a specific block.
File
- modules/
block/ block.module, line 333 - Controls the visual building blocks a page is constructed with.
Code
function _block_get_renderable_array($list = array()) {
$weight = 0;
$build = array();
foreach ($list as $key => $block) {
$build[$key] = $block->content;
unset($block->content);
// Add contextual links for this block; skip the main content block, since
// contextual links are basically output as tabs/local tasks already. Also
// skip the help block, since we assume that most users do not need or want
// to perform contextual actions on the help block, and the links needlessly
// draw attention on it.
if ($key != 'system_main' && $key != 'system_help') {
$build[$key]['#contextual_links']['block'] = array(
'admin/structure/block/manage',
array(
$block->module,
$block->delta,
),
);
}
$build[$key] += array(
'#block' => $block,
'#weight' => ++$weight,
);
$build[$key]['#theme_wrappers'][] = 'block';
}
$build['#sorted'] = TRUE;
return $build;
}