You are here

function _navbar_libraries_get_preferred_variant_name in Navbar 7

Returns the variant that should be loaded based on order preference.

Parameters

array $library: A libraries module library definition array.

Return value

string The name of the variant that should be loaded.

2 calls to _navbar_libraries_get_preferred_variant_name()
navbar_requirements in ./navbar.install
Implements hook_requirements().
_navbar_convert_libraries_to_library in ./navbar.module
Converts a libraries module array to a hook_library array.

File

./navbar.module, line 1160
Administration navbar for quick access to top level administration items.

Code

function _navbar_libraries_get_preferred_variant_name($library) {
  if (!empty($library['variant order'])) {
    foreach ($library['variant order'] as $name) {
      if ($variant = $library['variants'][$name]) {
        if ($variant['installed']) {
          return $name;
        }
      }
    }
  }
  return NULL;
}