You are here

function multiblock_add in MultiBlock 5

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

Add a multiblock instance.

Parameters

$original_block: The original block for which an instance is being created.

$block_instance: An object contain information about the particular block instance.

Return value

The delta of the newly added block.

1 call to multiblock_add()
multiblock_add_form_submit in ./multiblock.module
Add block instance to database from "Add Block Instance" form.

File

./multiblock.module, line 196

Code

function multiblock_add($original_block, $block_instance) {

  // Create new delta for block instance.
  $delta = db_next_id('{multiblock}_delta');
  $sql = "INSERT INTO {multiblock}\n          (delta, title, module, orig_delta, multi_settings)\n          VALUES (%d, '%s', '%s', '%s', %d)";
  db_query($sql, $delta, $block_instance->title, $original_block->module, $original_block->delta, $block_instance->mb_enabled);
  return $delta;
}