Advertisement
Guest User

Untitled

a guest
Nov 12th, 2015
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.33 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * @file
  5.  * Install file for jQuery Update.
  6.  */
  7.  
  8. /**
  9.  * Implements hook_requirements().
  10.  */
  11. function jquery_update_requirements($phase) {
  12.   $requirements = array();
  13.  
  14.   if ($phase == 'runtime') {
  15.     $t = get_t();
  16.     $jquery = drupal_get_library('system', 'jquery');
  17.     $ui = drupal_get_library('system', 'ui');
  18.     $requirements['jquery_update'] = array(
  19.       'title' => $t('jQuery Update'),
  20.       'severity' => REQUIREMENT_OK,
  21.       'value' => t('jQuery %jquery (<a href="@link">configure</a>) and jQuery UI %ui', array('%jquery' => $jquery['version'], '%ui' => $ui['version'], '@link' => url('admin/config/development/jquery_update'))),
  22.     );
  23.   }
  24.  
  25.   return $requirements;
  26. }
  27.  
  28. /**
  29.  * Implements hook_uninstall().
  30.  */
  31. function jquery_update_uninstall() {
  32.   variable_del('jquery_update_compression_type');
  33.   variable_del('jquery_update_jquery_version');
  34.   variable_del('jquery_update_jquery_admin_version');
  35.   variable_del('jquery_update_jquery_cdn');
  36. }
  37.  
  38. /**
  39.  * Update from Drupal 6.
  40.  */
  41. function jquery_update_update_7000() {
  42.   if (variable_get('jquery_update_compression_type', 'min') == 'pack') {
  43.     variable_set('jquery_update_compression_type', 'min');
  44.   }
  45.   variable_del('jquery_update_replace');
  46.  
  47.   // Restore the default version of jQuery.
  48.   variable_del('jquery_update_jquery_version');
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement