jquery_update.install 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * @file
  4. * Install file for jQuery Update.
  5. */
  6. /**
  7. * Implements 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 (<a href="@link">configure</a>) and jQuery UI %ui', array('%jquery' => $jquery['version'], '%ui' => $ui['version'], '@link' => url('admin/config/development/jquery_update'))),
  19. );
  20. }
  21. return $requirements;
  22. }
  23. /**
  24. * Implements hook_uninstall().
  25. */
  26. function jquery_update_uninstall() {
  27. variable_del('jquery_update_compression_type');
  28. variable_del('jquery_update_jquery_version');
  29. variable_del('jquery_update_jquery_admin_version');
  30. variable_del('jquery_update_jquery_cdn');
  31. }
  32. /**
  33. * Update from Drupal 6.
  34. */
  35. function jquery_update_update_7000() {
  36. if (variable_get('jquery_update_compression_type', 'min') == 'pack') {
  37. variable_set('jquery_update_compression_type', 'min');
  38. }
  39. variable_del('jquery_update_replace');
  40. // Restore the default version of jQuery.
  41. variable_del('jquery_update_jquery_version');
  42. }