You are here

function multiblock_block_info in MultiBlock 7

Implements hook_block_info().

File

./multiblock.module, line 36
Enhances the block API, as provided by D7 Core.

Code

function multiblock_block_info() {

  // Get all of the block instances that exist.
  $blocks = array();
  $blocks = multiblock_get_block(NULL);
  foreach ($blocks as $block) {
    $blocks[$block->delta] = array(
      'info' => $block->title,
    );
    $cache = db_query('SELECT cache FROM {block} WHERE module = :module AND delta = :orig_delta', array(
      ':module' => $block->module,
      ':orig_delta' => $block->orig_delta,
    ))
      ->fetchField();
    if ($cache) {
      $blocks[$block->delta]['cache'] = $cache;
    }
  }
  return $blocks;
}