protected function WizardPluginBase::pageDisplayOptions

Retrieves the page display options.

Parameters

array $form: The full wizard form array.

array $form_state: The current state of the wizard form.

Return value

array Returns an array of display options.

3 calls to WizardPluginBase::pageDisplayOptions()
2 methods override WizardPluginBase::pageDisplayOptions()

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php, line 957
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 pageDisplayOptions(array $form, array &$form_state) {
  $display_options = array();
  $page = $form_state['values']['page'];
  $display_options['title'] = $page['title'];
  $display_options['path'] = $page['path'];
  $display_options['style'] = array(
    'type' => $page['style']['style_plugin'],
  );

  // Not every style plugin supports row style plugins.
  // Make sure that the selected row plugin is a valid one.
  $options = $this
    ->rowStyleOptions();
  $display_options['row'] = array(
    'type' => isset($page['style']['row_plugin']) && isset($options[$page['style']['row_plugin']]) ? $page['style']['row_plugin'] : 'fields',
  );

  // If the specific 0 items per page, use no pager.
  if (empty($page['items_per_page'])) {
    $display_options['pager']['type'] = 'none';
  }
  elseif (isset($page['pager'])) {
    $display_options['pager']['type'] = 'full';
  }
  else {
    $display_options['pager']['type'] = 'some';
  }
  $display_options['pager']['options']['items_per_page'] = $page['items_per_page'];

  // Generate the menu links settings if the user checked the link checkbox.
  if (!empty($page['link'])) {
    $display_options['menu']['type'] = 'normal';
    $display_options['menu']['title'] = $page['link_properties']['title'];
    $display_options['menu']['name'] = $page['link_properties']['menu_name'];
  }
  return $display_options;
}