function system_disable_module

7.x system.module system_disable_module($module_details)
6.x system.module system_disable_module($module_details)
4.x system.module system_disable_module($module_details)
5.x system.module system_disable_module($module_details)

Handles the disabling of the module in question.

1 call to system_disable_module()
system_modules_form_submit in modules/system/system.module
Submit handler for the modules form.

File

modules/system/system.module, line 3367

Code

function system_disable_module($module_details) {

  $module = $module_details ["module"];
  $path = $module_details ["path"];

  // This module cannot be disabled!
  if ($module_details ["required"] == TRUE) {
    return;
  }

  // If the module has a "hook_disable" in it's path/module.install file, include and call it.  
  if (include_module_install($module, $path) && function_exists($module . '_disable')) {
    call_user_func($module . '_disable');
  }

  // Disable it in the modules table.
  $res = db_query("UPDATE modules
                   SET enabled = '0'
                   WHERE name = '?' ", $module);

  fp_add_message(t("The module %module has been disabled.", array("%module" => $module)));

}