You are here

protected function DisplayPluginBase::defineOptions in Views (for Drupal 7) 8.3

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

5 calls to DisplayPluginBase::defineOptions()
Attachment::defineOptions in 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 lib/Views/block/Plugin/views/display/Block.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
DisplayPluginBase::init in lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
DisplayTest::defineOptions in tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display/DisplayTest.php
Overrides Drupal\views\Plugin\views\display\DisplayPluginBase::defineOptions().
Page::defineOptions in lib/Drupal/views/Plugin/views/display/Page.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(
4 methods override DisplayPluginBase::defineOptions()
Attachment::defineOptions in 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 lib/Views/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 tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display/DisplayTest.php
Overrides Drupal\views\Plugin\views\display\DisplayPluginBase::defineOptions().
Page::defineOptions in lib/Drupal/views/Plugin/views/display/Page.php
Information about options for all kinds of purposes will be held here. @code 'option_name' => array(

File

lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php, line 425
Definition of 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,
        'hide_admin_links' => FALSE,
        '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,
    ),
    'hide_admin_links' => array(
      'default' => FALSE,
      '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(),
        ),
      ),
    ),
    'cache' => array(
      'contains' => array(
        'type' => array(
          'default' => 'none',
        ),
        'options' => array(
          'default' => array(),
        ),
      ),
    ),
    'query' => array(
      'contains' => array(
        'type' => array(
          'default' => 'views_query',
        ),
        'options' => array(
          'default' => array(),
        ),
      ),
    ),
    'exposed_form' => array(
      'contains' => array(
        'type' => array(
          'default' => 'basic',
        ),
        'options' => array(
          'default' => array(),
        ),
      ),
    ),
    'pager' => array(
      'contains' => array(
        'type' => array(
          'default' => 'full',
        ),
        'options' => array(
          'default' => array(),
        ),
      ),
    ),
    'style' => array(
      'contains' => array(
        'type' => array(
          'default' => 'default',
        ),
        'options' => array(
          'default' => array(),
        ),
      ),
    ),
    'row' => array(
      'contains' => array(
        'type' => array(
          'default' => 'fields',
        ),
        'options' => array(
          'default' => array(),
        ),
      ),
    ),
    'exposed_block' => array(
      'default' => FALSE,
    ),
    'header' => array(
      'default' => array(),
    ),
    'footer' => array(
      'default' => array(),
    ),
    'empty' => array(
      'default' => array(),
    ),
    // We want these to export last.
    // These are the 5 handler types.
    'relationships' => array(
      'default' => array(),
    ),
    'fields' => array(
      'default' => array(),
    ),
    'sorts' => array(
      'default' => array(),
    ),
    'arguments' => array(
      'default' => array(),
    ),
    '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;
}