You are here

function toolbar_anti_flicker_replace_library in Toolbar Anti-flicker 8.3

Same name and namespace in other branches
  1. 8.2 toolbar_anti_flicker.module \toolbar_anti_flicker_replace_library()
  2. 9.3.x toolbar_anti_flicker.module \toolbar_anti_flicker_replace_library()

In-place a library.

Parameters

$target_library:

$key:

$replacement:

1 call to toolbar_anti_flicker_replace_library()
toolbar_anti_flicker_library_info_alter in ./toolbar_anti_flicker.module
Implements hook_library_info_alter().

File

./toolbar_anti_flicker.module, line 105

Code

function toolbar_anti_flicker_replace_library(array &$target_library, $key, array $replacement) {
  $key_pos = array_search($key, array_keys($target_library));
  if ($key_pos !== false) {
    $key_pos++;
    $second_array = array_splice($target_library, $key_pos);
    $target_library = array_merge($target_library, $replacement, $second_array);
    unset($target_library[$key]);
  }
}