function ViewsUiBaseViewsWizard::instantiate_view

1 call to ViewsUiBaseViewsWizard::instantiate_view()
ViewsUiBaseViewsWizard::validate in plugins/views_wizard/views_ui_base_views_wizard.class.php
Instantiates a view and validates values.

File

plugins/views_wizard/views_ui_base_views_wizard.class.php, line 476

Class

ViewsUiBaseViewsWizard
A very generic Views Wizard class - can be constructed for any base table.

Code

protected function instantiate_view($form, &$form_state) {
    // Build the basic view properties.
    $view = views_new_view();
    $view->name = $form_state['values']['name'];
    $view->human_name = $form_state['values']['human_name'];
    $view->description = $form_state['values']['description'];
    $view->tag = 'default';
    $view->core = VERSION;
    $view->base_table = $this->base_table;
    // Build all display options for this view.
    $display_options = $this->build_display_options($form, $form_state);
    // Allow the fully built options to be altered. This happens before adding
    // the options to the view, so that once they are eventually added we will
    // be able to get all the overrides correct.
    $this->alter_display_options($display_options, $form, $form_state);
    $this->add_displays($view, $display_options, $form, $form_state);
    return $view;
}