You are here

function devel_reinstall in Devel 6

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

Display a list of installed modules with the option to reinstall them.

1 string reference to 'devel_reinstall'
devel_menu in ./devel.module
Implementation of hook_menu().

File

./devel.module, line 1279

Code

function devel_reinstall($form_state) {
  $output = '';
  $modules = module_list();
  sort($modules);
  $options = drupal_map_assoc($modules);
  $form['list'] = array(
    '#type' => 'checkboxes',
    '#options' => $options,
    '#description' => t('Uninstall and then install the selected modules. <code>hook_uninstall()</code> and <code>hook_install()</code> will be executed and the schema version number will be set to the most recent update number. You may have to manually clear out any existing tables first if the module doesn\'t implement <code>hook_uninstall()</code>.'),
  );
  $form['submit'] = array(
    '#value' => t('Reinstall'),
    '#type' => 'submit',
  );
  if (empty($form_state['post'])) {
    drupal_set_message(t('Warning - will delete your module tables and variables.'), 'error');
  }
  return $form;
}