public function Attachment::optionsSummary

Provide the summary for attachment options in the views UI.

This output is returned as an array.

Overrides DisplayPluginBase::optionsSummary

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/display/Attachment.php, line 76
Definition of Drupal\views\Plugin\views\display\Attachment.

Class

Attachment
The plugin that handles an attachment display.

Namespace

Drupal\views\Plugin\views\display

Code

public function optionsSummary(&$categories, &$options) {

  // It is very important to call the parent function here:
  parent::optionsSummary($categories, $options);
  $categories['attachment'] = array(
    'title' => t('Attachment settings'),
    'column' => 'second',
    'build' => array(
      '#weight' => -10,
    ),
  );
  $displays = array_filter($this
    ->getOption('displays'));
  if (count($displays) > 1) {
    $attach_to = t('Multiple displays');
  }
  elseif (count($displays) == 1) {
    $display = array_shift($displays);
    if ($display = $this->view->storage
      ->getDisplay($display)) {
      $attach_to = check_plain($display['display_title']);
    }
  }
  if (!isset($attach_to)) {
    $attach_to = t('Not defined');
  }
  $options['displays'] = array(
    'category' => 'attachment',
    'title' => t('Attach to'),
    'value' => $attach_to,
  );
  $options['attachment_position'] = array(
    'category' => 'attachment',
    'title' => t('Attachment position'),
    'value' => $this
      ->attachmentPositions($this
      ->getOption('attachment_position')),
  );
  $options['inherit_arguments'] = array(
    'category' => 'attachment',
    'title' => t('Inherit contextual filters'),
    'value' => $this
      ->getOption('inherit_arguments') ? t('Yes') : t('No'),
  );
  $options['inherit_exposed_filters'] = array(
    'category' => 'attachment',
    'title' => t('Inherit exposed filters'),
    'value' => $this
      ->getOption('inherit_exposed_filters') ? t('Yes') : t('No'),
  );
  $options['inherit_pager'] = array(
    'category' => 'pager',
    'title' => t('Inherit pager'),
    'value' => $this
      ->getOption('inherit_pager') ? t('Yes') : t('No'),
  );
  $options['render_pager'] = array(
    'category' => 'pager',
    'title' => t('Render pager'),
    'value' => $this
      ->getOption('render_pager') ? t('Yes') : t('No'),
  );
}