You are here

function notifications_admin_queue_operations_submit in Notifications 6

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

Operations form submit, translate op into callback

File

./notifications.admin.inc, line 383

Code

function notifications_admin_queue_operations_submit($form, $form_state) {
  include_once drupal_get_path('module', 'notifications') . '/notifications.cron.inc';
  foreach (notifications_queue_operations() as $op => $data) {
    if ($form_state['values']['op'] == $data['label']) {
      $callback = $data['callback'];
      $args = !empty($data['callback arguments']) ? $data['callback arguments'] : array();
      call_user_func_array($callback, $args);
      break;
    }
  }

  // Store logs to render on next page redirect
  $_SESSION['notifications_logs'] = notifications_log();
}