You are here

public function TextEncoder::buildConfigurationForm in Feeds extensible parsers 8

Returns the configuration form to select encodings.

Parameters

array $form: The current form.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

Return value

array The modified form array.

Overrides EncoderInterface::buildConfigurationForm

File

src/Encoder/TextEncoder.php, line 55

Class

TextEncoder
Generic text encoder.

Namespace

Drupal\feeds_ex\Encoder

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
  if (!$this->isMultibyte) {
    return $form;
  }
  $args = [
    '%encodings' => implode(', ', mb_detect_order()),
  ];
  $form['source_encoding'] = [
    '#type' => 'textfield',
    '#title' => t('Source encoding'),
    '#description' => t('The possible encodings of the source files. auto: %encodings', $args),
    '#default_value' => implode(', ', $this->encodingList),
    '#autocomplete_path' => '_feeds_ex/encoding_autocomplete',
    '#maxlength' => 1024,
  ];
  return $form;
}