You are here

function mailhandler_admin_delete_confirm in Mailhandler 6

Same name and namespace in other branches
  1. 5 mailhandler.module \mailhandler_admin_delete_confirm()
  2. 7 mailhandler.admin.inc \mailhandler_admin_delete_confirm()

Display a confirmation form before deleting a Mailbox.

1 string reference to 'mailhandler_admin_delete_confirm'
mailhandler_menu in ./mailhandler.module
Implementation of hook_menu().

File

./mailhandler.admin.inc, line 280
Administrator pages for the Mailhandler module.

Code

function mailhandler_admin_delete_confirm($form_state, $mailbox = NULL) {
  $form = array();

  // $mailbox parameter is expected to be a valid mailbox or NULL.
  if (!$mailbox) {
    drupal_not_found();
    return;
  }

  // Save the mailbox for the confirm_form.
  $form['mailbox'] = array(
    '#type' => 'value',
    '#value' => $mailbox,
  );

  // Build a confirmation form to delete this entry.
  return confirm_form($form, t('Do you wish to delete mailbox %mailbox?', array(
    '%mailbox' => $mailbox['mail'],
  )), 'admin/content/mailhandler', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}