You are here

function vendor_stream_wrapper_library_info_alter in Vendor Stream Wrapper 8

Implements hook_library_info_alter().

File

./vendor_stream_wrapper.module, line 14
Holds hooks and API functions for the Vendor Stream Wrapper module.

Code

function vendor_stream_wrapper_library_info_alter(&$libraries, $extension) {
  foreach ($libraries as $library_key => $library) {
    if (isset($library['js'])) {
      foreach (array_keys($library['js']) as $path) {
        if (strpos($path, 'vendor://') === 0) {
          $libraries[$library_key]['js'][vendor_stream_wrapper_create_url($path)] = $library['js'][$path];
          unset($libraries[$library_key]['js'][$path]);
        }
      }
    }
    if (isset($library['css'])) {
      foreach (array_keys($library['css']) as $css_level) {
        foreach (array_keys($library['css'][$css_level]) as $path) {
          if (strpos($path, 'vendor://') === 0) {
            $libraries[$library_key]['css'][$css_level][vendor_stream_wrapper_create_url($path)] = $library['css'][$css_level][$path];
            unset($libraries[$library_key]['css'][$css_level][$path]);
          }
        }
      }
    }
  }
}