From 0e05035b7104baa80614eefab90b6d90996ca3dc Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Tue, 27 Oct 2009 04:12:39 +0000 Subject: =?UTF-8?q?#610204=20by=20effulgentsia,=20G=C3=A1bor=20Hojtsy,=20s?= =?UTF-8?q?un,=20Damien=20Tournoud=20and=20ksenzee:=20API=20changes=20to?= =?UTF-8?q?=20support=20overlays:=20lays=20ground=20work=20for=20implement?= =?UTF-8?q?ation.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- includes/batch.inc | 13 +++++++++++-- includes/form.inc | 5 ++++- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'includes') diff --git a/includes/batch.inc b/includes/batch.inc index 10fc2a737..9f094eab6 100644 --- a/includes/batch.inc +++ b/includes/batch.inc @@ -109,11 +109,15 @@ function _batch_progress_page_js() { $current_set = _batch_current_set(); drupal_set_title($current_set['title'], PASS_THROUGH); + // Merge required query parameters for batch processing into those provided by + // batch_set() or hook_batch_alter(). + $batch['url_options']['query']['id'] = $batch['id']; + $js_setting = array( 'batch' => array( 'errorMessage' => $current_set['error_message'] . '
' . $batch['error_message'], 'initMessage' => $current_set['init_message'], - 'uri' => url($batch['url'], array('query' => array('id' => $batch['id']))), + 'uri' => url($batch['url'], $batch['url_options']), ), ); drupal_add_js($js_setting, 'setting'); @@ -189,7 +193,12 @@ function _batch_progress_page_nojs() { ob_end_clean(); } - $url = url($batch['url'], array('query' => array('id' => $batch['id'], 'op' => $new_op))); + // Merge required query parameters for batch processing into those provided by + // batch_set() or hook_batch_alter(). + $batch['url_options']['query']['id'] = $batch['id']; + $batch['url_options']['query']['op'] = $new_op; + + $url = url($batch['url'], $batch['url_options']); drupal_add_html_head(''); return theme('progress_bar', array('percent' => $percentage, 'message' => $message)); diff --git a/includes/form.inc b/includes/form.inc index e2d281384..0de410ea5 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -2963,7 +2963,9 @@ function _form_set_class(&$element, $class = array()) { * 'operations' and 'finished' functions, for instance if they don't * reside in the original '.module' file. The path should be relative to * the base_path(), and thus should be built using drupal_get_path(). - * 'css' : an array of paths to CSS files to be used on the progress page. + * 'css': an array of paths to CSS files to be used on the progress page. + * 'url_options': options passed to url() when constructing redirect + * URLs for the batch. * * Operations are added as new batch sets. Batch sets are used to ensure * clean code independence, ensuring that several batches submitted by @@ -3051,6 +3053,7 @@ function batch_process($redirect = NULL, $url = 'batch', $redirect_callback = 'd 'current_set' => 0, 'progressive' => TRUE, 'url' => $url, + 'url_options' => array(), 'source_page' => $_GET['q'], 'redirect' => $redirect, 'theme' => $GLOBALS['theme_key'], -- cgit v1.2.3