You are here

function multiblock_get_block in MultiBlock 5

Same name and namespace in other branches
  1. 6 multiblock.module \multiblock_get_block()
  2. 7 multiblock.module \multiblock_get_block()

Fetch a given block from the multiblock database table.

Parameters

$delta: Optional. Retreive a single block based on this delta. If none specified, all multiblock instances are returned.

$reset: Optional. Boolean value to reset the interal cache of this function.

3 calls to multiblock_get_block()
multiblock_block in ./multiblock.module
Implementation of hook_block().
multiblock_delete_form in ./multiblock.module
multiblock_general in ./multiblock.module
Page callback for the "Manage Block Instances page".

File

./multiblock.module, line 58

Code

function multiblock_get_block($delta = NULL, $reset = FALSE) {
  static $blocks;
  if (!isset($blocks) || $reset) {
    $blocks = array();
    $result = db_query("SELECT * FROM {multiblock}");
    while ($row = db_fetch_object($result)) {
      $blocks[$row->delta] = $row;
    }
  }
  return is_numeric($delta) ? $blocks[$delta] : $blocks;
}