You are here

public function SettingsForm::buildForm in Views TimelineJS integration 8.3

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/SettingsForm.php, line 30

Class

SettingsForm
Configure site-wide settings for Views TimelineJS.

Namespace

Drupal\views_timelinejs\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('views_timelinejs.settings');
  $form['library_location'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('TimelineJS library location'),
    '#description' => $this
      ->t('If serving the files from a local path, the library MUST be located in libraries/TimelineJS3.  See the module README file for more information.'),
    '#options' => [
      'cdn' => $this
        ->t('NU Knight Lab CDN'),
      'local' => $this
        ->t('Local path (libraries/TimelineJS3)'),
    ],
    '#default_value' => $config
      ->get('library_location'),
  ];
  return parent::buildForm($form, $form_state);
}