You are here

function notifications_admin_queue_operations_submit in Notifications 6.3

Same name and namespace in other branches
  1. 6 notifications.admin.inc \notifications_admin_queue_operations_submit()
  2. 6.2 notifications.admin.inc \notifications_admin_queue_operations_submit()

Operations form submit, translate op into callback

File

./notifications.admin.inc, line 442

Code

function notifications_admin_queue_operations_submit($form, &$form_state) {
  include_once drupal_get_path('module', 'notifications') . '/notifications.cron.inc';

  // Enable messaging & notifications logs
  messaging_log_start();
  $operations = notifications_queue_operations();
  if ($mode = $form_state['values']['operation']) {
    $process = $operations[$mode];
    $args = !empty($process['callback arguments']) ? $process['callback arguments'] : array();
    call_user_func_array($process['callback'], $args);
    drupal_set_message($process['description']);
    $form_state['redirect'] = 'admin/messaging/subscriptions/queue/' . $mode;
  }
}