Project

General

Profile

Revision 2c8c2b87

Added by Assos Assos about 9 years ago

Weekly update of contrib modules

View differences:

drupal7/sites/all/modules/addthis/addthis.install
1 1
<?php
2

  
3 2
/**
4 3
 * @file
5 4
 * Install, update and uninstall functions for the AddThis module.
......
44 43
  variable_del(AddThis::CUSTOM_CONFIGURATION_CODE_ENABLED_KEY);
45 44
  variable_del(AddThis::CUSTOM_CONFIGURATION_CODE_KEY);
46 45
  variable_del(AddThis::ENABLED_SERVICES_KEY);
46
  variable_del(AddThis::EXCLUDED_SERVICES_KEY);
47 47
  variable_del(AddThis::OPEN_WINDOWS_ENABLED_KEY);
48 48
  variable_del(AddThis::PROFILE_ID_KEY);
49 49
  variable_del(AddThis::SERVICES_CSS_URL_KEY);
......
53 53
  variable_del(AddThis::UI_HEADER_BACKGROUND_COLOR_KEY);
54 54
  variable_del(AddThis::UI_HEADER_COLOR_KEY);
55 55
  variable_del(AddThis::WIDGET_JS_URL_KEY);
56
  variable_del(AddThis::WIDGET_JS_LOAD_TYPE);
56
  variable_del(AddThis::WIDGET_JS_LOAD_DOMREADY);
57
  variable_del(AddThis::WIDGET_JS_LOAD_ASYNC);
57 58
}
58 59

  
59 60
/**
......
62 63
function addthis_update_7401() {
63 64
  variable_del('addthis_widget_async');
64 65
}
66

  
67
/**
68
 * Remove old addthis_widget_load_type and transform it into new values.
69
 *
70
 * Transform variable in settings for domready and async.
71
 * If value = async set domready TRUE and async TRUE.
72
 * If value = domready set domready TRUE and async FALSE.
73
 * If value = include set domready FALSE and async FALSE.
74
 */
75
function addthis_update_7402() {
76
  $load_type = variable_get('addthis_widget_load_type', NULL);
77

  
78
  switch ($load_type) {
79
    case 'async':
80
      variable_set(AddThis::WIDGET_JS_LOAD_DOMREADY, TRUE);
81
      variable_set(AddThis::WIDGET_JS_LOAD_ASYNC, TRUE);
82
      break;
83
    case 'domready':
84
      variable_set(AddThis::WIDGET_JS_LOAD_DOMREADY, TRUE);
85
      variable_set(AddThis::WIDGET_JS_LOAD_ASYNC, FALSE);
86
      break;
87
    case 'include':
88
      variable_set(AddThis::WIDGET_JS_LOAD_DOMREADY, FALSE);
89
      variable_set(AddThis::WIDGET_JS_LOAD_ASYNC, FALSE);
90
      break;
91
    default:
92
      variable_set(AddThis::WIDGET_JS_LOAD_DOMREADY, TRUE);
93
      variable_set(AddThis::WIDGET_JS_LOAD_ASYNC, FALSE);
94
      break;
95
  }
96

  
97
  variable_del('addthis_widget_load_type');
98
}

Also available in: Unified diff