You are here

function webform_results_batch_finished in Webform 7.4

Batch API completion callback; Display completion message and cleanup.

1 string reference to 'webform_results_batch_finished'
webform_results_export_batch in includes/webform.report.inc
Return a Batch API array of commands that will generate an export.

File

includes/webform.report.inc, line 1621
This file includes helper functions for creating reports for webform.module.

Code

function webform_results_batch_finished($success, $results, $operations) {
  if ($success) {
    $download_url = url('node/' . $results['node']->nid . '/webform-results/download-file');
    drupal_set_message(t('Export creation complete. Your download should begin now. If it does not start, <a href="!href">download the file here</a>. This file may only be downloaded once.', array(
      '!href' => $download_url,
    )));
  }
  else {
    drupal_set_message(t('An error occurred while generating the export file.'));
    if (isset($results['file_name']) && is_file($results['file_name'])) {
      @unlink($results['file_name']);
    }
  }
}