colorbox_library_test.module 494 B

123456789101112131415161718192021
  1. <?php
  2. /**
  3. * @file
  4. * Test specific changes for the colorbox library test.
  5. */
  6. use Drupal\Core\Site\Settings;
  7. /**
  8. * Implements hook_library_alter().
  9. */
  10. function colorbox_library_test_library_info_alter(&$libraries, $extension) {
  11. if ($extension !== 'colorbox') {
  12. return;
  13. }
  14. foreach ($libraries['colorbox']['js'] as $key => $library) {
  15. $libraries['colorbox']['js']['/' . Settings::get('file_public_path') . $key] = $library;
  16. unset($libraries['colorbox']['js'][$key]);
  17. }
  18. }