You are here

function notifications_account_form_unsubscribe_confirm in Notifications 7

Form for unsubscription confirmation

It works for both single subscription or account (all subscriptions)

1 string reference to 'notifications_account_form_unsubscribe_confirm'
notifications_account_menu in notifications_account/notifications_account.module
Implementation of hook_menu()

File

notifications_account/notifications_account.pages.inc, line 282
User pages for Notifications

Code

function notifications_account_form_unsubscribe_confirm($form_state, $subscription, $account = NULL) {

  // Pass on subscription values
  $form['subscription'] = array(
    '#type' => 'value',
    '#value' => $subscription,
  );
  $form['account'] = array(
    '#type' => 'value',
    '#value' => $account,
  );
  if ($subscription) {
    $message = t('Are you sure you want to delete this subscription?');

    // The subscription description will be added here
    $form['info'] = $subscription
      ->form_info();
  }
  else {
    $message = t('Are you sure you want to remove all your subscriptions on this site?');
  }
  return confirm_form($form, $message, isset($_GET['destination']) ? $_GET['destination'] : '', t('This action cannot be undone.'), t('Unsubscribe'), t('Cancel'));
}