You are here

public function EditorButtonLinkFilter::settingsForm in Editor Button Link 8

Generates a filter's settings form.

Parameters

array $form: A minimally prepopulated form array.

\Drupal\Core\Form\FormStateInterface $form_state: The state of the (entire) configuration form.

Return value

array The $form array with additional form elements for the settings of this filter. The submitted form values should match $this->settings.

Overrides FilterBase::settingsForm

File

src/Plugin/Filter/EditorButtonLinkFilter.php, line 31

Class

EditorButtonLinkFilter
Convert data-drupal-button-link to classes for each link.

Namespace

Drupal\editor_button_link\Plugin\Filter

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
  $form['button_link_options'] = [
    '#type' => 'textarea',
    '#description' => $this
      ->t('The possible values this option can contain. Enter one value per line, in the format key|label.'),
    '#title' => $this
      ->t('Button type'),
    '#default_value' => $this->settings['button_link_options'],
    '#required' => TRUE,
  ];
  $form['button_link_size_options'] = [
    '#type' => 'textarea',
    '#description' => $this
      ->t('The possible values this option can contain. Enter one value per line, in the format key|label.'),
    '#title' => $this
      ->t('Button size'),
    '#default_value' => $this->settings['button_link_size_options'],
  ];
  $form['button_link_style_options'] = [
    '#type' => 'textarea',
    '#description' => $this
      ->t('The possible values this option can contain. Enter one value per line, in the format key|label.'),
    '#title' => $this
      ->t('Button style'),
    '#default_value' => $this->settings['button_link_style_options'],
  ];
  return $form;
}