You are here

function FilterImageResize::settingsForm in Image Resize Filter 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/FilterImageResize.php, line 218

Class

FilterImageResize
Provides a filter to resize images.

Namespace

Drupal\image_resize_filter\Plugin\Filter

Code

function settingsForm(array $form, FormStateInterface $form_state) {
  $settings['image_locations'] = [
    '#type' => 'checkboxes',
    '#title' => $this
      ->t('Resize images stored'),
    '#options' => [
      'local' => $this
        ->t('Locally'),
      'remote' => $this
        ->t('On remote servers (note: this copies <em>all</em> remote images locally)'),
    ],
    '#default_value' => array_keys(array_filter($this->settings['image_locations'])),
    '#description' => $this
      ->t('This option will determine which images will be analyzed for &lt;img&gt; tag differences. Enabling resizing of remote images can have performance impacts, as all images in the filtered text needs to be transferred via HTTP each time the filter cache is cleared.'),
  ];
  return $settings;
}