| Versionen | |
|---|---|
| drupal6 – drupal7 | _batch_progress_page_js() |
Batch processing page with JavaScript support.
includes/
<?php
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;
}
?>
Kommentare
Kommentar hinzufügen