1 views_ui.admin.inc views_ui_add_form_save_submit($form, &$form_state)

Process the add view form, 'save'.

File

core/modules/views_ui/views_ui.admin.inc, line 791
Admin page callbacks for the Views UI module.

Code

function views_ui_add_form_save_submit($form, &$form_state) {
  try {
    $view = $form_state['wizard_instance']->create_view($form, $form_state);
  }
  catch (ViewsWizardException $e) {
    backdrop_set_message($e->getMessage(), 'error');
    $form_state['redirect'] = 'admin/structure/views';
  }
  $view->save();

  $form_state['redirect'] = 'admin/structure/views';
  if (!empty($view->display['page'])) {
    $display = $view->display['page'];
    if ($display->handler->has_path()) {
      $one_path = $display->handler->get_option('path');
      if (strpos($one_path, '%') === FALSE) {
        $form_state['redirect'] = $one_path; // PATH TO THE VIEW IF IT HAS ONE
        return;
      }
    }
  }
  backdrop_set_message(t('Your view was saved. You may configure it from the list below.'));
}