update_selection_page

  1. drupal
    1. 4.7
    2. 5
    3. 6 update.php
    4. 7 update.php
Versions
4.7 – 7 update_selection_page()

Code

./update.php, line 317

<?php
function update_selection_page() {
  $output = '<p>The version of Drupal you are updating from has been automatically detected. You can select a different version, but you should not need to.</p>';
  $output .= '<p>Click Update to start the update process.</p>';

  $form = array();
  $form['start'] = array(
    '#tree' => TRUE, 
    '#type' => 'fieldset', 
    '#title' => 'Select versions', 
    '#collapsible' => TRUE, 
    '#collapsed' => TRUE,
  );
  foreach (module_list() as $module) {
    $updates = drupal_get_schema_versions($module);
    if ($updates !== FALSE) {
      $updates = drupal_map_assoc($updates);
      $updates[] = 'No updates available';

      $form['start'][$module] = array(
        '#type' => 'select', 
        '#title' => $module . ' module', 
        '#default_value' => array_search(drupal_get_installed_schema_version($module), $updates) + 1, 
        '#options' => $updates,
      );
    }
  }

  $form['has_js'] = array(
    '#type' => 'hidden', 
    '#default_value' => FALSE, 
    '#attributes' => array('id' => 'edit-has_js'),
  );
  $form['submit'] = array(
    '#type' => 'submit', 
    '#value' => 'Update',
  );

  drupal_set_title('Drupal database update');
  // Prevent browser from using cached drupal.js or update.js
  drupal_add_js('misc/update.js', TRUE);
  $output .= drupal_get_form('update_script_selection_form', $form);

  return $output;
}
?>