protected function WizardPluginBase::defaultDisplayOptions

Assembles the default display options for the view.

Most wizards will need to override this method to provide some fields or a different row plugin.

Return value

array Returns an array of display options.

7 calls to WizardPluginBase::defaultDisplayOptions()
Comment::defaultDisplayOptions in drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/wizard/Comment.php
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayOptions().
File::defaultDisplayOptions in drupal/core/modules/file/lib/Drupal/file/Plugin/views/wizard/File.php
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayOptions().
Node::defaultDisplayOptions in drupal/core/modules/node/lib/Drupal/node/Plugin/views/wizard/Node.php
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayOptions().
NodeRevision::defaultDisplayOptions in drupal/core/modules/node/lib/Drupal/node/Plugin/views/wizard/NodeRevision.php
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayOptions().
TaxonomyTerm::defaultDisplayOptions in drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/wizard/TaxonomyTerm.php
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayOptions().

... See full list

6 methods override WizardPluginBase::defaultDisplayOptions()
Comment::defaultDisplayOptions in drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/wizard/Comment.php
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayOptions().
File::defaultDisplayOptions in drupal/core/modules/file/lib/Drupal/file/Plugin/views/wizard/File.php
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayOptions().
Node::defaultDisplayOptions in drupal/core/modules/node/lib/Drupal/node/Plugin/views/wizard/Node.php
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayOptions().
NodeRevision::defaultDisplayOptions in drupal/core/modules/node/lib/Drupal/node/Plugin/views/wizard/NodeRevision.php
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayOptions().
TaxonomyTerm::defaultDisplayOptions in drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/wizard/TaxonomyTerm.php
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::defaultDisplayOptions().

... See full list

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php, line 746
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 defaultDisplayOptions() {
  $display_options = array();
  $display_options['access']['type'] = 'none';
  $display_options['cache']['type'] = 'none';
  $display_options['query']['type'] = 'views_query';
  $display_options['exposed_form']['type'] = 'basic';
  $display_options['pager']['type'] = 'full';
  $display_options['style']['type'] = 'default';
  $display_options['row']['type'] = 'fields';

  // Add default options array to each plugin type.
  foreach ($display_options as &$options) {
    $options['options'] = array();
  }

  // Add a least one field so the view validates and the user has a preview.
  // The base field can provide a default in its base settings; otherwise,
  // choose the first field with a field handler.
  $data = Views::viewsData()
    ->get($this->base_table);
  if (isset($data['table']['base']['defaults']['field'])) {
    $field = $data['table']['base']['defaults']['field'];
  }
  else {
    foreach ($data as $field => $field_data) {
      if (isset($field_data['field']['id'])) {
        break;
      }
    }
  }
  $display_options['fields'][$field] = array(
    'table' => $this->base_table,
    'field' => $field,
    'id' => $field,
  );
  return $display_options;
}