function views_plugin_display_attachment::options_summary

3.x views_plugin_display_attachment.inc views_plugin_display_attachment::options_summary(&$categories, &$options)
2.x views_plugin_display_attachment.inc views_plugin_display_attachment::options_summary(&$categories, &$options)

Provide the summary for attachment options in the views UI.

This output is returned as an array.

Overrides views_plugin_display::options_summary

File

plugins/views_plugin_display_attachment.inc, line 53
Contains the attachment display plugin.

Class

views_plugin_display_attachment
The plugin that handles an attachment display.

Code

function options_summary(&$categories, &$options) {
  // It is very important to call the parent function here:
  parent::options_summary($categories, $options);

  $categories['attachment'] = array(
    'title' => t('Attachment settings'),
  );

  $options['inherit_arguments'] = array(
    'category' => 'attachment',
    'title' => t('Inherit arguments'),
    'value' => $this->get_option('inherit_arguments') ? t('Yes') : t('No'),
  );

  $options['inherit_exposed_filters'] = array(
    'category' => 'attachment',
    'title' => t('Inherit exposed filters'),
    'value' => $this->get_option('inherit_exposed_filters') ? t('Yes') : t('No'),
  );

  $options['inherit_pager'] = array(
    'category' => 'attachment',
    'title' => t('Inherit pager'),
    'value' => $this->get_option('inherit_pager') ? t('Yes') : t('No'),
  );

  $options['render_pager'] = array(
    'category' => 'attachment',
    'title' => t('Render pager'),
    'value' => $this->get_option('render_pager') ? t('Yes') : t('No'),
  );

  $options['attachment_position'] = array(
    'category' => 'attachment',
    'title' => t('Position'),
    'value' => $this->attachment_positions($this->get_option('attachment_position')),
  );

  $displays = array_filter($this->get_option('displays'));
  if (count($displays) > 1) {
    $attach_to = t('Multiple displays');
  }
  else if (count($displays) == 1) {
    $display = array_shift($displays);
    if (!empty($this->view->display[$display])) {
      $attach_to = check_plain($this->view->display[$display]->display_title);
    }
  }

  if (!isset($attach_to)) {
    $attach_to = t('None');
  }

  $options['displays'] = array(
    'category' => 'attachment',
    'title' => t('Attach to'),
    'value' => $attach_to,
  );
}