diff --git a/_build/config.json b/_build/config.json index 80b04526..0ff33d38 100644 --- a/_build/config.json +++ b/_build/config.json @@ -490,8 +490,12 @@ "type": "textfield", "area": "system", "value": "" - } - ] + },{ + "key": "export_csv_delimiter", + "type": "textfield", + "area": "system", + "value": ";" + }] }, "database": { "tables": [ diff --git a/core/components/formit/processors/mgr/form/export.class.php b/core/components/formit/processors/mgr/form/export.class.php index e7a9e9f4..f0f15ff9 100644 --- a/core/components/formit/processors/mgr/form/export.class.php +++ b/core/components/formit/processors/mgr/form/export.class.php @@ -68,7 +68,7 @@ public function process() public function createCsv($exportPath, $file, array $data) { - + $delimiter = $this->modx->getOption('formit.export_csv_delimiter', null, ';'); $keys = array('IP', 'Date', 'Form'); $handle = $exportPath.$file; @@ -92,7 +92,7 @@ function () { $defaultArr ); - fputcsv($fp, $keys, ';'); + fputcsv($fp, $keys, $delimiter); $dateFormat = $this->modx->getOption('manager_date_format').' '.$this->modx->getOption('manager_time_format'); foreach ($data['results'] as $object) { $objectArray = $this->prepareRow($object); @@ -103,7 +103,7 @@ function () { foreach ($objectArray['values'] as $vk => $vv) { $objectArray['values'][$vk] = (is_array($vv)) ? implode(',', $vv) : $vv; } - fputcsv($fp, array_merge($defaultArr, $objectArray['values']), ';'); + fputcsv($fp, array_merge($defaultArr, $objectArray['values']), $delimiter); } } fclose($fp);