You are here

public function UltimenuManager::parseThemeInfo in Ultimenu 8

Returns the default theme Ultimenu regions from theme .info.yml.

Return value

array The Ultimenu regions.

Overrides UltimenuManagerInterface::parseThemeInfo

1 call to UltimenuManager::parseThemeInfo()
UltimenuManager::removeRegions in src/UltimenuManager.php
Returns unwanted Ultimenu regions for removal from theme .info.yml.

File

src/UltimenuManager.php, line 557

Class

UltimenuManager
Manages Ultimenu plugin.

Namespace

Drupal\ultimenu

Code

public function parseThemeInfo() {
  if (!isset($this->themeRegions)) {
    $theme = $this
      ->getConfig('system.theme')
      ->get('default');
    $file = drupal_get_path('theme', $theme) . '/' . $theme . '.info.yml';

    // Parse theme .info.yml file.
    $info = \Drupal::service('info_parser')
      ->parse($file);
    $this->themeRegions = [];
    foreach ($info['regions'] as $key => $region) {
      if (array_key_exists($key, $this
        ->getRegions())) {
        $this->themeRegions[$key] = $region;
      }
    }
  }
  return $this->themeRegions;
}