function _quotes_block_delete_submit in Quotes 7
Same name and namespace in other branches
- 5 quotes.module \_quotes_block_delete_submit()
- 6 quotes.admin.inc \_quotes_block_delete_submit()
Deletes the specified block.
@result string A string specifying the page to which the user should be redirected (admin/settings/quotes/blocks).
Parameters
array $form: The form that was submitted.
array $form_state: The array specifying the form values.
File
- ./
quotes.admin.inc, line 452 - The quotes module allows users to maintain a list of quotes that can be displayed in any number of administrator-defined quote blocks.
Code
function _quotes_block_delete_submit($form, &$form_state) {
db_delete('quotes_blocks')
->condition('bid', $form_state['values']['bid'])
->execute();
// Now delete the block(s) from Drupals block table.
db_delete('block')
->condition('delta', $form_state['values']['bid'])
->condition('module', 'quotes')
->execute();
drupal_set_message(t('The block %name has been removed.', array(
'%name' => $form_state['values']['block_name'],
)));
cache_clear_all();
$form_state['redirect'] = 'admin/config/quotes/blocks';
}