You are here

function mass_contact_admin_delete in Mass Contact 6

Same name and namespace in other branches
  1. 5.2 mass_contact.module \mass_contact_admin_delete()
  2. 5 mass_contact.module \mass_contact_admin_delete()
  3. 7 mass_contact.admin.inc \mass_contact_admin_delete()

Displays a form to select a category to delete.

Parameters

form_state: A keyed array containing the current state of the form.

cid: The id of the category to delete.

Return value

A confirmation form for the user to acknowledge.

1 string reference to 'mass_contact_admin_delete'
mass_contact_menu in ./mass_contact.module
Implementation of hook_menu().

File

./mass_contact.module, line 591
This is the main code file for the Mass Contact module. This module enables users to contact multiple users through selected roles.

Code

function mass_contact_admin_delete($form_state, $cid = NULL) {
  $info = db_fetch_object(db_query("SELECT category FROM {mass_contact} WHERE cid = %d", $cid));
  if ($info) {
    $form['category'] = array(
      '#type' => 'value',
      '#value' => $info->category,
    );
    return confirm_form($form, t('Are you sure you want to delete %category?', array(
      '%category' => $info->category,
    )), 'admin/build/mass_contact', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
  }
  else {
    drupal_set_message(t('Category not found.'), 'error');
    drupal_goto('admin/build/mass_contact');
  }
}