You are here

function devel_reinstall_submit in Devel 6

Same name and namespace in other branches
  1. 5 devel.module \devel_reinstall_submit()
  2. 7 devel.pages.inc \devel_reinstall_submit()

Process reinstall menu form submissions.

File

./devel.module, line 1302

Code

function devel_reinstall_submit($form, &$form_state) {
  require_once './includes/install.inc';
  $modules = array_filter($form_state['values']['list']);
  foreach ($modules as $module) {
    module_load_install($module);
    $versions = drupal_get_schema_versions($module);
    drupal_set_installed_schema_version($module, SCHEMA_UNINSTALLED);
    module_invoke($module, 'uninstall');
    _drupal_install_module($module);
    module_invoke($module, 'enable');
    drupal_get_schema(NULL, TRUE);
    drupal_set_message(t('Uninstalled and installed the %name module.', array(
      '%name' => $module,
    )));
  }
}