You are here

public function SettingsForm::buildForm in Salesforce Suite 8.3

Same name in this branch
  1. 8.3 src/Form/SettingsForm.php \Drupal\salesforce\Form\SettingsForm::buildForm()
  2. 8.3 modules/salesforce_logger/src/Form/SettingsForm.php \Drupal\salesforce_logger\Form\SettingsForm::buildForm()
  3. 8.3 modules/salesforce_encrypt/src/Form/SettingsForm.php \Drupal\salesforce_encrypt\Form\SettingsForm::buildForm()
Same name and namespace in other branches
  1. 8.4 modules/salesforce_logger/src/Form/SettingsForm.php \Drupal\salesforce_logger\Form\SettingsForm::buildForm()
  2. 5.0.x modules/salesforce_logger/src/Form/SettingsForm.php \Drupal\salesforce_logger\Form\SettingsForm::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

modules/salesforce_logger/src/Form/SettingsForm.php, line 33

Class

SettingsForm
Creates authorization form for Salesforce.

Namespace

Drupal\salesforce_logger\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('salesforce_logger.settings');
  $form['log_level'] = [
    '#title' => $this
      ->t('Salesforce Logger log level'),
    '#type' => 'radios',
    '#options' => [
      SalesforceEvents::ERROR => $this
        ->t('Log errors only'),
      SalesforceEvents::WARNING => $this
        ->t('Log warnings and errors'),
      SalesforceEvents::NOTICE => $this
        ->t('Log all salesforce events'),
    ],
    '#default_value' => $config
      ->get('log_level'),
  ];
  $form = parent::buildForm($form, $form_state);
  return $form;
}