You are here

function notifications_form_unsubscribe_confirm_submit in Notifications 6

Same name and namespace in other branches
  1. 5 notifications.admin.inc \notifications_form_unsubscribe_confirm_submit()
  2. 6.4 notifications.pages.inc \notifications_form_unsubscribe_confirm_submit()
  3. 6.2 notifications.pages.inc \notifications_form_unsubscribe_confirm_submit()
  4. 6.3 notifications.pages.inc \notifications_form_unsubscribe_confirm_submit()

Process form submission

File

./notifications.pages.inc, line 354
User pages for Notifications

Code

function notifications_form_unsubscribe_confirm_submit($form, &$form_state) {
  $subscription = $form_state['values']['subscription'];
  $account = $form_state['values']['account'];
  switch ($form_state['values']['op']) {
    case t('Unsubscribe'):
      if ($subscription) {
        notifications_delete_subscription($subscription->sid);
        drupal_set_message(t('Your subscription has been removed.'));
      }
      elseif ($account) {
        notifications_delete_subscriptions(array(
          'uid' => $account->uid,
        ));
        drupal_set_message(t('All your subscriptions have been removed.'));
      }
      break;
    case t('Cancel'):

      // Do nothing, not worth showing a message, just get back
      break;
  }
}