function Page::optionsSummary

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/display/Page.php \Drupal\views\Plugin\views\display\Page::optionsSummary()
  2. 10 core/modules/views/src/Plugin/views/display/Page.php \Drupal\views\Plugin\views\display\Page::optionsSummary()
  3. 11.x core/modules/views/src/Plugin/views/display/Page.php \Drupal\views\Plugin\views\display\Page::optionsSummary()

Overrides PathPluginBase::optionsSummary

File

core/modules/views/src/Plugin/views/display/Page.php, line 200

Class

Page
The plugin that handles a full page.

Namespace

Drupal\views\Plugin\views\display

Code

public function optionsSummary(&$categories, &$options) {
    parent::optionsSummary($categories, $options);
    $menu = $this->getOption('menu');
    if (!is_array($menu)) {
        $menu = [
            'type' => 'none',
        ];
    }
    switch ($menu['type']) {
        case 'none':
        default:
            $menu_str = $this->t('No menu');
            break;
        case 'normal':
            $menu_str = $this->t('Normal: @title', [
                '@title' => $menu['title'],
            ]);
            break;
        case 'tab':
        case 'default tab':
            $menu_str = $this->t('Tab: @title', [
                '@title' => $menu['title'],
            ]);
            break;
    }
    $options['menu'] = [
        'category' => 'page',
        'title' => $this->t('Menu'),
        'value' => views_ui_truncate($menu_str, 24),
    ];
    // This adds a 'Settings' link to the style_options setting if the style
    // has options.
    if ($menu['type'] == 'default tab') {
        $options['menu']['setting'] = $this->t('Parent menu item');
        $options['menu']['links']['tab_options'] = $this->t('Change settings for the parent menu');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.