Révision 7b2d1845
Ajouté par Assos Assos il y a presque 4 ans
drupal7/sites/all/modules/webform/includes/exporters/webform_exporter_delimited.inc | ||
---|---|---|
45 | 45 |
|
46 | 46 |
// Convert tabs. |
47 | 47 |
if ($this->delimiter == "\t") { |
48 |
$extension = 'tsv'; |
|
49 | 48 |
$content_type = 'text/tab-separated-values'; |
50 | 49 |
} |
51 | 50 |
else { |
52 |
$extension = 'csv'; |
|
53 | 51 |
$content_type = 'text/csv'; |
54 | 52 |
} |
55 | 53 |
|
56 | 54 |
drupal_add_http_header('Content-Type', $content_type); |
57 |
drupal_add_http_header('Content-Disposition', "attachment; filename=$filename.$extension"); |
|
55 |
drupal_add_http_header('Content-Disposition', 'attachment; filename=' . $this->get_filename($filename)); |
|
56 |
} |
|
57 |
|
|
58 |
/** |
|
59 |
* {@inheritdoc} |
|
60 |
*/ |
|
61 |
public function get_filename($filename) { |
|
62 |
$extension = ($this->delimiter === "\t") ? 'tsv' : 'csv'; |
|
63 |
return $filename . '.' . $extension; |
|
58 | 64 |
} |
59 | 65 |
|
60 | 66 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules