Projet

Général

Profil

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

root / htmltest / sites / all / modules / jquery_update / jquery_update.install @ dc45a079

1
<?php
2

    
3
/**
4
 * @file
5
 * Install file for jQuery Update.
6
 */
7

    
8
/**
9
 * Implementation of 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
 * Implementation of hook_uninstall().
30
 */
31
function jquery_update_uninstall() {
32
  variable_del('jquery_update_compression_type');
33
  variable_del('jquery_update_jquery_version');
34
}
35

    
36
/**
37
 * Update from Drupal 6.
38
 */
39
function jquery_update_update_7000() {
40
  if (variable_get('jquery_update_compression_type', 'min') == 'pack') {
41
    variable_set('jquery_update_compression_type', 'min');
42
  }
43
  variable_del('jquery_update_replace');
44

    
45
  // Restore the default version of jQuery.
46
  variable_del('jquery_update_jquery_version');
47
}