function system_modules_uninstall_confirm_form

7.x system.admin.inc system_modules_uninstall_confirm_form($storage)
6.x system.admin.inc system_modules_uninstall_confirm_form($storage)

Confirm uninstall of selected modules.

Parameters

$storage: An associative array of modules selected to be uninstalled.

Return value

A form array representing modules to confirm.

Related topics

1 call to system_modules_uninstall_confirm_form()
system_modules_uninstall in drupal-7.x/modules/system/system.admin.inc
Builds a form of currently disabled modules.

File

drupal-7.x/modules/system/system.admin.inc, line 1310
Admin page callbacks for the system module.

Code

function system_modules_uninstall_confirm_form($storage) {
  // Nothing to build.
  if (empty($storage)) {
    return;
  }

  // Construct the hidden form elements and list items.
  foreach (array_filter($storage['uninstall']) as $module => $value) {
    $info = drupal_parse_info_file(drupal_get_path('module', $module) . '/' . $module . '.info');
    $uninstall[] = $info['name'];
    $form['uninstall'][$module] = array('#type' => 'hidden',
      '#value' => 1,
    );
  }

  // Display a confirm form if modules have been selected.
  if (isset($uninstall)) {
    $form['#confirmed'] = TRUE;
    $form['uninstall']['#tree'] = TRUE;
    $form['modules'] = array('#markup' => '<p>' . t('The following modules will be completely uninstalled from your site, and <em>all data from these modules will be lost</em>!') . '</p>' . theme('item_list', array('items' => $uninstall)));
    $form = confirm_form(
    $form, 
    t('Confirm uninstall'), 
    'admin/modules/uninstall', 
    t('Would you like to continue with uninstalling the above?'), 
    t('Uninstall'), 
    t('Cancel'));
    return $form;
  }
}