high_contrast.install in High contrast 7
Same filename and directory in other branches
Install, update, and uninstall functions for the High Contrast module.
File
high_contrast.installView 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
Name | Description |
---|---|
high_contrast_install | Implements hook_install(). |
high_contrast_uninstall | Implements hook_uninstall(). |