You are here

function system_modules_uninstall_submit in Drupal 6

Same name and namespace in other branches
  1. 5 modules/system/system.module \system_modules_uninstall_submit()
  2. 7 modules/system/system.admin.inc \system_modules_uninstall_submit()

Processes the submitted uninstall form.

File

modules/system/system.admin.inc, line 1129
Admin page callbacks for the system module.

Code

function system_modules_uninstall_submit($form, &$form_state) {

  // Make sure the install API is available.
  include_once './includes/install.inc';
  if (!empty($form['#confirmed'])) {

    // Call the uninstall routine for each selected module.
    foreach (array_filter($form_state['values']['uninstall']) as $module => $value) {
      drupal_uninstall_module($module);
    }
    drupal_set_message(t('The selected modules have been uninstalled.'));
    unset($form_state['storage']);
    $form_state['redirect'] = 'admin/build/modules/uninstall';
  }
  else {
    $form_state['storage'] = $form_state['values'];
  }
}