You are here

cookiebot.install in Cookiebot - Cookie consent, Cookie monitoring and Cookie control 7

Same filename and directory in other branches
  1. 8 cookiebot.install

Contains install, uninstall and update functions for Cookiebot.

File

cookiebot.install
View source
<?php

/**
 * @file
 * Contains install, uninstall and update functions for Cookiebot.
 */

/**
 * Implements hook_uninstall().
 */
function cookiebot_uninstall() {
  db_delete('variable')
    ->condition('name', db_like('cookiebot') . '%', 'LIKE')
    ->execute();
  cache_clear_all('variables', 'cache_bootstrap');
}

/**
 * Update configuration keys.
 */
function cookiebot_update_7001() {

  // Set defaults for new variables
  variable_set('cookiebot_block_cookies', TRUE);
  variable_set('cookiebot_iab_enabled', FALSE);
  variable_set('cookiebot_exclude_paths', '');
  variable_set('cookiebot_exclude_admin_theme', FALSE);
  variable_set('cookiebot_exclude_uid_1', FALSE);
}

/**
 * Add optout marketing placeholder settings. Enable in settings to show placeholder text.
 */
function cookiebot_update_7002() {
  variable_set('cookiebot_message_placeholder_cookieconsent_optout_marketing_show', FALSE);
  $cookiebot_message_placeholder_cookieconsent_optout_marketing_text_default = 'Please <a href="!cookiebot_renew" class="cookieconsent-optout-marketing__cookiebot-renew">accept marketing-cookies</a> to view this embedded content from <a href="!cookiebot_from_src_url" target="_blank" class="cookieconsent-optout-marketing__from-src-url">!cookiebot_from_src_url</a>';
  variable_set('cookiebot_message_placeholder_cookieconsent_optout_marketing', [
    'value' => $cookiebot_message_placeholder_cookieconsent_optout_marketing_text_default,
    'format' => filter_default_format(),
  ]);
}

Functions

Namesort descending Description
cookiebot_uninstall Implements hook_uninstall().
cookiebot_update_7001 Update configuration keys.
cookiebot_update_7002 Add optout marketing placeholder settings. Enable in settings to show placeholder text.