You are here

public function MiniorangeSAMLRemoveLicense::buildForm in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 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/MiniorangeSAMLRemoveLicense.php, line 22

Class

MiniorangeSAMLRemoveLicense

Namespace

Drupal\miniorange_saml\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $options = NULL) {
  $form['miniorange_saml_markup_library'] = array(
    '#attached' => array(
      'library' => array(
        'miniorange_saml/miniorange_saml.admin',
      ),
    ),
  );
  $form['#prefix'] = '<div id="modal_example_form">';
  $form['#suffix'] = '</div>';
  $form['status_messages'] = [
    '#type' => 'status_messages',
    '#weight' => -10,
  ];
  $form['miniorange_saml_content'] = array(
    '#markup' => t('Are you sure you want to remove account? The configurations saved will not be lost.'),
  );
  $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;
}