function sheetnode_phpexcel_batch_export in Sheetnode 6
Same name and namespace in other branches
- 7.2 modules/sheetnode_phpexcel/sheetnode_phpexcel.module \sheetnode_phpexcel_batch_export()
- 7 modules/sheetnode_phpexcel/sheetnode_phpexcel.module \sheetnode_phpexcel_batch_export()
API function to batch export several sheets using Batch API.
2 calls to sheetnode_phpexcel_batch_export()
- sheetnode_phpexcel_plugin_style::render in modules/
sheetnode_phpexcel/ sheetnode_phpexcel_plugin_style.inc - _sheetnode_phpexcel_export in modules/
sheetnode_phpexcel/ sheetnode_phpexcel.export.inc - Helper function to export a node using PHPExcel.
File
- modules/
sheetnode_phpexcel/ sheetnode_phpexcel.module, line 103
Code
function sheetnode_phpexcel_batch_export($sheets, $filename, $format, $destination = NULL, $batch = array()) {
$batch += array(
'finished' => '_sheetnode_phpexcel_batch_export_finished',
'title' => t('Exporting spreadsheets'),
'init_message' => t('Export process is in progress. This can take a long time for large sheets...'),
'progress_message' => t('Exported @current out of @total sheets.'),
'error_message' => t('Export process has encountered an error.'),
'file' => drupal_get_path('module', 'sheetnode_phpexcel') . '/sheetnode_phpexcel.export.inc',
);
foreach ($sheets as $title => $socialcalc) {
$batch['operations'][] = array(
'_sheetnode_phpexcel_batch_export_sheet',
array(
$title,
$socialcalc,
$filename,
$format,
$destination ? $destination : referer_uri(),
),
);
}
batch_set($batch);
batch_process('sheetnode/export/ready');
}