You are here

function notifications_forum_user_forum_form_submit in Forum notifications 6

Same name and namespace in other branches
  1. 7 notifications_forum.module \notifications_forum_user_forum_form_submit()

Submit function for the user forum notifactions form.

File

./notifications_forum.module, line 234

Code

function notifications_forum_user_forum_form_submit($form, &$form_state) {
  $account = (object) $form_state['values']['account'];
  foreach ($form_state['values']['subscriptions'] as $value) {
    if ($value['subscribe']) {
      _notifications_forum_subscribe_to_forum($account, $value['tid'], $value);
    }
    elseif (!empty($value['sid'])) {
      notifications_subscription_delete($value['sid']);
    }
  }
  drupal_set_message(t('Your forum subscriptions have been updated.'));
}