protected function DisplayPluginBase::defineOptions

Information about options for all kinds of purposes will be held here. @code 'option_name' => array(

  • 'default' => default value,
  • 'translatable' => (optional) TRUE/FALSE (wrap in t() on export if true),
  • 'contains' => (optional) array of items this contains, with its own defaults, etc. If contains is set, the default will be ignored and assumed to be array().
  • 'bool' => (optional) TRUE/FALSE Is the value a boolean value. This will change the export format to TRUE/FALSE instead of 1/0.

),

Return value

array Returns the options of this handler/plugin.

Overrides PluginBase::defineOptions

7 calls to DisplayPluginBase::defineOptions()
Attachment::defineOptions in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/Attachment.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
Block::defineOptions in drupal/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
DisplayPluginBase::initDisplay in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
DisplayPluginBase::mergeDefaults in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
Merges default values for all plugin types.
DisplayTest::defineOptions in drupal/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display/DisplayTest.php
Overrides Drupal\views\Plugin\views\display\DisplayPluginBase::defineOptions().

... See full list

5 methods override DisplayPluginBase::defineOptions()
Attachment::defineOptions in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/Attachment.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
Block::defineOptions in drupal/core/modules/block/lib/Drupal/block/Plugin/views/display/Block.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
DisplayTest::defineOptions in drupal/core/modules/views/tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display/DisplayTest.php
Overrides Drupal\views\Plugin\views\display\DisplayPluginBase::defineOptions().
EntityReference::defineOptions in drupal/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/views/display/EntityReference.php
Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::defineOptions().
PathPluginBase::defineOptions in drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php
Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase:defineOptions().

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php, line 449
Contains Drupal\views\Plugin\views\display\DisplayPluginBase.

Class

DisplayPluginBase
The default display plugin handler. Display plugins handle options and basic mechanisms for different output methods.

Namespace

Drupal\views\Plugin\views\display

Code

protected function defineOptions() {
  $options = array(
    'defaults' => array(
      'default' => array(
        'access' => TRUE,
        'cache' => TRUE,
        'query' => TRUE,
        'title' => TRUE,
        'css_class' => TRUE,
        'display_description' => FALSE,
        'use_ajax' => TRUE,
        'hide_attachment_summary' => TRUE,
        'show_admin_links' => TRUE,
        'pager' => TRUE,
        'use_more' => TRUE,
        'use_more_always' => TRUE,
        'use_more_text' => TRUE,
        'exposed_form' => TRUE,
        'link_display' => TRUE,
        'link_url' => '',
        'group_by' => TRUE,
        'style' => TRUE,
        'row' => TRUE,
        'header' => TRUE,
        'footer' => TRUE,
        'empty' => TRUE,
        'relationships' => TRUE,
        'fields' => TRUE,
        'sorts' => TRUE,
        'arguments' => TRUE,
        'filters' => TRUE,
        'filter_groups' => TRUE,
      ),
    ),
    'title' => array(
      'default' => '',
      'translatable' => TRUE,
    ),
    'enabled' => array(
      'default' => TRUE,
      'translatable' => FALSE,
      'bool' => TRUE,
    ),
    'display_comment' => array(
      'default' => '',
    ),
    'css_class' => array(
      'default' => '',
      'translatable' => FALSE,
    ),
    'display_description' => array(
      'default' => '',
      'translatable' => TRUE,
    ),
    'use_ajax' => array(
      'default' => FALSE,
      'bool' => TRUE,
    ),
    'hide_attachment_summary' => array(
      'default' => FALSE,
      'bool' => TRUE,
    ),
    'show_admin_links' => array(
      'default' => TRUE,
      'bool' => TRUE,
    ),
    'use_more' => array(
      'default' => FALSE,
      'bool' => TRUE,
    ),
    'use_more_always' => array(
      'default' => FALSE,
      'bool' => TRUE,
    ),
    'use_more_text' => array(
      'default' => 'more',
      'translatable' => TRUE,
    ),
    'link_display' => array(
      'default' => '',
    ),
    'link_url' => array(
      'default' => '',
    ),
    'group_by' => array(
      'default' => FALSE,
      'bool' => TRUE,
    ),
    'field_langcode' => array(
      'default' => '***CURRENT_LANGUAGE***',
    ),
    'field_langcode_add_to_query' => array(
      'default' => TRUE,
      'bool' => TRUE,
    ),
    // These types are all plugins that can have individual settings
    // and therefore need special handling.
    'access' => array(
      'contains' => array(
        'type' => array(
          'default' => 'none',
        ),
        'options' => array(
          'default' => array(),
        ),
      ),
      'merge_defaults' => array(
        $this,
        'mergePlugin',
      ),
    ),
    'cache' => array(
      'contains' => array(
        'type' => array(
          'default' => 'none',
        ),
        'options' => array(
          'default' => array(),
        ),
      ),
      'merge_defaults' => array(
        $this,
        'mergePlugin',
      ),
    ),
    'query' => array(
      'contains' => array(
        'type' => array(
          'default' => 'views_query',
        ),
        'options' => array(
          'default' => array(),
        ),
      ),
      'merge_defaults' => array(
        $this,
        'mergePlugin',
      ),
    ),
    'exposed_form' => array(
      'contains' => array(
        'type' => array(
          'default' => 'basic',
        ),
        'options' => array(
          'default' => array(),
        ),
      ),
      'merge_defaults' => array(
        $this,
        'mergePlugin',
      ),
    ),
    'pager' => array(
      'contains' => array(
        'type' => array(
          'default' => 'mini',
        ),
        'options' => array(
          'default' => array(),
        ),
      ),
      'merge_defaults' => array(
        $this,
        'mergePlugin',
      ),
    ),
    'style' => array(
      'contains' => array(
        'type' => array(
          'default' => 'default',
        ),
        'options' => array(
          'default' => array(),
        ),
      ),
      'merge_defaults' => array(
        $this,
        'mergePlugin',
      ),
    ),
    'row' => array(
      'contains' => array(
        'type' => array(
          'default' => 'fields',
        ),
        'options' => array(
          'default' => array(),
        ),
      ),
      'merge_defaults' => array(
        $this,
        'mergePlugin',
      ),
    ),
    'exposed_block' => array(
      'default' => FALSE,
    ),
    'header' => array(
      'default' => array(),
      'merge_defaults' => array(
        $this,
        'mergeHandler',
      ),
    ),
    'footer' => array(
      'default' => array(),
      'merge_defaults' => array(
        $this,
        'mergeHandler',
      ),
    ),
    'empty' => array(
      'default' => array(),
      'merge_defaults' => array(
        $this,
        'mergeHandler',
      ),
    ),
    // We want these to export last.
    // These are the 5 handler types.
    'relationships' => array(
      'default' => array(),
      'merge_defaults' => array(
        $this,
        'mergeHandler',
      ),
    ),
    'fields' => array(
      'default' => array(),
      'merge_defaults' => array(
        $this,
        'mergeHandler',
      ),
    ),
    'sorts' => array(
      'default' => array(),
      'merge_defaults' => array(
        $this,
        'mergeHandler',
      ),
    ),
    'arguments' => array(
      'default' => array(),
      'merge_defaults' => array(
        $this,
        'mergeHandler',
      ),
    ),
    'filter_groups' => array(
      'contains' => array(
        'operator' => array(
          'default' => 'AND',
        ),
        'groups' => array(
          'default' => array(
            1 => 'AND',
          ),
        ),
      ),
    ),
    'filters' => array(
      'default' => array(),
    ),
  );
  if (!$this
    ->usesPager()) {
    $options['defaults']['default']['use_pager'] = FALSE;
    $options['defaults']['default']['items_per_page'] = FALSE;
    $options['defaults']['default']['offset'] = FALSE;
    $options['defaults']['default']['pager'] = FALSE;
    $options['pager']['contains']['type']['default'] = 'some';
  }
  if ($this
    ->isDefaultDisplay()) {
    unset($options['defaults']);
  }
  foreach ($this->extender as $extender) {
    $extender
      ->defineOptionsAlter($options);
  }
  return $options;
}