function _unused_modules_get_enabled_modules in Unused Modules 7
Same name and namespace in other branches
- 6 unused_modules.module \_unused_modules_get_enabled_modules()
Returns an array of enabled modules.
1 call to _unused_modules_get_enabled_modules()
- _unused_modules_get_modules_by_project in ./
unused_modules.inc - Returns an array with all available modules.
File
- ./
unused_modules.inc, line 87 - Common Unused Modules functionality.
Code
function _unused_modules_get_enabled_modules() {
// Get all modules available.
$available_modules = _unused_modules_get_available_modules();
// Get all enabled modules.
$enabled_modules = module_list();
// Return only enabled.
$return = array();
foreach ($enabled_modules as $enabled_module) {
// Some enabled_modules are actually not available. This is the case for
// installation profiles like 'minimal'.
if (isset($available_modules[$enabled_module])) {
$return[$enabled_module] = $available_modules[$enabled_module];
}
}
return $return;
}