You are here

function redhen_contact_contact_unarchive_form in RedHen CRM 7

Form callback: confirmation form for unarchiving a contact.

Parameters

$contact: The contact object to be activated.

See also

confirm_form()

1 string reference to 'redhen_contact_contact_unarchive_form'
redhen_contact_menu in modules/redhen_contact/redhen_contact.module
Implements hook_menu().

File

modules/redhen_contact/includes/redhen_contact.forms.inc, line 268
Forms for creating, editing, and deleting contacts.

Code

function redhen_contact_contact_unarchive_form($form, &$form_state, $contact) {
  $form_state['redhen_contact'] = $contact;

  // Ensure this include file is loaded when the form is rebuilt from the cache.
  $form_state['build_info']['files']['form'] = drupal_get_path('module', 'redhen_contact') . '/includes/redhen_contact.forms.inc';
  $form['#submit'][] = 'redhen_contact_contact_unarchive_form_submit';
  $wrapper = entity_metadata_wrapper('redhen_contact', $contact);
  $full_name = $wrapper->full_name
    ->value();
  $form = confirm_form($form, t('Are you sure you want to unarchive %label?', array(
    '%label' => $full_name,
  )), entity_uri('redhen_contact', $contact), '<p>' . t('Activate this contact.') . '</p>', t('Unarchive'), t('Cancel'), 'confirm');
  return $form;
}