You are here

function hosting_wizard_provision_db in Hosting 5

Database configuration form

Inherits the db_server_node_form, and shifts some things around. Perhaps those changes need to go in upstream?

File

./hosting.wizard.inc, line 346

Code

function hosting_wizard_provision_db() {
  $form = drupal_retrieve_form('db_server_node_form', node_load(HOSTING_OWN_DB_SERVER));
  _hosting_wizard_cleanse_node_form($form);
  $own_link = _hosting_node_link(HOSTING_OWN_DB_SERVER);
  $form['introduction']['#weight'] = -9;
  $form['introduction']['#value'] = t('<p>You need at least one fully functional database server to be able to manage sites.
       Luckily, if you can read this, you are already most of the way there. <strong>If the user you specified when first configuring the Drupal can create databases, you probably do not need to change anything here.</strong></p>
        <p>This configuration form is actually the !edit_page for the !own_server database server node.
        It has however been heavily annotated and slightly simplified for this installation wizard. And while
        the wizard can be run multiple times, it won\'t be able to edit any database servers other than the database
        this site is running on.</p>', array(
    '!own_server' => $own_link,
    '!edit_page' => l(t("edit page"), 'node/' . HOSTING_OWN_DB_SERVER . '/edit'),
  ));
  $form['title']['#type'] = 'value';
  $form['db_details'] = array(
    '#type' => 'fieldset',
    '#collapsed' => false,
    '#title' => t('Database account details'),
  );
  $form['db_details']['help'] = array(
    '#type' => 'requirement_help',
    '#requirement' => 'mysql_user',
    '#configuration' => HOSTING_HELP_COLLAPSED,
    '#summary' => HOSTING_HELP_COLLAPSED,
  );
  $form['db_details']['db_user'] = $form['db_user'];
  unset($form['db_user']);
  $form['db_details']['db_passwd'] = $form['db_passwd'];
  unset($form['db_passwd']);
  return hosting_wizard_form('provision/db', $form);
}