You are here

public function N1EDConfigForm::buildForm in N1ED - Visual editor as CKEditor plugin with Bootstrap support 8.2

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/N1EDConfigForm.php, line 24

Class

N1EDConfigForm

Namespace

Drupal\n1ed\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('n1ed.settings');
  $form['title'] = [
    '#type' => 'html_tag',
    '#tag' => 'p',
    '#value' => $this
      ->t('All the main N1ED settings are inside <a href=":formats">Text Formats</a>.<br/><b>This section is for advanced users only</b>. Be sure you know what you do to avoid breaking N1ED normal working.', [
      ":formats" => Url::fromRoute('filter.admin_overview')
        ->toString(),
    ]),
  ];
  $form['version'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('N1ED version'),
    '#default_value' => $config
      ->get('version') ?: '',
    '#required' => FALSE,
  ];
  $form['versioin_text'] = [
    '#type' => 'html_tag',
    '#tag' => 'p',
    '#attributes' => [
      'style' => 'margin-bottom:12px;margin-top: -4px;',
    ],
    '#value' => $this
      ->t('Leave it blank to have always the latest version.'),
  ];
  $form['urlCache'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('URL of the cache server'),
    '#default_value' => $config
      ->get('urlCache') ?: '',
    '#required' => FALSE,
  ];
  $form['urlCache_text'] = [
    '#type' => 'html_tag',
    '#tag' => 'p',
    '#attributes' => [
      'style' => 'margin-bottom:12px;margin-top: -4px;',
    ],
    '#value' => $this
      ->t('Leave it blank to disable caching.'),
  ];
  return parent::buildForm($form, $form_state);
}