You are here

function _unused_modules_get_available_modules in Unused Modules 6

Same name and namespace in other branches
  1. 7 unused_modules.inc \_unused_modules_get_available_modules()

Returns an array of available modules.

2 calls to _unused_modules_get_available_modules()
_unused_modules_get_enabled_modules in ./unused_modules.module
Returns an array of enabled modules.
_unused_modules_get_modules_by_project in ./unused_modules.module
Returns an array with all available modules.

File

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

Code

function _unused_modules_get_available_modules() {

  // @drupal-6 backport: needs dependency module 'drupal_static'.
  $available_modules =& drupal_static(__FUNCTION__);
  if (!isset($available_modules)) {

    // Get all modules available.
    // @drupal-6 backport: little different regex for .module selector.
    $available_modules = drupal_system_listing('\\.module$', 'modules', 'name', 0);

    // Sort for readability.
    ksort($available_modules);

    // Add module info.
    _unused_modules_add_module_info($available_modules);

    // Remove core modules.
    _unused_modules_remove_core_modules($available_modules);

    // Add information from .info file.
    _unused_modules_add_info_file_information($available_modules);

    // Add project info.
    _unused_modules_add_project_path($available_modules);
  }
  return $available_modules;
}