function drush_unused_modules_show_projects in Unused Modules 7
Same name and namespace in other branches
- 8 unused_modules.drush.inc \drush_unused_modules_show_projects()
- 6 unused_modules.drush.inc \drush_unused_modules_show_projects()
Drush callback.
Prints a table with orphaned projects.
Parameters
string $op: Either 'all' or 'disabled'.
Return value
string themed table.
1 call to drush_unused_modules_show_projects()
- drush_unused_modules in ./
unused_modules.drush.inc - Drush command callback.
File
- ./
unused_modules.drush.inc, line 91 - Unused Modules Drush support.
Code
function drush_unused_modules_show_projects($op = 'all') {
$modules = _unused_modules_get_modules_by_project();
$header = array(
'Project',
'Project has Enabled Modules',
'Project Path',
);
// With Drush, the first row is the header.
$rows = array();
$rows[] = $header;
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) {
drush_print("Hurray, no orphaned projects!");
}
drush_print_table($rows, TRUE);
}