You are here

function block_box_save in Drupal 4

Same name and namespace in other branches
  1. 5 modules/block/block.module \block_box_save()
  2. 6 modules/block/block.module \block_box_save()
2 calls to block_box_save()
block_block in modules/block.module
Implementation of hook_block().
block_box_add_submit in modules/block.module

File

modules/block.module, line 536
Controls the boxes that are displayed around the main content.

Code

function block_box_save($edit, $delta = NULL) {
  if (!filter_access($edit['format'])) {
    $edit['format'] = FILTER_FORMAT_DEFAULT;
  }
  if (isset($delta)) {
    db_query("UPDATE {boxes} SET title = '%s', body = '%s', info = '%s', format = %d WHERE bid = %d", $edit['title'], $edit['body'], $edit['info'], $edit['format'], $delta);
  }
  else {
    db_query("INSERT INTO {boxes} (title, body, info, format) VALUES  ('%s', '%s', '%s', %d)", $edit['title'], $edit['body'], $edit['info'], $edit['format']);
  }
  return true;
}