You are here

function hosting_db_server_form in Hosting 5

Implementation of hook_form().

File

db_server/hosting_db_server.module, line 121

Code

function hosting_db_server_form(&$node) {
  $form['title'] = array(
    '#type' => 'textfield',
    '#title' => t('Hostname'),
    '#description' => t('The address of the database server to connect to.'),
    '#size' => 30,
    '#default_value' => $node->title,
    '#maxlength' => 64,
    '#weight' => 0,
  );
  $form['db_user'] = array(
    '#type' => 'textfield',
    '#required' => TRUE,
    '#title' => t('Username'),
    '#description' => t('The user that will be used to create users and databases for new sites.'),
    '#size' => 40,
    '#default_value' => $node->db_user,
    '#maxlength' => 64,
    '#weight' => 5,
  );
  if ($node->db_passwd) {
    $passwd_description = t('<strong>You have already set a password for this database server.</strong><br />');
  }
  $form['db_passwd'] = array(
    '#type' => 'password_confirm',
    '#required' => $node->db_passwd ? FALSE : TRUE,
    '#description' => $passwd_description . t('The user account that will be used to create new mysql users and databases for new sites'),
    '#size' => 30,
    '#weight' => 10,
  );
  return $form;
}