You are here

function ultimenu_library_info_build in Ultimenu 8

Same name and namespace in other branches
  1. 8.2 ultimenu.module \ultimenu_library_info_build()

Implements hook_library_info_build().

File

./ultimenu.module, line 24
Build Ultimenu blocks based on menu, and their regions on enabled menu items.

Code

function ultimenu_library_info_build() {
  $libraries = [];
  $ultimenu = \Drupal::service('ultimenu.manager');
  foreach ($ultimenu
    ->getSkins() as $key => $skin) {
    $skin_css_path = $ultimenu
      ->getSkinPath($key);
    $skin_basename = $ultimenu
      ->getSkinName($skin_css_path);
    $libraries['ultimenu.skin.' . $skin_basename] = [
      'dependencies' => [
        'ultimenu/ultimenu',
      ],
      'css' => [
        'theme' => [
          $skin_css_path => [],
        ],
      ],
    ];
  }
  return $libraries;
}