block_box_save

Versions
4.6 – 5
block_box_save($edit, $delta = NULL)
6
block_box_save($edit, $delta)

▾ 2 functions call block_box_save()

block_block in modules/block.module
Implementation of hook_block().
block_box_add in modules/block.module
Menu callback; displays the block creation form.

Code

modules/block.module, line 362

<?php
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']);
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.