You are here

public function MobileDeviceDetectionExtenderPlugin::optionsSummary in Mobile Device Detection 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/views/display_extender/MobileDeviceDetectionExtenderPlugin.php \Drupal\mobile_device_detection\Plugin\views\display_extender\MobileDeviceDetectionExtenderPlugin::optionsSummary()
  2. 8 src/Plugin/views/display_extender/MobileDeviceDetectionExtenderPlugin.php \Drupal\mobile_device_detection\Plugin\views\display_extender\MobileDeviceDetectionExtenderPlugin::optionsSummary()

Provide the default summary for options and category in the views UI.

Overrides DisplayExtenderPluginBase::optionsSummary

File

src/Plugin/views/display_extender/MobileDeviceDetectionExtenderPlugin.php, line 37

Class

MobileDeviceDetectionExtenderPlugin
Default display extender plugin; does nothing.

Namespace

Drupal\mobile_device_detection\Plugin\views\display_extender

Code

public function optionsSummary(&$categories, &$options) {
  $categories['device_detection'] = [
    'title' => $this
      ->t('Show "View" on special devices'),
    'column' => 'second',
  ];
  $options['device_detection'] = [
    'category' => 'other',
    'title' => $this
      ->t('Show "View" on special devices'),
    'value' => $this
      ->getDevices() ? implode(', ', $this
      ->getDevices()) : $this
      ->t('none'),
  ];
}