Révision 01f36513
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/webform/includes/exporters/webform_exporter_delimited.inc | ||
---|---|---|
1 | 1 |
<?php |
2 | 2 |
|
3 | 3 |
/** |
4 |
* @file |
|
5 | 4 |
* Webform exporter for creating CSV/TSV delimited files. |
6 | 5 |
*/ |
7 |
|
|
8 |
/** |
|
9 |
* |
|
10 |
*/ |
|
11 | 6 |
class webform_exporter_delimited extends webform_exporter { |
12 | 7 |
public $line_ending; |
13 | 8 |
public $delimiter; |
14 | 9 |
|
15 | 10 |
/** |
16 |
* |
|
11 |
* {@inheritdoc}
|
|
17 | 12 |
*/ |
18 | 13 |
public function __construct($options) { |
19 | 14 |
$this->line_ending = webform_variable_get('webform_csv_line_ending'); |
... | ... | |
27 | 22 |
} |
28 | 23 |
|
29 | 24 |
/** |
30 |
* |
|
25 |
* {@inheritdoc}
|
|
31 | 26 |
*/ |
32 |
public function add_row(&$file_handle, $data, $row_count) { |
|
27 |
public function add_row(&$file_handle, array $data, $row_count) {
|
|
33 | 28 |
foreach ($data as $key => $value) { |
34 | 29 |
// Escape inner quotes and wrap all contents in new quotes. |
35 | 30 |
$data[$key] = '"' . str_replace('"', '""', $data[$key]) . '"'; |
... | ... | |
43 | 38 |
} |
44 | 39 |
|
45 | 40 |
/** |
46 |
* |
|
41 |
* {@inheritdoc}
|
|
47 | 42 |
*/ |
48 | 43 |
public function set_headers($filename) { |
49 | 44 |
parent::set_headers($filename); |
Formats disponibles : Unified diff
Weekly update of contrib modules