You are here

book_menus.install in Book Menus 7

Installation functionality for book_menus.

File

book_menus.install
View source
<?php

/**
 * @file
 * Installation functionality for book_menus.
 */

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

  // If the user disabled / enabled the module (i.e not new install),
  // the menus will need to be rebuilt.
  menu_rebuild();
}

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

  // Get any book menus.
  $book_menuss = variable_get('book_menus', array());

  // Each book menu.
  foreach ($book_menuss as $menu_name) {

    // Remove that menu from the custom_menu database.
    db_delete('menu_custom')
      ->condition('menu_name', $menu_name)
      ->execute();
  }

  // Remove the custom variable.
  variable_del('book_menus');

  // Rebuild the menus.
  menu_rebuild();
}

Functions

Namesort descending Description
book_menus_install Implements hook_install().
book_menus_uninstall Implements hook_uninstall().