function views_plugin_display_attachment::options_summary
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 67
Class
- views_plugin_display_attachment
- The plugin that handles an attachment display.
Code
public 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'),
'column' => 'second',
'build' => array(
'#weight' => -10,
),
);
$displays = array_filter($this->get_option('displays'));
if (count($displays) > 1) {
$attach_to = t('Multiple displays');
}
elseif (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('Not defined');
}
$options['show_title'] = array(
'category' => 'title',
'title' => t('Show title'),
'value' => $this->get_option('show_title') ? t('Yes') : t('No'),
);
$options['show_title_empty'] = array(
'category' => 'title',
'title' => t('Show title even if view has no results'),
'value' => $this->get_option('show_title_empty') ? t('Yes') : t('No'),
);
$options['displays'] = array(
'category' => 'attachment',
'title' => t('Attach to'),
'value' => $attach_to,
);
$options['attachment_position'] = array(
'category' => 'attachment',
'title' => t('Attachment position'),
'value' => $this->attachment_positions($this->get_option('attachment_position')),
);
$options['inherit_arguments'] = array(
'category' => 'attachment',
'title' => t('Inherit contextual filters'),
'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' => 'pager',
'title' => t('Inherit pager'),
'value' => $this->get_option('inherit_pager') ? t('Yes') : t('No'),
);
$options['render_pager'] = array(
'category' => 'pager',
'title' => t('Render pager'),
'value' => $this->get_option('render_pager') ? t('Yes') : t('No'),
);
}