public function miniorange_2fa_RemoveLicense::buildForm in Google Authenticator / 2 Factor Authentication - 2FA 8
Form constructor.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array The form structure.
Overrides FormInterface::buildForm
File
- src/
Form/ miniorange_2fa_RemoveLicense.php, line 21
Class
Namespace
Drupal\miniorange_2fa\FormCode
public function buildForm(array $form, FormStateInterface $form_state, $options = NULL) {
$form['#prefix'] = '<div id="modal_example_form">';
$form['#suffix'] = '</div>';
$form['status_messages'] = [
'#type' => 'status_messages',
'#weight' => -10,
];
$form['miniorange_saml_content'] = array(
'#markup' => '<p>Are you sure you want to remove your account?<br><span id="miniorange_2fa_remove_account_warning">Warning:</span> The configurations saved will be lost.</p> ',
);
$form['actions'] = array(
'#type' => 'actions',
);
$form['actions']['send'] = [
'#type' => 'submit',
'#value' => $this
->t('Confirm'),
'#attributes' => [
'class' => [
'use-ajax',
],
],
'#ajax' => [
'callback' => [
$this,
'submitModalFormAjax',
],
'event' => 'click',
],
];
$form['#attached']['library'][] = 'core/drupal.dialog.ajax';
return $form;
}