You are here

public function TfaTestSendSetup::getSetupForm in Two-factor Authentication (TFA) 7.2

Get setup form.

Parameters

array $form: The form array structure.

array $form_state: The current form state array.

Return value

array Form array structure.

Overrides TfaSetupPluginInterface::getSetupForm

File

tests/includes/tfa_test.send.inc, line 125
Tests for the TfaSendPluginInterface.

Class

TfaTestSendSetup
Class TfaTestSendSetup.

Code

public function getSetupForm(array $form, array &$form_state) {
  if (empty($form_state['storage']['location'])) {
    $form['location'] = array(
      '#type' => 'textfield',
      '#title' => t('Location to send code'),
      '#required' => TRUE,
    );
    $form['actions']['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Submit'),
    );
  }
  else {

    // Include code entry form.
    $form = $this
      ->getForm($form, $form_state);
  }
  return $form;
}