You are here

public function RestExport::optionsSummary in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/rest/src/Plugin/views/display/RestExport.php \Drupal\rest\Plugin\views\display\RestExport::optionsSummary()
  2. 9 core/modules/rest/src/Plugin/views/display/RestExport.php \Drupal\rest\Plugin\views\display\RestExport::optionsSummary()

Provides the default summary for options in the views UI.

This output is returned as an array.

Overrides PathPluginBase::optionsSummary

File

core/modules/rest/src/Plugin/views/display/RestExport.php, line 276

Class

RestExport
The plugin that handles Data response callbacks for REST resources.

Namespace

Drupal\rest\Plugin\views\display

Code

public function optionsSummary(&$categories, &$options) {
  parent::optionsSummary($categories, $options);

  // Authentication.
  $auth = $this
    ->getOption('auth') ? implode(', ', $this
    ->getOption('auth')) : $this
    ->t('No authentication is set');
  unset($categories['page'], $categories['exposed']);

  // Hide some settings, as they aren't useful for pure data output.
  unset($options['show_admin_links'], $options['analyze-theme']);
  $categories['path'] = [
    'title' => $this
      ->t('Path settings'),
    'column' => 'second',
    'build' => [
      '#weight' => -10,
    ],
  ];
  $options['path']['category'] = 'path';
  $options['path']['title'] = $this
    ->t('Path');
  $options['auth'] = [
    'category' => 'path',
    'title' => $this
      ->t('Authentication'),
    'value' => views_ui_truncate($auth, 24),
  ];

  // Remove css/exposed form settings, as they are not used for the data
  // display.
  unset($options['exposed_form']);
  unset($options['exposed_block']);
  unset($options['css_class']);
}