You are here

function nodesymlinks_uninstall in NodeSymlinks 7

Same name and namespace in other branches
  1. 6 nodesymlinks.install \nodesymlinks_uninstall()

Implements hook_uninstall().

File

./nodesymlinks.install, line 22
Installation functions for NodeSymlinks.

Code

function nodesymlinks_uninstall() {

  // Delete the duplicate paths we created.
  $result = db_query("SELECT mlid FROM {menu_links} WHERE module = 'nodesymlinks'");
  while ($mlid = $result
    ->fetchField()) {
    menu_link_delete($mlid);
  }

  // Delete the duplicate aliases we created.
  db_delete('url_alias')
    ->condition('source', 'node/%/mid/%', 'LIKE')
    ->execute();

  // Delete variables.
  variable_del('nodesymlinks_crumbs_lastcrumb');
  variable_del('nodesymlinks_check_menuitem');
  variable_del('nodesymlinks_show_messages');
}