You are here

public function MefibsDisplayExtender::optionsSummary in MEFIBS - More exposed forms in blocks 8

Overrides Drupal\views\Plugin\views\display\DisplayPluginBase::optionsSummary().

Overrides DisplayExtenderPluginBase::optionsSummary

File

lib/Drupal/mefibs/Plugin/views/display_extender/MefibsDisplayExtender.php, line 318
Contains \Drupal\mefibs\Plugin\views\display_extender\MefibsDisplayExtender.

Class

MefibsDisplayExtender
Plugin annotation @ViewsDisplayExtender( id = "mefibs", title = @Translation("Mefibs"), help = @Translation("Provides additional exposed filter blocks for this view."), no_ui = FALSE )

Namespace

Drupal\mefibs\Plugin\views\display_extender

Code

public function optionsSummary(&$categories, &$options) {
  parent::optionsSummary($categories, $options);
  if ($this->displayHandler
    ->getOption('exposed_block')) {
    $value = t('Default');
    $blocks = $this
      ->getEnabledBlocks();
    if (count($blocks)) {
      $value = t('Default + !count', array(
        '!count' => count($blocks),
      ));
    }
    $options['mefibs'] = array(
      'category' => 'exposed',
      'title' => t('Exposed form blocks'),
      'value' => $value,
      'desc' => t('Control which blocks can be used for exposed forms.'),
    );
  }
}