You are here

function mobile_tools_roles_uninstall in Mobile Tools 6.2

Same name and namespace in other branches
  1. 6.3 mobile_tools_roles.install \mobile_tools_roles_uninstall()
  2. 7.2 mobile_tools_roles/mobile_tools_roles.install \mobile_tools_roles_uninstall()

Implementation of hook_uninstall().

File

modules/mobile_tools_roles/mobile_tools_roles.install, line 18
Mobile Tools Roles module's install and uninstall code.

Code

function mobile_tools_roles_uninstall() {

  // Build a query to select all Mobile Tools Roles relations
  $query = "SELECT * FROM {mobile_tools_roles_relations}";

  // Execute the query
  $result = db_query($query);

  // Delete the role associated with each relation
  while ($item = db_fetch_object($result)) {
    db_query("DELETE FROM {role} WHERE rid = %d", $item->mrid);
  }

  // Remove all of the Mobile Tools Roles tables
  drupal_uninstall_schema('mobile_tools_roles');

  // Delete all of the Mobile Tools Roles variables
  variable_del('mobile_tools_roles');
  variable_del('mobile_tools_enable_roles');
}