Projet

Général

Profil

Paste
Télécharger (1,19 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / jquery_update / jquery_update.install @ 503b3f7b

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 and jQuery UI %ui', array('%jquery' => $jquery['version'], '%ui' => $ui['version'])),
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
}