You are here

function _views_data_export_batch_process in Views data export 6.3

Same name and namespace in other branches
  1. 6 views_data_export.module \_views_data_export_batch_process()
  2. 6.2 views_data_export.module \_views_data_export_batch_process()
  3. 7.4 views_data_export.module \_views_data_export_batch_process()
  4. 7 views_data_export.module \_views_data_export_batch_process()
  5. 7.3 views_data_export.module \_views_data_export_batch_process()

Batch API callback. Handles all batching operations by executing the appropriate view.

1 string reference to '_views_data_export_batch_process'
views_data_export_plugin_display_export::execute_initial in plugins/views_data_export_plugin_display_export.inc
Initializes the whole export process and starts off the batch process.

File

./views_data_export.module, line 146
Provides the ability to export to specific

Code

function _views_data_export_batch_process($export_id, $display_id, &$context) {

  // Don't show the admin menu on batch page, some people don't like it.
  if (module_exists('admin_menu')) {
    module_invoke('admin_menu', 'suppress');
  }

  // Fetch the view in question from our cache
  $view = views_data_export_view_retrieve($export_id);
  $view
    ->set_display($display_id);

  // Inform the data_export display which export it corresponds to and execute
  $view->display_handler->batched_execution_state->eid = $export_id;
  $view
    ->execute_display($display_id);

  // Update batch api progress information
  $sandbox = $view->display_handler->batched_execution_state->sandbox;
  $context['finished'] = $sandbox['finished'];
  $context['message'] = $sandbox['message'];
  views_data_export_view_store($export_id, $view);
}