You are here

public function VboExportCsv::buildPreConfigurationForm in VBO export 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/Action/VboExportCsv.php \Drupal\vbo_export\Plugin\Action\VboExportCsv::buildPreConfigurationForm()

Add csv separator setting to preliminary config.

Overrides VboExportBase::buildPreConfigurationForm

File

src/Plugin/Action/VboExportCsv.php, line 27

Class

VboExportCsv
Generates csv.

Namespace

Drupal\vbo_export\Plugin\Action

Code

public function buildPreConfigurationForm(array $form, array $values, FormStateInterface $form_state) {
  $form = parent::buildPreConfigurationForm($form, $values, $form_state);
  $form['separator'] = [
    '#title' => $this
      ->t('CSV separator'),
    '#type' => 'radios',
    '#options' => [
      ';' => $this
        ->t('semicolon ";"'),
      ',' => $this
        ->t('comma ","'),
      '|' => $this
        ->t('pipe "|"'),
    ],
    '#default_value' => isset($values['separator']) ? $values['separator'] : ';',
  ];
  return $form;
}