diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index 37a2bf2..57fd778 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -1263,20 +1263,23 @@ function system_modules_uninstall($form, $form_state = NULL) {
if (!empty($disabled_modules)) {
$profile = drupal_get_profile();
uasort($disabled_modules, 'system_sort_modules_by_info_name');
- $form['uninstall'] = array('#tree' => TRUE);
+ $form['uninstall'] = array(
+ '#type' => 'table',
+ '#header' => array(t('Uninstall'), t('Name'), t('Description')),
+ '#empty' => t('There are no items yet. Disable a module', array(
+ '@add-url' => url('admin/modules'),
+ )),
+ '#tableselect' => TRUE,
+ );
foreach ($disabled_modules as $module) {
$module_name = $module->info['name'] ? $module->info['name'] : $module->name;
- $form['modules'][$module->name]['#module_name'] = $module_name;
- $form['modules'][$module->name]['name']['#markup'] = $module_name;
- $form['modules'][$module->name]['description']['#markup'] = t($module->info['description']);
- $form['uninstall'][$module->name] = array(
- '#type' => 'checkbox',
- '#title' => t('Uninstall @module module', array('@module' => $module_name)),
- '#title_display' => 'invisible',
- );
+ $form['uninstall'][$module->name]['name']['#markup'] = $module_name;
+ $form['uninstall'][$module->name]['description']['#markup'] = t($module->info['description']);
+
// All modules which depend on this one must be uninstalled first, before
// we can allow this module to be uninstalled. (The installation profile
// is excluded from this list.)
+ $required_modules = array();
foreach (array_keys($module->required_by) as $dependent) {
if ($dependent != $profile && drupal_get_installed_schema_version($dependent) != SCHEMA_UNINSTALLED) {
$dependent_name = isset($all_modules[$dependent]->info['name']) ? $all_modules[$dependent]->info['name'] : $dependent;
@@ -1284,11 +1287,24 @@ function system_modules_uninstall($form, $form_state = NULL) {
$form['uninstall'][$module->name]['#disabled'] = TRUE;
}
}
+ if (!empty($required_modules)) {
+ $disabled_message = format_plural(count($required_modules),
+ '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' => $module_name, '@required_modules' => implode(', ', $required_modules)));
+ $disabled_message = '
' . $disabled_message . '
';
+ }
+ else {
+ $disabled_message = '';
+ }
+ $form['uninstall'][$module->name]['uninstall']['#markup'] = t($disabled_message);
+
}
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => t('Uninstall'),
+ '#tableselect' => TRUE,
);
$form['#action'] = url('admin/modules/uninstall/confirm');
}
@@ -2386,55 +2402,6 @@ function theme_system_modules_incompatible($variables) {
}
/**
- * Returns HTML for a table of currently disabled modules.
- *
- * @param $variables
- * An associative array containing:
- * - form: A render element representing the form.
- *
- * @ingroup themeable
- */
-function theme_system_modules_uninstall($variables) {
- $form = $variables['form'];
-
- // No theming for the confirm form.
- if (isset($form['confirm'])) {
- return drupal_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 = '' . $disabled_message . '
';
- }
- else {
- $disabled_message = '';
- }
- $rows[] = array(
- array('data' => drupal_render($form['uninstall'][$module]), 'align' => 'center'),
- '',
- array('data' => drupal_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 .= drupal_render_children($form);
-
- return $output;
-}
-
-/**
* Returns HTML for the Appearance page.
*
* @param $variables
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 17015c6..34dc7ff 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -151,10 +151,6 @@ function system_theme() {
'variables' => array('message' => NULL),
'file' => 'system.admin.inc',
),
- 'system_modules_uninstall' => array(
- 'render element' => 'form',
- 'file' => 'system.admin.inc',
- ),
'status_report' => array(
'render element' => 'requirements',
'file' => 'system.admin.inc',