1.20.x system.theme.inc | theme_system_modules_uninstall($variables) |
Returns HTML for a table of currently disabled modules.
Parameters
$variables: An associative array containing:
- form: A render element representing the form.
Related topics
File
- modules/
system/ system.theme.inc, line 227 - Theme functions for the System module.
Code
function theme_system_modules_uninstall($variables) {
$form = $variables['form'];
// No special theme override for the confirm form.
if (isset($form['confirm'])) {
return backdrop_render($form);
}
// Table headers.
$header = array(t('Uninstall'),
t('Name'),
t('Description'),
);
// Display table.
$rows = array();
foreach (element_children($form['modules']) as $module) {
if (!empty($form['modules'][$module]['#required_by'])) {
$disabled_message = format_plural(count($form['modules'][$module]['#required_by']),
'To uninstall @module, the following module must be uninstalled first: @required_modules',
'To uninstall @module, the following modules must be uninstalled first: @required_modules',
array('@module' => $form['modules'][$module]['#module_name'], '@required_modules' => implode(', ', $form['modules'][$module]['#required_by'])));
$disabled_message = '<div class="admin-requirements">' . $disabled_message . '</div>';
}
else {
$disabled_message = '';
}
$rows[] = array(
array('data' => backdrop_render($form['uninstall'][$module]), 'align' => 'center'),
'<strong><label for="' . $form['uninstall'][$module]['#id'] . '">' . backdrop_render($form['modules'][$module]['name']) . '</label></strong>',
array('data' => backdrop_render($form['modules'][$module]['description']) . $disabled_message, 'class' => array('description')),
);
}
$output = theme('table', array('header' => $header, 'rows' => $rows, 'empty' => t('No modules are available to uninstall.')));
$output .= backdrop_render_children($form);
return $output;
}