You are here

function eu_cookie_compliance_update_7000 in EU Cookie Compliance (GDPR Compliance) 7

Same name and namespace in other branches
  1. 7.2 eu_cookie_compliance.install \eu_cookie_compliance_update_7000()

Change the banner sliding animation time from seconds to milliseconds.

File

./eu_cookie_compliance.install, line 232
Installation file.

Code

function eu_cookie_compliance_update_7000(&$sandbox = NULL) {
  global $language;
  if (module_exists('locale')) {
    $languages = locale_language_list();
    foreach ($languages as $key => $current_language) {
      $eu_cookie_settings = variable_get('eu_cookie_compliance_' . $key, array());
      if (!empty($eu_cookie_settings['popup_delay'])) {
        $eu_cookie_settings['popup_delay'] *= 1000;
        variable_set('eu_cookie_compliance_' . $key, $eu_cookie_settings);
      }
    }
  }
  else {
    $current_language = $language->language ? $language->language : 'en';
    $eu_cookie_settings = variable_get('eu_cookie_compliance_' . $current_language, array());
    if (!empty($eu_cookie_settings['popup_delay'])) {
      $eu_cookie_settings['popup_delay'] *= 1000;
      variable_set('eu_cookie_compliance_' . $current_language, $eu_cookie_settings);
    }
  }
}