You are here

nice_menus.install in Nice Menus 6.2

Same filename and directory in other branches
  1. 6 nice_menus.install
  2. 7.3 nice_menus.install
  3. 7.2 nice_menus.install

Update functions for Nice menus.

File

nice_menus.install
View source
<?php

/**
 * @file
 * Update functions for Nice menus.
 */

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

  // Remove all the configuration variables added by the module.
  db_query("DELETE FROM {variable} WHERE name LIKE 'nice_menus_%'");

  // Remove all the block configurations of the module.
  if (module_exists('block')) {
    db_query("DELETE FROM {blocks} WHERE module = 'nice_menus'");
    db_query("DELETE FROM {blocks_roles} WHERE module = 'nice_menus'");
  }
  cache_clear_all();
}

/**
 * Implements hook_update_N().
 */
function nice_menus_update_6000() {

  // Existing blocks need to be set to no caching.
  $ret = array();
  $ret[] = update_sql("UPDATE {blocks} SET cache = -1 WHERE module = 'nice_menus'");
  return $ret;
}

/**
 * Implements hook_update_N().
 */
function nice_menus_update_6001() {

  // Switch the JS toggle variable name.
  $old_setting = variable_get('nice_menus_ie', 1);
  variable_set('nice_menus_js', $old_setting);
  variable_del('nice_menus_ie');
  return array();
}

Functions