You are here

public function EloquaSettingsForm::buildForm in Eloqua 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 ConfigFormBase::buildForm

File

src/Form/EloquaSettingsForm.php, line 90
Contains \Drupal\eloqua\Form\EloquaSettingsForm.

Class

EloquaSettingsForm
Configure Eloqua settings for this site.

Namespace

Drupal\Eloqua\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildForm($form, $form_state);

  // Load our default configuration settings.
  $config = $this
    ->config('eloqua.settings');
  $form['eloqua_settings'] = array(
    '#type' => 'details',
    '#title' => $this
      ->t('General Settings'),
    '#description' => $this
      ->t('General settings applicable to all Eloqua functionality.'),
    '#open' => TRUE,
  );
  $form['eloqua_settings']['site_identifier'] = array(
    '#type' => 'textfield',
    '#title' => $this
      ->t('Site Identifier'),
    '#description' => $this
      ->t('The Eloqua Site ID for this web site. Required to include the Eloqua tracking code.'),
    '#required' => TRUE,
    '#size' => 20,
    '#maxlength' => 64,
    '#default_value' => $config
      ->get('site_identifier'),
  );
  $form['tracking_scope'] = $this
    ->buildTrackignScopeInterface([], $form_state);
  return parent::buildForm($form, $form_state);
}