You are here

function multiblock_call_block in MultiBlock 5

Same name and namespace in other branches
  1. 6 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 77

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,
      );
    }
    return module_invoke($block_info->module, 'block', $op, $block_info->orig_delta, $edit);
  }

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