function _modules_weight_modules_list in Modules weight 7
Return the modules list.
Parameters
bool $show_core_modules: Force to show the core modules.
Return value
array The modules list.
3 calls to _modules_weight_modules_list()
- drush_modules_weight_mw_list in ./
modules_weight.drush.inc - Callback for the mw-list command.
- modules_weight_admin_config_page_form in ./
modules_weight.admin.inc - Form constructor for Module Weight form.
- modules_weight_admin_config_page_form_submit in ./
modules_weight.admin.inc - Form submit handler for the modules_weight_admin_config_page_form form.
File
- ./
modules_weight.helpers.inc, line 47 - Helper functions.
Code
function _modules_weight_modules_list($show_core_modules = FALSE) {
$modules = [];
// Get current list of modules.
$installed_modules = system_get_info('module');
// Getting the modules weight.
$modules_weight = _modules_weight_get_modules_weight();
// Iterate through each of the modules.
foreach ($installed_modules as $module_name => $module_info) {
// We don't want to show the hidden modules, or the Core modules
// (if the configuration is set to FALSE).
if (!isset($module_info['hidden']) && ($show_core_modules || $module_info['package'] != 'Core')) {
$modules[$module_name]['name'] = $module_info['name'];
$modules[$module_name]['description'] = $module_info['description'];
$modules[$module_name]['weight'] = $modules_weight[$module_name];
$modules[$module_name]['package'] = $module_info['package'];
}
}
// Sorting all modules by their weight.
uasort($modules, 'sort_by_weight_and_name');
return $modules;
}