You are here

high_contrast.install in High contrast 7

Same filename and directory in other branches
  1. 8 high_contrast.install
  2. 6 high_contrast.install

Install, update, and uninstall functions for the High Contrast module.

File

high_contrast.install
View source
<?php

/**
 * @file
 * Install, update, and uninstall functions for the High Contrast module.
 */

/**
 * Implements hook_install().
 */
function high_contrast_install() {

  // Set variables.
  variable_set("high_contrast_switcher_widget", "links");
  variable_set("high_contrast_switcher_label", "Contrast:");
  variable_set("high_contrast_high_label", "High");
  variable_set("high_contrast_separator", "|");
  variable_set("high_contrast_normal_label", "Normal");
  variable_set("high_contrast_css_styles", _high_contrast_get_default_css_styles());
}

/**
 * Implements hook_uninstall().
 */
function high_contrast_uninstall() {

  // Delete session variables.
  unset($_SESSION["high_contrast_activated"]);

  // Delete variables from db.
  $result = db_query('SELECT name FROM {variable} WHERE name LIKE :like', [
    ':like' => 'high_contrast_%',
  ]);
  foreach ($result as $row) {
    variable_del($row->name);
  }
}

Functions