You are here

function views_plugin_display_page::options_summary in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 6.2 plugins/views_plugin_display_page.inc \views_plugin_display_page::options_summary()
  2. 7.3 plugins/views_plugin_display_page.inc \views_plugin_display_page::options_summary()

Provide the summary for page options in the views UI.

This output is returned as an array.

Overrides views_plugin_display::options_summary

1 call to views_plugin_display_page::options_summary()
views_plugin_display_feed::options_summary in plugins/views_plugin_display_feed.inc
Provide the summary for page options in the views UI.
1 method overrides views_plugin_display_page::options_summary()
views_plugin_display_feed::options_summary in plugins/views_plugin_display_feed.inc
Provide the summary for page options in the views UI.

File

plugins/views_plugin_display_page.inc, line 228
Contains the page display plugin.

Class

views_plugin_display_page
The plugin that handles a full page.

Code

function options_summary(&$categories, &$options) {

  // It is very important to call the parent function here:
  parent::options_summary($categories, $options);
  $categories['page'] = array(
    'title' => t('Page settings'),
  );
  $path = strip_tags($this
    ->get_option('path'));
  if (empty($path)) {
    $path = t('None');
  }
  if (strlen($path) > 16) {
    $path = substr($path, 0, 16) . '...';
  }
  $options['path'] = array(
    'category' => 'page',
    'title' => t('Path'),
    'value' => $path,
  );
  $menu = $this
    ->get_option('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;
  }
  if (strlen($menu_str) > 16) {
    $menu_str = substr($menu_str, 0, 16) . '...';
  }
  $options['menu'] = array(
    'category' => 'page',
    'title' => t('Menu'),
    'value' => $menu_str,
  );

  // This adds a 'Settings' link to the style_options setting if the style has options.
  if ($menu['type'] == 'default tab') {
    $options['menu']['links']['tab_options'] = t('Change settings for the parent menu');
  }
}