You are here

public function UltimenuManager::getUltimenuBlocks in Ultimenu 8

Same name and namespace in other branches
  1. 8.2 src/UltimenuManager.php \Drupal\ultimenu\UltimenuManager::getUltimenuBlocks()

Returns the Ultimenu blocks.

Return value

array The blocks.

Overrides UltimenuManagerInterface::getUltimenuBlocks

File

src/UltimenuManager.php, line 211

Class

UltimenuManager
Manages Ultimenu plugin.

Namespace

Drupal\ultimenu

Code

public function getUltimenuBlocks() {
  if (!isset($this->menuBlocks)) {
    $this->menuBlocks = [];
    $menus = $this
      ->getMenus();
    foreach ($menus as $delta => $name) {
      if ($this
        ->getEnabledBlocks($delta)) {
        $this->menuBlocks[$delta] = $this
          ->t('@name', [
          '@name' => $name,
        ]);
      }
    }
    asort($this->menuBlocks);
  }
  return $this->menuBlocks;
}