You are here

function habitat_ensure_modules_enabled in Habitat 7

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

File

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

Code

function habitat_ensure_modules_enabled($habitat) {
  $enabled_modules = variable_get('habitat_enable_' . $habitat, array());
  $ret = FALSE;
  if (count($enabled_modules)) {
    foreach ($enabled_modules as $module) {
      if ($module && !module_exists($module)) {
        $ret = TRUE;
        module_enable(array(
          $module,
        ));
        watchdog('habitat', '%module was enabled for the %habitat habitat', array(
          '%module' => $module,
          '%habitat' => $habitat,
        ));
      }
    }
  }
  return $ret;
}