You are here

function _unused_modules_get_enabled_modules in Unused Modules 6

Same name and namespace in other branches
  1. 7 unused_modules.inc \_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.module
Returns an array with all available modules.

File

./unused_modules.module, line 247
This module lists modules and projects that are unused.

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;
}