You are here

function block_admin_configure_submit in Drupal 5

Same name and namespace in other branches
  1. 4 modules/block.module \block_admin_configure_submit()
  2. 6 modules/block/block.admin.inc \block_admin_configure_submit()
  3. 7 modules/block/block.admin.inc \block_admin_configure_submit()

File

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

Code

function block_admin_configure_submit($form_id, $form_values) {
  if (!form_get_errors()) {
    db_query("UPDATE {blocks} SET visibility = %d, pages = '%s', custom = %d, title = '%s' WHERE module = '%s' AND delta = '%s'", $form_values['visibility'], trim($form_values['pages']), $form_values['custom'], $form_values['title'], $form_values['module'], $form_values['delta']);
    db_query("DELETE FROM {blocks_roles} WHERE module = '%s' AND delta = '%s'", $form_values['module'], $form_values['delta']);
    foreach (array_filter($form_values['roles']) as $rid) {
      db_query("INSERT INTO {blocks_roles} (rid, module, delta) VALUES (%d, '%s', '%s')", $rid, $form_values['module'], $form_values['delta']);
    }
    module_invoke($form_values['module'], 'block', 'save', $form_values['delta'], $form_values);
    drupal_set_message(t('The block configuration has been saved.'));
    cache_clear_all();
    return 'admin/build/block';
  }
}