You are here

global_filter.install in Views Global Filter 6

Same filename and directory in other branches
  1. 8 global_filter.install
  2. 7 global_filter.install

Install and uninstall hooks for the Global Filter module.

File

global_filter.install
View source
<?php

/**
 * @file
 * Install and uninstall hooks for the Global Filter module.
 */

/**
 * Implements hook_install().
 */
function global_filter_install() {
  return;
}

/**
 * Implements hook_uninstall().
 */
function global_filter_uninstall() {
  require_once 'global_filter.module';
  $num_filters = variable_get('global_filter_num_filters', GLOBAL_FILTER_DEF_NUM_FILTERS);
  for ($i = 1; $i <= $num_filters; $i++) {
    if ($filter_name = variable_get("global_filter_{$i}", '')) {
      _global_filter_remove_default_filter_from_views($filter_name);
    }
  }
  unset($_SESSION['global_filter']);

  // Delete global_filter_* variables at once
  db_query("DELETE FROM {variable} WHERE name LIKE 'global_filter_%%'");
}

Functions