You are here

function notifications_manage_subscriptions_form_submit in Notifications 6.2

Same name and namespace in other branches
  1. 6.4 notifications.manage.inc \notifications_manage_subscriptions_form_submit()
  2. 6 notifications.manage.inc \notifications_manage_subscriptions_form_submit()
  3. 6.3 notifications.manage.inc \notifications_manage_subscriptions_form_submit()
  4. 7 notifications.manage.inc \notifications_manage_subscriptions_form_submit()

Handle manage form submissions, run batch operations

1 string reference to 'notifications_manage_subscriptions_form_submit'
notifications_manage_subscriptions_form in ./notifications.manage.inc
Administer user subscriptions

File

./notifications.manage.inc, line 159
Common functions for bulk management of subscriptions

Code

function notifications_manage_subscriptions_form_submit($form, &$form_state) {
  $operations = notifications_subscriptions_operations();
  $operation = $operations[$form_state['values']['operation']];

  // Filter out unchecked subscriptions
  $items = array_filter($form_state['values']['subscriptions']);
  if ($function = $operation['callback']) {

    // Add in callback arguments if present.
    if (isset($operation['callback arguments'])) {
      $args = array_merge(array(
        $items,
      ), $operation['callback arguments']);
    }
    else {
      $args = array(
        $items,
      );
    }
    call_user_func_array($function, $args);
  }
  else {

    // We need to rebuild the form to go to a second step.  For example, to
    // show the confirmation form for the deletion of subscriptions.
    $form_state['rebuild'] = TRUE;
  }
}