Projet

Général

Profil

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

root / drupal7 / sites / all / modules / addthis / addthis.install @ 87dbc3bf

1
<?php
2

    
3
/**
4
 * @file
5
 * Install, update and uninstall functions for the AddThis module.
6
 */
7

    
8
// We need some constant values from the AddThis class.
9
include_once('classes/AddThis.php');
10

    
11
/**
12
 * Implements hook_field_schema().
13
 */
14
function addthis_field_schema($field) {
15
  $schema = array();
16
  if ($field['type'] == AddThis::FIELD_TYPE) {
17
    $columns = array(
18
      'value' => array(
19
        'type' => 'varchar',
20
        'length' => $field['settings']['max_length'],
21
        'not null' => FALSE,
22
      ),
23
    );
24
    $schema = array(
25
      'columns' => $columns,
26
      'indexes' => array(),
27
      'foreign keys' => array(),
28
    );
29
  }
30
  return $schema;
31
}
32

    
33
/**
34
 * Implements hook_uninstall().
35
 */
36
function addthis_uninstall() {
37
  variable_del(AddThis::ADDRESSBOOK_ENABLED_KEY);
38
  variable_del(AddThis::BLOCK_WIDGET_TYPE_KEY);
39
  variable_del(AddThis::BOOKMARK_URL_KEY);
40
  variable_del(AddThis::CLICKBACK_TRACKING_ENABLED_KEY);
41
  variable_del(AddThis::CLICK_TO_OPEN_COMPACT_MENU_ENABLED_KEY);
42
  variable_del(AddThis::CO_BRAND_KEY);
43
  variable_del(AddThis::COMPLIANT_508_KEY);
44
  variable_del(AddThis::CUSTOM_CONFIGURATION_CODE_ENABLED_KEY);
45
  variable_del(AddThis::CUSTOM_CONFIGURATION_CODE_KEY);
46
  variable_del(AddThis::ENABLED_SERVICES_KEY);
47
  variable_del(AddThis::OPEN_WINDOWS_ENABLED_KEY);
48
  variable_del(AddThis::PROFILE_ID_KEY);
49
  variable_del(AddThis::SERVICES_CSS_URL_KEY);
50
  variable_del(AddThis::SERVICES_JSON_URL_KEY);
51
  variable_del(AddThis::STANDARD_CSS_ENABLED_KEY);
52
  variable_del(AddThis::UI_DELAY_KEY);
53
  variable_del(AddThis::UI_HEADER_BACKGROUND_COLOR_KEY);
54
  variable_del(AddThis::UI_HEADER_COLOR_KEY);
55
  variable_del(AddThis::WIDGET_JS_URL_KEY);
56
  variable_del(AddThis::WIDGET_JS_LOAD_TYPE);
57
}
58

    
59
/**
60
 * Remove old WIDGET_JS_ASYNC variable.
61
 */
62
function addthis_update_7401() {
63
  variable_del('addthis_widget_async');
64
}