You are here

public function Page::optionsSummary in Views (for Drupal 7) 8.3

Provide the summary for page options in the views UI.

This output is returned as an array.

Overrides DisplayPluginBase::optionsSummary

1 call to Page::optionsSummary()
Feed::optionsSummary in lib/Drupal/views/Plugin/views/display/Feed.php
Provide the summary for page options in the views UI.
1 method overrides Page::optionsSummary()
Feed::optionsSummary in lib/Drupal/views/Plugin/views/display/Feed.php
Provide the summary for page options in the views UI.

File

lib/Drupal/views/Plugin/views/display/Page.php, line 267
Definition of Drupal\views\Plugin\views\display\Page.

Class

Page
The plugin that handles a full page.

Namespace

Drupal\views\Plugin\views\display

Code

public function optionsSummary(&$categories, &$options) {

  // It is very important to call the parent function here:
  parent::optionsSummary($categories, $options);
  $categories['page'] = array(
    'title' => t('Page settings'),
    'column' => 'second',
    'build' => array(
      '#weight' => -10,
    ),
  );
  $path = strip_tags('/' . $this
    ->getOption('path'));
  if (empty($path)) {
    $path = t('None');
  }
  $options['path'] = array(
    'category' => 'page',
    'title' => t('Path'),
    'value' => views_ui_truncate($path, 24),
  );
  $menu = $this
    ->getOption('menu');
  if (!is_array($menu)) {
    $menu = array(
      'type' => 'none',
    );
  }
  switch ($menu['type']) {
    case 'none':
    default:
      $menu_str = t('No menu');
      break;
    case 'normal':
      $menu_str = t('Normal: @title', array(
        '@title' => $menu['title'],
      ));
      break;
    case 'tab':
    case 'default tab':
      $menu_str = t('Tab: @title', array(
        '@title' => $menu['title'],
      ));
      break;
  }
  $options['menu'] = array(
    'category' => 'page',
    'title' => 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'] = t('Parent menu item');
    $options['menu']['links']['tab_options'] = t('Change settings for the parent menu');
  }
}