1.20.x views_ui.admin.inc | views_ui_add_form_store_edit_submit($form, &$form_state) |
Process the add view form, 'continue'.
File
- modules/
views_ui/ views_ui.admin.inc, line 821 - Admin page callbacks for the Views UI module.
Code
function views_ui_add_form_store_edit_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';
}
// Just cache it temporarily to configure it.
views_ui_cache_set($view);
// If there is a destination query, ensure we still redirect the user to the
// configure view page, and then redirect the user to the destination.
$destination = array();
if (isset($_GET['destination'])) {
$destination = backdrop_get_destination();
unset($_GET['destination']);
}
$form_state['redirect'] = array('admin/structure/views/view/' . $view->name, array('query' => $destination));
}