You are here

protected function SetupForm::buildSetupForm in Acquia Connector 8

Same name and namespace in other branches
  1. 8.2 src/Form/SetupForm.php \Drupal\acquia_connector\Form\SetupForm::buildSetupForm()
  2. 3.x src/Form/SetupForm.php \Drupal\acquia_connector\Form\SetupForm::buildSetupForm()

Build setup form.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state: Form state.

Return value

array Form.

1 call to SetupForm::buildSetupForm()
SetupForm::buildForm in src/Form/SetupForm.php
Form constructor.

File

src/Form/SetupForm.php, line 88

Class

SetupForm
Acquia Connector setup form.

Namespace

Drupal\acquia_connector\Form

Code

protected function buildSetupForm(FormStateInterface &$form_state) {
  $form = [
    '#prefix' => $this
      ->t('Log in or <a href=":url">configure manually</a> to connect your site to the Acquia Subscription.', [
      ':url' => Url::fromRoute('acquia_connector.credentials')
        ->toString(),
    ]),
    'email' => [
      '#type' => 'textfield',
      '#title' => $this
        ->t('Enter the email address you use to login to the Acquia Subscription:'),
      '#required' => TRUE,
    ],
    'pass' => [
      '#type' => 'password',
      '#title' => $this
        ->t('Enter your Acquia Subscription password:'),
      '#description' => $this
        ->t('Your password will not be stored locally and will be sent securely to Acquia.com. <a href=":url" target="_blank">Forgot password?</a>', [
        ':url' => Url::fromUri('https://accounts.acquia.com/user/password')
          ->getUri(),
      ]),
      '#size' => 32,
      '#required' => TRUE,
    ],
    'actions' => [
      '#type' => 'actions',
      'continue' => [
        '#type' => 'submit',
        '#value' => $this
          ->t('Next'),
      ],
      'signup' => [
        '#markup' => $this
          ->t('Need a subscription? <a href=":url">Get one</a>.', [
          ':url' => Url::fromUri('https://www.acquia.com/acquia-cloud-free')
            ->getUri(),
        ]),
      ],
    ],
  ];
  return $form;
}