1 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

File

core/modules/system/system.admin.inc, line 1176
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 = backdrop_parse_info_file(backdrop_get_path('module', $module) . '/' . $module . '.info');
    $uninstall[] = $info['name'];
    $form['uninstall'][$module] = array('#type' => 'hidden',
      '#value' => 1,
    );
  }

  // Display a confirmation form if modules have been selected.
  if (isset($uninstall)) {
    backdrop_set_message(t('Uninstalling modules causes all data from these modules to be lost!'), 'warning');
    $form['#confirmed'] = TRUE;
    $form['uninstall']['#tree'] = TRUE;
    $form = confirm_form(
    $form, 
    t('Confirm uninstall'), 
    'admin/modules/uninstall', 
    t('Are you sure you want to continue with uninstalling the modules listed below?') . theme('item_list', array('items' => $uninstall)), 
    t('Uninstall'), 
    t('Cancel'));
    return $form;
  }
}