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