本文整理汇总了PHP中Drupal\views\Plugin\views\display\DisplayPluginBase::optionsSummary方法的典型用法代码示例。如果您正苦于以下问题:PHP DisplayPluginBase::optionsSummary方法的具体用法?PHP DisplayPluginBase::optionsSummary怎么用?PHP DisplayPluginBase::optionsSummary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\views\Plugin\views\display\DisplayPluginBase
的用法示例。
在下文中一共展示了DisplayPluginBase::optionsSummary方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: optionsSummary
/**
* {@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));
}
示例2: optionsSummary
/**
* 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'));
}
示例3: optionsSummary
/**
* 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'));
}
示例4: optionsSummary
/**
* 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));
}
示例5: optionsSummary
/**
* 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']);
}