function unused_modules_show_modules in Unused Modules 7
Same name and namespace in other branches
- 6 unused_modules.module \unused_modules_show_modules()
Page callback.
Returns a table with orphaned modules.
Parameters
string $op: Either 'all' or 'disabled'.
Return value
string themed table.
1 string reference to 'unused_modules_show_modules'
- unused_modules_menu in ./
unused_modules.module - Implements hook_menu().
File
- ./
unused_modules.module, line 137 - This module lists modules and projects that are unused.
Code
function unused_modules_show_modules($op = 'all') {
$modules = _unused_modules_get_modules_by_project();
$header = array(
'Project',
'Module',
'Module enabled',
'Project has Enabled Modules',
'Project Path',
);
$rows = array();
foreach ($modules as $module) {
if ($op == 'all') {
$rows[$module->name] = array(
$module->project,
$module->name,
$module->module_is_enabled ? t("Yes") : t("No"),
$module->project_has_enabled_modules ? t("Yes") : t("No"),
$module->project_path,
);
}
elseif ($op == 'disabled') {
if (!$module->project_has_enabled_modules) {
$rows[$module->name] = array(
$module->project,
$module->name,
$module->module_is_enabled ? t("Yes") : t("No"),
$module->project_has_enabled_modules ? t("Yes") : t("No"),
$module->project_path,
);
}
}
}
if (!$rows) {
return t("Hurray, no orphaned modules!");
}
return theme('table', array(
'header' => $header,
'rows' => $rows,
));
}