You are here

function views_bulk_operations_view_settings_submit in Views Bulk Operations (VBO) 5

File

./views_bulk_operations.module, line 597
Allow bulk node operations directly within views.

Code

function views_bulk_operations_view_settings_submit($form_id, $form_values) {
  $view = module_invoke('views', 'get_view', $form_values['vid']);
  $all_operations = _views_bulk_operations_get_operations('all', $form_values['vid']);

  // set the enabled/disabled status, but leave other values alone
  foreach ($all_operations as $operation => $values) {
    $all_operations[$operation]['enabled'] = $form_values['operations'][$operation];
  }

  // store serialized data
  _views_bulk_operations_set($form_values['vid'], $all_operations);
  variable_set('vbo_queue_' . $form_values['vid'], $form_values['job_queue']);

  // return to view
  if (isset($view->url)) {
    return $view->url;
  }
}