You are here

function _quotes_block_delete in Quotes 7

Same name and namespace in other branches
  1. 5 quotes.module \_quotes_block_delete()
  2. 6 quotes.admin.inc \_quotes_block_delete()

Confirms the deletion a quote block.

Parameters

array $bid: The block values of the block being deleted.

Return value

string A string containing the confirmation form displayed to the user.

1 string reference to '_quotes_block_delete'
quotes_menu in ./quotes.module
Implements hook_menu().

File

./quotes.admin.inc, line 412
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($form_stuff, $bid) {
  $bid_id = $bid['build_info']['args'][0];
  $qbname = db_select('quotes_blocks', 'qb')
    ->fields('qb', array(
    'name',
  ))
    ->condition('qb.bid', $bid_id)
    ->execute()
    ->fetchField();
  if (isset($qbname) && !empty($qbname)) {
    $form = array();
    $form['bid'] = array(
      '#type' => 'value',
      '#value' => $bid_id,
    );
    $form['block_name'] = array(
      '#type' => 'value',
      '#value' => $qbname,
    );
    return confirm_form($form, t('Are you sure you want to delete the block %name?', array(
      '%name' => $qbname,
    )), 'admin/config/quotes/blocks', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
  }
  else {
    drupal_set_message(t('There are no quotes configuration blocks to delete .'));
  }
}