VboExportCsv.php in VBO export 8.2
File
src/Plugin/Action/VboExportCsv.php
View source
<?php
namespace Drupal\vbo_export\Plugin\Action;
use Drupal\Core\Form\FormStateInterface;
class VboExportCsv extends VboExportBase {
const THEME = 'vbo_export_content_csv';
const EXTENSION = 'csv';
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;
}
protected function generateOutput() {
$output = parent::generateOutput();
$output = chr(0xef) . chr(0xbb) . chr(0xbf) . (string) $output;
return $output;
}
}