You are here

function sharedblocks_subscribe_delete_form in Shared Blocks 7

Form for deletion of a subscription block.

1 string reference to 'sharedblocks_subscribe_delete_form'
sharedblocks_menu in ./sharedblocks.module
Implements hook_menu().

File

./sharedblocks.module, line 354

Code

function sharedblocks_subscribe_delete_form($form, &$form_state, $id = NULL) {
  if (!is_null($id) && is_numeric($id)) {
    $edit = db_select('sharedblocks', 'sb')
      ->fields('sb')
      ->condition('id', $id)
      ->execute()
      ->fetchAssoc();
  }
  $form['id'] = array(
    '#type' => 'hidden',
    '#value' => $id,
  );
  $form['name'] = array(
    '#type' => 'hidden',
    '#value' => $edit['name'],
  );
  return confirm_form($form, t('Are you sure you want to delete the %name shared block?', array(
    '%name' => $edit['name'],
  )), 'admin/structure/sharedblocks/subscribe', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}