You are here

function block_custom_block_delete_submit in Drupal 7

Form submission handler for block_custom_block_delete().

See also

block_custom_block_delete()

File

modules/block/block.admin.inc, line 635
Admin page callbacks for the block module.

Code

function block_custom_block_delete_submit($form, &$form_state) {
  db_delete('block_custom')
    ->condition('bid', $form_state['values']['bid'])
    ->execute();
  db_delete('block')
    ->condition('module', 'block')
    ->condition('delta', $form_state['values']['bid'])
    ->execute();
  db_delete('block_role')
    ->condition('module', 'block')
    ->condition('delta', $form_state['values']['bid'])
    ->execute();
  drupal_set_message(t('The block %name has been removed.', array(
    '%name' => $form_state['values']['info'],
  )));
  cache_clear_all();
  $form_state['redirect'] = 'admin/structure/block';
  return;
}