You are here

public function ConfigForm::buildForm in Zoom API 8

Same name and namespace in other branches
  1. 2.0.x src/Form/ConfigForm.php \Drupal\zoomapi\Form\ConfigForm::buildForm()

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 ConfigFormBase::buildForm

File

src/Form/ConfigForm.php, line 23

Class

ConfigForm
The config form.

Namespace

Drupal\zoomapi\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->getConfig();
  $form['base_uri'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Zoom API Base URL'),
    '#default_value' => $config
      ->get('base_uri'),
    '#description' => $this
      ->t('Do not inclue trailing slash. Ex. https://api.zoom.us/v2'),
  ];
  $form['api_key'] = [
    '#type' => 'key_select',
    '#title' => $this
      ->t('API Key'),
    '#default_value' => $config
      ->get('api_key'),
    '#description' => $this
      ->t('The Zoom API private key.'),
  ];
  $form['api_secret'] = [
    '#type' => 'key_select',
    '#title' => $this
      ->t('API Secret'),
    '#default_value' => $config
      ->get('api_secret'),
    '#description' => $this
      ->t('The Zoom API secret.'),
  ];
  $form['webhook_verification_token'] = [
    '#type' => 'key_select',
    '#title' => $this
      ->t('Webhook Verification Token'),
    '#default_value' => $config
      ->get('webhook_verification_token'),
    '#description' => $this
      ->t('Use this verification token to validate an event notification request from zoom.us for this app. Provided by Zoom.'),
  ];
  return parent::buildForm($form, $form_state);
}