You are here

function system_module_build_dependencies in Drupal 5

Same name and namespace in other branches
  1. 6 modules/system/system.admin.inc \system_module_build_dependencies()
2 calls to system_module_build_dependencies()
system_modules_confirm_form in modules/system/system.module
system_modules_submit in modules/system/system.module
Submit callback; handles modules form submission.

File

modules/system/system.module, line 1431
Configuration system that lets administrators modify the workings of the site.

Code

function system_module_build_dependencies($modules, $form_values) {
  static $dependencies;
  if (!isset($dependencies) && isset($form_values) && is_array($form_values)) {
    $dependencies = array();
    foreach ($modules as $name => $module) {

      // If the module is disabled, will be switched on and it has dependencies.
      if (!$module->status && isset($form_values['status'][$name]) && $form_values['status'][$name] && isset($module->info['dependencies'])) {
        foreach ($module->info['dependencies'] as $dependency) {
          if (!$form_values['status'][$dependency] && isset($modules[$dependency])) {
            if (!isset($dependencies[$name])) {
              $dependencies[$name] = array();
            }
            $dependencies[$name][] = $dependency;
          }
        }
      }
    }
  }
  return $dependencies;
}