annotate vendor/chi-teck/drupal-code-generator/templates/d7/hook/library_alter.twig @ 5:12f9dff5fda9
tip
Update to Drupal core 8.7.1
author |
Chris Cannam |
date |
Thu, 09 May 2019 15:34:47 +0100 |
parents |
c75dbcec494b |
children |
|
rev |
line source |
Chris@0
|
1 /**
|
Chris@0
|
2 * Implements hook_library_alter().
|
Chris@0
|
3 */
|
Chris@0
|
4 function {{ machine_name }}_library_alter(&$libraries, $module) {
|
Chris@0
|
5 // Update Farbtastic to version 2.0.
|
Chris@0
|
6 if ($module == 'system' && isset($libraries['farbtastic'])) {
|
Chris@0
|
7 // Verify existing version is older than the one we are updating to.
|
Chris@0
|
8 if (version_compare($libraries['farbtastic']['version'], '2.0', '<')) {
|
Chris@0
|
9 // Update the existing Farbtastic to version 2.0.
|
Chris@0
|
10 $libraries['farbtastic']['version'] = '2.0';
|
Chris@0
|
11 $libraries['farbtastic']['js'] = array(
|
Chris@0
|
12 drupal_get_path('module', 'farbtastic_update') . '/farbtastic-2.0.js' => array(),
|
Chris@0
|
13 );
|
Chris@0
|
14 }
|
Chris@0
|
15 }
|
Chris@0
|
16 }
|