You are here

public function FeedsCSVParser::configForm in Feeds 8.2

Build configuration form.

Overrides FeedsConfigurable::configForm

File

lib/Drupal/feeds/Plugin/feeds/parser/FeedsCSVParser.php, line 200
Contains the FeedsCSVParser class.

Class

FeedsCSVParser
Defines a CSV feed parser.

Namespace

Drupal\feeds\Plugin\feeds\parser

Code

public function configForm(&$form_state) {
  $form = array();
  $form['delimiter'] = array(
    '#type' => 'select',
    '#title' => t('Default delimiter'),
    '#description' => t('Default field delimiter.'),
    '#options' => array(
      ',' => ',',
      ';' => ';',
      'TAB' => 'TAB',
      '|' => '|',
      '+' => '+',
    ),
    '#default_value' => $this->config['delimiter'],
  );
  $form['no_headers'] = array(
    '#type' => 'checkbox',
    '#title' => t('No headers'),
    '#description' => t('Check if the imported CSV file does not start with a header row. If checked, mapping sources must be named \'0\', \'1\', \'2\' etc.'),
    '#default_value' => $this->config['no_headers'],
  );
  return $form;
}