You are here

protected function WizardPluginBase::blockDisplayOptions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 1072
Contains \Drupal\views\Plugin\views\wizard\WizardPluginBase.

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 = array();
  $block = $form_state
    ->getValue('block');
  $display_options['title'] = $block['title'];
  $display_options['style'] = array(
    'type' => $block['style']['style_plugin'],
  );
  $display_options['row'] = array(
    'type' => isset($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;
}