protected function WizardPluginBase::buildDisplayOptions

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::buildDisplayOptions()
WizardPluginBase::instantiateView in drupal/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php
Instantiates a view object from form values.

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php, line 652
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 buildDisplayOptions($form, $form_state) {

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

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

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

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