public function ConfigForm::buildForm in Zoom API 2.0.x
Same name and namespace in other branches
- 8 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\FormCode
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'),
'#required' => TRUE,
'#empty_option' => $this
->t('- Select -'),
];
$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.'),
'#required' => TRUE,
'#empty_option' => $this
->t('- Select -'),
];
$form['api_secret'] = [
'#type' => 'key_select',
'#title' => $this
->t('API Secret'),
'#default_value' => $config
->get('api_secret'),
'#description' => $this
->t('The Zoom API secret.'),
'#required' => TRUE,
'#empty_option' => $this
->t('- Select -'),
];
$form['webhook_verification_token'] = [
'#type' => 'key_select',
'#title' => $this
->t('Webhook Verification Token'),
'#empty_option' => $this
->t('Not using webhooks'),
'#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);
}