Révision 7b2d1845
Ajouté par Assos Assos il y a presque 4 ans
drupal7/sites/all/modules/webform/includes/exporters/webform_exporter_excel_xlsx.inc | ||
---|---|---|
155 | 155 |
$zip_filepath = drupal_realpath($zip_uri); |
156 | 156 |
$file_filepath = drupal_realpath($file_uri); |
157 | 157 |
$zip = new ZipArchive(); |
158 |
if ($zip->open($zip_filepath, ZipArchive::CREATE) === TRUE) { |
|
158 |
if ($zip->open($zip_filepath, ZipArchive::CREATE | ZipArchive::OVERWRITE) === TRUE) {
|
|
159 | 159 |
// Create a bare-bones Office Open XML format directory structure. This is |
160 | 160 |
// based on the sample simple XLSX file at |
161 | 161 |
// http://blogs.msdn.com/b/chrisrae/archive/2011/08/18/creating-a-simple-xlsx-from-scratch-using-the-open-xml-sdk.aspx |
... | ... | |
191 | 191 |
*/ |
192 | 192 |
public function set_headers($filename) { |
193 | 193 |
drupal_add_http_header('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); |
194 |
drupal_add_http_header('Content-Disposition', "attachment; filename=$filename.xlsx");
|
|
194 |
drupal_add_http_header('Content-Disposition', 'attachment; filename=' . $this->get_filename($filename));
|
|
195 | 195 |
drupal_add_http_header('Pragma', 'public'); |
196 | 196 |
drupal_add_http_header('Cache-Control', 'max-age=0'); |
197 | 197 |
} |
198 | 198 |
|
199 |
/** |
|
200 |
* {@inheritdoc} |
|
201 |
*/ |
|
202 |
public function get_filename($filename) { |
|
203 |
return $filename . '.xlsx'; |
|
204 |
} |
|
205 |
|
|
199 | 206 |
/** |
200 | 207 |
* Return all the parts needed to assemble a bare-bones XLSX package. |
201 | 208 |
*/ |
Formats disponibles : Unified diff
Weekly update of contrib modules