You are here

function menu_block_uninstall in Menu Block 6.2

Same name and namespace in other branches
  1. 5.2 menu_block.install \menu_block_uninstall()
  2. 5 menu_block.install \menu_block_uninstall()
  3. 7.3 menu_block.install \menu_block_uninstall()
  4. 7.2 menu_block.install \menu_block_uninstall()

Implements hook_uninstall().

File

./menu_block.install, line 10
Provides install, upgrade and un-install functions for menu_block.

Code

function menu_block_uninstall() {

  // Delete menu block variables.
  foreach (variable_get('menu_block_ids', array()) as $delta) {
    variable_del("menu_block_{$delta}_title_link");
    variable_del("menu_block_{$delta}_admin_title");
    variable_del("menu_block_{$delta}_parent");
    variable_del("menu_block_{$delta}_level");
    variable_del("menu_block_{$delta}_follow");
    variable_del("menu_block_{$delta}_depth");
    variable_del("menu_block_{$delta}_expanded");
    variable_del("menu_block_{$delta}_sort");
  }
  variable_del('menu_block_ids');
  variable_del('menu_block_menu_order');

  // Remove block configurations.
  db_query("DELETE FROM {blocks} WHERE module = 'menu_block'");
  db_query("DELETE FROM {blocks_roles} WHERE module = 'menu_block'");
  cache_clear_all();
}