You are here

function taxonomy_menu_uninstall in Taxonomy menu 7.2

Same name and namespace in other branches
  1. 8 taxonomy_menu.install \taxonomy_menu_uninstall()
  2. 5 taxonomy_menu.install \taxonomy_menu_uninstall()
  3. 6.3 taxonomy_menu.install \taxonomy_menu_uninstall()
  4. 6 taxonomy_menu.install \taxonomy_menu_uninstall()
  5. 6.2 taxonomy_menu.install \taxonomy_menu_uninstall()
  6. 7 taxonomy_menu.install \taxonomy_menu_uninstall()

Implements hook_uninstall().

File

./taxonomy_menu.install, line 11
Install and uninstall all required databases. Also do incremental database updates.

Code

function taxonomy_menu_uninstall() {

  //remove menu items
  db_delete('menu_links')
    ->condition('module', 'taxonomy_menu', '=')
    ->execute();

  //rebuild the menus
  variable_set('menu_rebuild_needed', TRUE);

  // Delete variables
  $query = db_select('variable', 'v')
    ->fields('v')
    ->execute();
  $variables = $query
    ->fetchAll();
  foreach ($variables as $variable) {
    if (strpos($variable->name, 'taxonomy_menu') !== FALSE) {
      variable_del($variable->name);
    }
  }
}