You are here

function spam_admin_overview_submit in Spam 5.3

Same name and namespace in other branches
  1. 6 spam.module \spam_admin_overview_submit()

Submit the spam administration update form.

File

./spam.module, line 1353

Code

function spam_admin_overview_submit($form_id, $form_values) {
  $operations = module_invoke_all('spam_operations');
  $operation = $operations[$form_values['operation']];

  // Filter out unchecked nodes
  $spam = array_filter($form_values['spam']);
  if ($function = $operation['callback']) {

    // Add in callback arguments if present.
    if (isset($operation['callback arguments'])) {
      $args = array_merge(array(
        $spam,
      ), $operation['callback arguments']);
    }
    else {
      $args = array(
        $spam,
      );
    }
    call_user_func_array($function, $args);
    cache_clear_all();
    drupal_set_message(t('The update has been performed.'));
  }
}