Form constructor for a form to configure the new site.
$install_state: An array of information about the current installation state.
install_configure_form_validate()
install_configure_form_submit()
function install_configure_form($form, &$form_state, &$install_state) {
drupal_set_title(st('Configure site'));
// Warn about settings.php permissions risk
$settings_dir = conf_path();
$settings_file = $settings_dir . '/settings.php';
// Check that $_POST is empty so we only show this message when the form is
// first displayed, not on the next page after it is submitted. (We do not
// want to repeat it multiple times because it is a general warning that is
// not related to the rest of the installation process; it would also be
// especially out of place on the last page of the installer, where it would
// distract from the message that the Drupal installation has completed
// successfully.)
if (empty($_POST) && (!drupal_verify_install_file(DRUPAL_ROOT . '/' . $settings_file, FILE_EXIST | FILE_READABLE | FILE_NOT_WRITABLE) || !drupal_verify_install_file(DRUPAL_ROOT . '/' . $settings_dir, FILE_NOT_WRITABLE, 'dir'))) {
drupal_set_message(st('All necessary changes to %dir and %file have been made, so you should remove write permissions to them now in order to avoid security risks. If you are unsure how to do so, consult the <a href="@handbook_url">online handbook</a>.', array(
'%dir' => $settings_dir,
'%file' => $settings_file,
'@handbook_url' => 'http://drupal.org/server-permissions',
)), 'warning');
}
drupal_add_library('system', 'drupal.system');
// Add JavaScript time zone detection.
drupal_add_library('system', 'drupal.timezone');
// We add these strings as settings because JavaScript translation does not
// work during installation.
drupal_add_js(array(
'copyFieldValue' => array(
'edit-site-mail' => array(
'edit-account-mail',
),
),
), 'setting');
// Cache a fully-built schema. This is necessary for any invocation of
// index.php because: (1) setting cache table entries requires schema
// information, (2) that occurs during bootstrap before any module are
// loaded, so (3) if there is no cached schema, drupal_get_schema() will
// try to generate one but with no loaded modules will return nothing.
//
// @todo Move this to the 'install_finished' task?
drupal_get_schema(NULL, TRUE);
// Return the form.
return _install_configure_form($form, $form_state, $install_state);
}