You are here

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

Retrieve enabled blocks.

Return value

array An array with all additional blocks, keys are the machine_names and the values the block titles.

1 call to MefibsDisplayExtender::getEnabledBlocks()
MefibsDisplayExtender::optionsSummary in lib/Drupal/mefibs/Plugin/views/display_extender/MefibsDisplayExtender.php
Overrides Drupal\views\Plugin\views\display\DisplayPluginBase::optionsSummary().

File

lib/Drupal/mefibs/Plugin/views/display_extender/MefibsDisplayExtender.php, line 34
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 getEnabledBlocks() {
  $blocks = array();
  $settings = $this->displayHandler
    ->getOption('mefibs');
  if (!isset($settings['blocks']) || !count($settings['blocks'])) {
    return array();
  }
  foreach ($settings['blocks'] as $block) {
    $blocks[$block['machine_name']] = $block['name'];
  }
  return $blocks;
}