You are here

function eu_cookie_compliance_update_7008 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_7008()

Add config variables for the withdraw banner.

File

./eu_cookie_compliance.install, line 421
Installation file.

Code

function eu_cookie_compliance_update_7008() {
  $default_filter_format = filter_default_format();
  if ($default_filter_format === 'filtered_html' && filter_format_load('full_html')) {
    $default_filter_format = 'full_html';
  }
  $eu_cookie_settings = variable_get('eu_cookie_compliance', array());
  $eu_cookie_settings['withdraw_message'] = array(
    'value' => '<h2>We use cookies on this site to enhance your user experience</h2><p>You have given your consent for us to set cookies.</p>',
    'format' => $default_filter_format,
  );
  $eu_cookie_settings['withdraw_action_button_label'] = 'Withdraw consent';
  $eu_cookie_settings['withdraw_tab_button_label'] = 'Privacy settings';
  $eu_cookie_settings['withdraw_enabled'] = 0;

  // Set default info template to 'legacy' for 'consent by default' config
  // option.
  if (!array_key_exists('info_template', $eu_cookie_settings)) {
    $eu_cookie_settings['info_template'] = 'legacy';
  }
  variable_set('eu_cookie_compliance', $eu_cookie_settings);
}