/** * {@inheritdoc} */ public function optionsSummary(&$categories, &$options) { parent::optionsSummary($categories, $options); $categories['display_test'] = array('title' => $this->t('Display test settings'), 'column' => 'second', 'build' => array('#weight' => -100)); $test_option = $this->getOption('test_option') ?: $this->t('Empty'); $options['test_option'] = array('category' => 'display_test', 'title' => $this->t('Test option'), 'value' => views_ui_truncate($test_option, 24)); }
/** * Provide the summary for attachment options in the views UI. * * This output is returned as an array. */ 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 = String::checkPlain($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')); }
/** * Provide the summary for page options in the views UI. * * This output is returned as an array. */ public function optionsSummary(&$categories, &$options) { parent::optionsSummary($categories, $options); $categories['block'] = array('title' => $this->t('Block settings'), 'column' => 'second', 'build' => array('#weight' => -10)); $block_description = strip_tags($this->getOption('block_description')); if (empty($block_description)) { $block_description = $this->t('None'); } $block_category = $this->getOption('block_category'); $options['block_description'] = array('category' => 'block', 'title' => $this->t('Block name'), 'value' => views_ui_truncate($block_description, 24)); $options['block_category'] = array('category' => 'block', 'title' => $this->t('Block category'), 'value' => views_ui_truncate($block_category, 24)); $filtered_allow = array_filter($this->getOption('allow')); $options['allow'] = array('category' => 'block', 'title' => $this->t('Allow settings'), 'value' => empty($filtered_allow) ? $this->t('None') : $this->t('Items per page')); $options['block_hide_empty'] = array('category' => 'other', 'title' => $this->t('Hide block if the view output is empty'), 'value' => $this->getOption('block_hide_empty') ? $this->t('Yes') : $this->t('No')); }
/** * Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::optionsSummary(). */ public function optionsSummary(&$categories, &$options) { parent::optionsSummary($categories, $options); $categories['page'] = array('title' => $this->t('Page settings'), 'column' => 'second', 'build' => array('#weight' => -10)); $path = strip_tags($this->getOption('path')); if (empty($path)) { $path = $this->t('No path is set'); } else { $path = '/' . $path; } $options['path'] = array('category' => 'page', 'title' => $this->t('Path'), 'value' => views_ui_truncate($path, 24)); }
/** * Overrides \Drupal\views\Plugin\views\display\DisplayPluginBase::optionsSummary(). * * Disable 'cache' and 'title' so it won't be changed. */ public function optionsSummary(&$categories, &$options) { parent::optionsSummary($categories, $options); unset($options['query']); unset($options['title']); }