You are here

public function VboExportCsv::buildPreConfigurationForm in VBO export 8.3

Same name and namespace in other branches
  1. 8.2 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 25

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;
}