jquery_update.install 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * @file
  4. * Install file for jQuery Update.
  5. */
  6. /**
  7. * Implementation of hook_requirements().
  8. */
  9. function jquery_update_requirements($phase) {
  10. $requirements = array();
  11. if ($phase == 'runtime') {
  12. $t = get_t();
  13. $jquery = drupal_get_library('system', 'jquery');
  14. $ui = drupal_get_library('system', 'ui');
  15. $requirements['jquery_update'] = array(
  16. 'title' => $t('jQuery Update'),
  17. 'severity' => REQUIREMENT_OK,
  18. 'value' => t('jQuery %jquery and jQuery UI %ui', array('%jquery' => $jquery['version'], '%ui' => $ui['version'])),
  19. );
  20. }
  21. return $requirements;
  22. }
  23. /**
  24. * Implementation of hook_uninstall().
  25. */
  26. function jquery_update_uninstall() {
  27. variable_del('jquery_update_compression_type');
  28. variable_del('jquery_update_jquery_version');
  29. }
  30. /**
  31. * Update from Drupal 6.
  32. */
  33. function jquery_update_update_7000() {
  34. if (variable_get('jquery_update_compression_type', 'min') == 'pack') {
  35. variable_set('jquery_update_compression_type', 'min');
  36. }
  37. variable_del('jquery_update_replace');
  38. // Restore the default version of jQuery.
  39. variable_del('jquery_update_jquery_version');
  40. }