You are here

function hostmaster_form in Hostmaster (Aegir) 5.x

Form modifier similar to confirm_form

Handles some bookkeeping like adding the js and css, embedded the right classes, and most importantly : adding the wizard_form_submit to the #submit element. Without this, you would never be forwarded to the next page.

8 calls to hostmaster_form()
hostmaster_task_dbserver in ./hostmaster.forms.inc
Database configuration form
hostmaster_task_features in ./hostmaster.forms.inc
hostmaster_task_filesystem in ./hostmaster.forms.inc
Configures web_server_node_form paths.
hostmaster_task_import in ./hostmaster.forms.inc
hostmaster_task_init in ./hostmaster.forms.inc
Form that confirms that cron is running, and that the platform has been successfuly verified

... See full list

File

./hostmaster.profile, line 126

Code

function hostmaster_form($form) {
  global $task;
  $form['#redirect'] = HOSTMASTER_FORM_REDIRECT;
  $form['#prefix'] = '<div id="hosting-wizard-form">';
  $form['#suffix'] = '</div>';
  $form['wizard_form'] = array(
    '#prefix' => '<div id="hosting-wizard-form-buttons">',
    '#suffix' => '</div>',
    '#weight' => 100,
  );
  if (HOSTMASTER_CURRENT_TASK != 'intro') {

    // add a back button
    $button = array(
      '#type' => 'submit',
      '#value' => '<- Previous',
    );
    $button['#submit'][] = 'hostmaster_form_previous';
    $form['wizard_form']['back'] = $button;
  }

  // add a next button
  $button = array(
    '#type' => 'submit',
    '#value' => 'Next ->',
  );

  // only validate when next is pressed
  // also inherit the whole form's validate callback
  $button['#validate'] = $form['#validate'];
  $button['#validate'][] = 'hostmaster_form_validate';
  unset($form['#validate']);
  if ($form['#node']) {
    $button['#submit'][] = 'node_form_submit';
  }
  $button['#submit'][] = 'hostmaster_form_next';
  $form['wizard_form']['submit'] = $button;
  return $form;
}