system_module_build_dependencies
modules/system/system.admin.inc, строка 962
- Версии
- 5 – 6
system_module_build_dependencies($modules, $form_values)
Создаёт список зависимостей для модулей, которые должны быть включены.
Параметры
$modules
Список модулей для проверки.
$form_values
Отправленные значения формы используемые для определения того, какие модули включены.
Возвращаемое значение
Массив зависимостей.
Код
<?php
function system_module_build_dependencies($modules, $form_values) {
static $dependencies;
if (!isset($dependencies) && isset($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 && $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;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии