_block_get_renderable_array

7 block.module _block_get_renderable_array($list = array())

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()

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;
}
Login or register to post comments