You are here

protected function WizardPluginBase::blockDisplayOptions in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php \Drupal\views\Plugin\views\wizard\WizardPluginBase::blockDisplayOptions()
  2. 10 core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php \Drupal\views\Plugin\views\wizard\WizardPluginBase::blockDisplayOptions()

Retrieves the block display options.

Parameters

array $form: The full wizard form array.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the wizard form.

Return value

array Returns an array of display options.

2 calls to WizardPluginBase::blockDisplayOptions()
Node::blockDisplayOptions in core/modules/node/src/Plugin/views/wizard/Node.php
Retrieves the block display options.
WizardPluginBase::buildDisplayOptions in core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php
Builds an array of display options for the view.
1 method overrides WizardPluginBase::blockDisplayOptions()
Node::blockDisplayOptions in core/modules/node/src/Plugin/views/wizard/Node.php
Retrieves the block display options.

File

core/modules/views/src/Plugin/views/wizard/WizardPluginBase.php, line 1114

Class

WizardPluginBase
Base class for Views wizard plugins.

Namespace

Drupal\views\Plugin\views\wizard

Code

protected function blockDisplayOptions(array $form, FormStateInterface $form_state) {
  $display_options = [];
  $block = $form_state
    ->getValue('block');
  $display_options['title'] = $block['title'];
  $display_options['style'] = [
    'type' => $block['style']['style_plugin'],
  ];
  $options = $this
    ->rowStyleOptions();
  $display_options['row'] = [
    'type' => isset($block['style']['row_plugin']) && isset($options[$block['style']['row_plugin']]) ? $block['style']['row_plugin'] : 'fields',
  ];
  $display_options['pager']['type'] = $block['pager'] ? 'full' : (empty($block['items_per_page']) ? 'none' : 'some');
  $display_options['pager']['options']['items_per_page'] = $block['items_per_page'];
  return $display_options;
}