You are here

public function OEmbedFilter::settingsForm in Gutenberg 8

Define settings for text filter.

Overrides FilterBase::settingsForm

File

src/Plugin/Filter/OEmbedFilter.php, line 184

Class

OEmbedFilter
Class OEmbedFilter.

Namespace

Drupal\gutenberg\Plugin\Filter

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
  $form['oembed_providers'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Providers'),
    '#default_value' => $this->settings['oembed_providers'],
    '#description' => $this
      ->t('A list of oEmbed providers. Add your own by adding a new line and using this pattern: [Url to match] | [oEmbed endpoint] | [Use regex (true or false)]'),
  ];
  $form['oembed_maxwidth'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Maximum width of media embed'),
    '#default_value' => $this->settings['oembed_maxwidth'],
    '#description' => $this
      ->t('Set the maximum width of an embedded media. The unit is in pixels, but only put a number in the textbox.'),
  ];
  return $form;
}