You are here

protected function WizardPluginBase::build_display_options in Views (for Drupal 7) 8.3

Builds an array of display options for the view.

Return value

array An array whose keys are the names of each display and whose values are arrays of options for that display.

1 call to WizardPluginBase::build_display_options()
WizardPluginBase::instantiate_view in lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php
Instantiates a view object from form values.

File

lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php, line 580
Definition of Drupal\views\Plugin\views\wizard\WizardPluginBase.

Class

WizardPluginBase
Provides the interface and base class for Views Wizard plugins.

Namespace

Drupal\views\Plugin\views\wizard

Code

protected function build_display_options($form, $form_state) {

  // Display: Master
  $display_options['default'] = $this
    ->default_display_options();
  $display_options['default'] += array(
    'filters' => array(),
    'sorts' => array(),
  );
  $display_options['default']['filters'] += $this
    ->default_display_filters($form, $form_state);
  $display_options['default']['sorts'] += $this
    ->default_display_sorts($form, $form_state);

  // Display: Page
  if (!empty($form_state['values']['page']['create'])) {
    $display_options['page'] = $this
      ->page_display_options($form, $form_state);

    // Display: Feed (attached to the page)
    if (!empty($form_state['values']['page']['feed'])) {
      $display_options['feed'] = $this
        ->page_feed_display_options($form, $form_state);
    }
  }

  // Display: Block
  if (!empty($form_state['values']['block']['create'])) {
    $display_options['block'] = $this
      ->block_display_options($form, $form_state);
  }
  return $display_options;
}