You are here

function multiblock_call_block in MultiBlock 6

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

Dispatch a hook_block call to it's respective module. Paramater $delta is the new multiblock delta that we're using and $op is the op we are dispatching.

1 call to multiblock_call_block()
multiblock_block in ./multiblock.module
Implementation of hook_block().

File

./multiblock.module, line 76

Code

function multiblock_call_block($delta, $op, $edit) {
  $result = db_query("SELECT module, orig_delta, delta, multi_settings FROM {multiblock} WHERE delta='%s'", $delta);
  if ($block_info = db_fetch_object($result)) {

    // If this block is multiblock enabled, send it the delta of the block we're using.
    if ($block_info->multi_settings == 1) {
      $edit['multiblock_delta'] = array(
        '#type' => 'value',
        '#value' => $block_info->delta,
      );
    }
    $edit['multiblock_delta'] = $delta;
    $block = module_invoke($block_info->module, 'block', $op, $block_info->orig_delta, $edit);

    //    if ($op == 'view') {
    //      $block['orig_module'] = $block_info->module;
    //      $block['orig_delta'] = $block_info->orig_delta;
    //    }
    return $block;
  }

  // No such multiblock, shouldn't ever happen.
  return;
}