You are here

function menu_block_uninstall in Menu Block 5.2

Same name and namespace in other branches
  1. 5 menu_block.install \menu_block_uninstall()
  2. 6.2 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 11
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}_menu_name");
    variable_del("menu_block_{$delta}_title");
    variable_del("menu_block_{$delta}_level");
    variable_del("menu_block_{$delta}_depth");
    variable_del("menu_block_{$delta}_expanded");
  }
  variable_del('menu_block_ids');

  // 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();
}