function simplified_modules_update_projects_alter in Simplified Modules 7
Implements hook_update_projects_alter().
File
- ./
simplified_modules.module, line 29 - Simplifies the modules page by allowing related modules to be grouped under a single checkbox.
Code
function simplified_modules_update_projects_alter(&$projects) {
// In simplified_modules_system_info_alter() we marked some modules as hidden
// because we don't want them to appear in the UI on the Modules page and
// elsewhere. However, we do still want Update Manager to check them, because
// they may be in use on the site. Normally, however, update_get_projects()
// skips hidden modules. So in this function, we basically repeat what
// update_get_projects() does, only making sure to "unhide" these modules
// before running them through the process of building up their project info.
$projects = array();
$module_data = system_rebuild_module_data();
$hidden_modules = array_merge(simplified_modules_hidden_submodules(), simplified_modules_hidden_dependencies());
foreach ($module_data as &$file) {
// Unhide modules that we previously hid.
if (!empty($file->info['hidden']) && in_array($file->name, $hidden_modules)) {
$file->info['hidden'] = FALSE;
}
}
$theme_data = system_rebuild_theme_data();
_update_process_info_list($projects, $module_data, 'module', TRUE);
_update_process_info_list($projects, $theme_data, 'theme', TRUE);
if (variable_get('update_check_disabled', FALSE)) {
_update_process_info_list($projects, $module_data, 'module', FALSE);
_update_process_info_list($projects, $theme_data, 'theme', FALSE);
}
}