You are here

function _batch_progress_page_js in Drupal 6

Same name and namespace in other branches
  1. 7 includes/batch.inc \_batch_progress_page_js()

Batch processing page with JavaScript support.

1 call to _batch_progress_page_js()
_batch_start in includes/batch.inc
Initiate the batch processing

File

includes/batch.inc, line 68
Batch processing API for processes to run in multiple HTTP requests.

Code

function _batch_progress_page_js() {
  $batch = batch_get();

  // The first batch set gets to set the page title
  // and the initialization and error messages.
  $current_set = _batch_current_set();
  drupal_set_title($current_set['title']);
  drupal_add_js('misc/progress.js', 'core', 'header', FALSE, FALSE);
  $url = url($batch['url'], array(
    'query' => array(
      'id' => $batch['id'],
    ),
  ));
  $js_setting = array(
    'batch' => array(
      'errorMessage' => $current_set['error_message'] . '<br/>' . $batch['error_message'],
      'initMessage' => $current_set['init_message'],
      'uri' => $url,
    ),
  );
  drupal_add_js($js_setting, 'setting');
  drupal_add_js('misc/batch.js', 'core', 'header', FALSE, FALSE);
  $output = '<div id="progress"></div>';
  return $output;
}