You are here

function habitat_ensure_modules_disabled in Habitat 7

1 call to habitat_ensure_modules_disabled()
habitat_ensure_habitat in ./habitat.module

File

./habitat.module, line 26
Change enabled modules based on current environment.

Code

function habitat_ensure_modules_disabled($habitat) {
  $disabled_modules = variable_get('habitat_disable_' . $habitat, array());
  $ret = FALSE;
  if (count($disabled_modules)) {
    foreach ($disabled_modules as $module) {
      if (module_exists($module)) {
        $ret = TRUE;
        module_disable(array(
          $module,
        ), FALSE);
        watchdog('habitat', '%module was disabled for the %habitat habitat', array(
          '%module' => $module,
          '%habitat' => $habitat,
        ));
      }
    }
  }
  return $ret;
}