You are here

function date_tools_wizard_add_block in Date 7

Same name and namespace in other branches
  1. 6.2 date_tools/date_tools.wizard.inc \date_tools_wizard_add_block()

Add a block.

1 call to date_tools_wizard_add_block()
date_tools_wizard_create_blocks in date_tools/date_tools.wizard.inc

File

date_tools/date_tools.wizard.inc, line 457

Code

function date_tools_wizard_add_block($block) {

  // Need 'pages'.
  $bid = db_query("SELECT bid FROM {block} WHERE module=:module AND delta=:delta AND theme=:theme", array(
    ':module' => $block->module,
    ':delta' => $block->delta,
    ':theme' => $block->theme,
  ))
    ->fetchField();
  if (empty($bid)) {
    $block->bid = NULL;
    drupal_write_record('block', $block);
  }
  else {
    $block->bid = $bid;
    drupal_write_record('block', $block, array(
      'bid',
    ));
  }
}