You are here

private function AdminSettingsForm::buildFieldMappingsForm in Acquia Lift Connector 8

Same name and namespace in other branches
  1. 8.4 src/Form/AdminSettingsForm.php \Drupal\acquia_lift\Form\AdminSettingsForm::buildFieldMappingsForm()
  2. 8.3 src/Form/AdminSettingsForm.php \Drupal\acquia_lift\Form\AdminSettingsForm::buildFieldMappingsForm()

Build field mappings form.

Return value

array Field mappings form.

1 call to AdminSettingsForm::buildFieldMappingsForm()
AdminSettingsForm::buildForm in src/Form/AdminSettingsForm.php
Form constructor.

File

src/Form/AdminSettingsForm.php, line 195
Contains \Drupal\acquia_lift\Form\AdminSettingsForm.

Class

AdminSettingsForm
Defines a form that configures settings.

Namespace

Drupal\acquia_lift\Form

Code

private function buildFieldMappingsForm() {
  $field_mappings_settings = $this
    ->config('acquia_lift.settings')
    ->get('field_mappings');
  $field_names = $this
    ->getTaxonomyTermFieldNames();
  $form = [
    '#title' => t('Field Mappings'),
    '#type' => 'details',
    '#tree' => TRUE,
    '#group' => 'data_collection_settings',
  ];
  $form['content_section'] = [
    '#type' => 'select',
    '#title' => t('Content Section'),
    '#empty_value' => '',
    '#options' => $field_names,
    '#default_value' => $field_mappings_settings['content_section'],
  ];
  $form['content_keywords'] = [
    '#type' => 'select',
    '#title' => t('Content Keywords'),
    '#empty_value' => '',
    '#options' => $field_names,
    '#default_value' => $field_mappings_settings['content_keywords'],
  ];
  $form['persona'] = [
    '#type' => 'select',
    '#title' => t('Persona'),
    '#empty_value' => '',
    '#options' => $field_names,
    '#default_value' => $field_mappings_settings['persona'],
  ];
  return $form;
}