You are here

protected function WizardPluginBase::default_display_options in Views (for Drupal 7) 8.3

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::default_display_options()
Comment::default_display_options in lib/Views/comment/Plugin/views/wizard/Comment.php
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::default_display_options().
File::default_display_options in lib/Views/file/Plugin/views/wizard/File.php
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::default_display_options().
Node::default_display_options in lib/Views/node/Plugin/views/wizard/Node.php
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::default_display_options().
NodeRevision::default_display_options in lib/Views/node/Plugin/views/wizard/NodeRevision.php
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::default_display_options().
TaxonomyTerm::default_display_options in lib/Views/taxonomy/Plugin/views/wizard/TaxonomyTerm.php
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::default_display_options().

... See full list

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

... See full list

File

lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php, line 667
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 default_display_options() {
  $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 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_fetch_data($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;
}