You are here

dhtml_menu.install in DHTML Menu 6

dhtml_menu.install Install and Uninstall processes for this module.

File

dhtml_menu.install
View source
<?php

/**
 * @file dhtml_menu.install
 * Install and Uninstall processes for this module.
 */

/**
 * Implementation of hook_install().
 */
function dhtml_menu_install() {

  // Use the effects on menus by default now.
  variable_get('dhtml_menu_use_effects', 1);
}

/**
 * Implementation of hook_enable().
 *
 * Replaces the navigation block in all themes by
 * assigning its values to this module's block, then
 * disabling the normal block.
 */
function dhtml_menu_enable() {

  // Ensure that the block table is up to date.
  _block_rehash();
  $dhtml_menus = variable_get('dhtml_menus_menus', array());
  $res = db_query("SELECT delta FROM {blocks} WHERE module = 'menu'");
  while ($row = db_fetch_array($res)) {
    $dhtml_menus[$row['delta']] = TRUE;
  }
  $dhtml_menus['navigation'] = TRUE;
  variable_set('dhtml_menus_menus', $dhtml_menus);
  drupal_set_message(t('Your navigation block has been replaced with its DHTML equivalent in all currently enabled themes. If you wish, you may adjust your <a href="@settings">block settings</a> in detail.', array(
    '@settings' => url('admin/build/block'),
  )), 'status');
}

/**
 * Implementation of hook_uninstall().
 */
function dhtml_menu_uninstall() {

  // Delete all global variables
  variable_del('dhtml_menu_duplicated');
  variable_del('dhtml_menu_use_effects');
  variable_del('dhtml_menu_hide_siblings');
  variable_del('dhtml_menus_menus');
}

Functions

Namesort descending Description
dhtml_menu_enable Implementation of hook_enable().
dhtml_menu_install Implementation of hook_install().
dhtml_menu_uninstall Implementation of hook_uninstall().