You are here

simple_cookie_compliance.install in Simple Cookie Compliance 7

Same filename and directory in other branches
  1. 6 simple_cookie_compliance.install

Contains the install functions for the module.

File

simple_cookie_compliance.install
View source
<?php

/**
 * @file
 * Contains the install functions for the module.
 */

/**
 * Implements hook_uninstall().
 */
function simple_cookie_compliance_uninstall() {
  db_delete('variable')
    ->condition('name', db_like('simple_cookie_compliance_') . '%', 'LIKE')
    ->execute();
}

/**
 * Changes the database values of cookie content so they work with text_format filters.
 */
function simple_cookie_compliance_update_7100() {
  $result = db_select('variable', 'v')
    ->fields('v')
    ->condition('name', db_like('simple_cookie_compliance_content') . '%', 'LIKE')
    ->execute()
    ->fetchAll();
  foreach ($result as $row) {
    $str = unserialize($row->value);
    $arr = array(
      'value' => $str,
      'format' => 'full_html',
    );
    db_update('variable')
      ->fields(array(
      'value' => serialize($arr),
    ))
      ->condition('name', $row->name)
      ->execute();
  }
  return;
}

Functions

Namesort descending Description
simple_cookie_compliance_uninstall Implements hook_uninstall().
simple_cookie_compliance_update_7100 Changes the database values of cookie content so they work with text_format filters.