function _get_module_list in General Data Protection Regulation 7
Same name and namespace in other branches
- 8.2 gdpr.module \_get_module_list()
- 8 gdpr.module \_get_module_list()
Returns a HTML makrup for data_collecting modules checkpoint description.
Parameters
string $type: Type of modules to search for.
Return value
string HTML markup string
1 call to _get_module_list()
- gdpr_checklistapi_checklist_info in ./
gdpr.module - Implements hook_checklistapi_checklist_info().
File
- ./
gdpr.module, line 490 - Contains hook implementations and shared functions.
Code
function _get_module_list($type) {
$c_modules = _get_module_list_by_type($type);
$modules_list = [
'#theme' => 'item_list',
'#items' => [],
];
$module_statuses = _get_module_statuses();
$all_modules = _get_modules();
$color_classes = [
-1 => 'admin-enabled',
0 => 'admin-enabled',
1 => 'admin-missing',
];
foreach ($c_modules as $c_module) {
if (isset($all_modules[$c_module])) {
$status_class = $color_classes[$all_modules[$c_module]['status']];
$status = [
'#prefix' => '<span class="' . $status_class . '">',
'#suffix' => '</span>',
'#markup' => $module_statuses[$all_modules[$c_module]['status']],
];
$modules_list['#items'][] = t('@title (!status)', [
'@title' => $all_modules[$c_module]['name'],
'!status' => drupal_render($status),
]);
}
}
return drupal_render($modules_list);
}