summaryrefslogtreecommitdiff
path: root/modules/system/system.module
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-11-02 15:57:33 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-11-02 15:57:33 +0000
commit032fe0a66d97469609f5fe7cc6be242765042a63 (patch)
treee4c3fb97ff1319a39b6086f29673d357f3f0fcfe /modules/system/system.module
parent4363c22b0398472b62a87f9f5c2b7ed88a393a77 (diff)
downloadbrdo-032fe0a66d97469609f5fe7cc6be242765042a63.tar.gz
brdo-032fe0a66d97469609f5fe7cc6be242765042a63.tar.bz2
#539022 follow-up by David_Rothstein: Batch API should use the current theme to run the batches.
Diffstat (limited to 'modules/system/system.module')
-rw-r--r--modules/system/system.module17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/system/system.module b/modules/system/system.module
index 4b69e964b..7398653ad 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -993,6 +993,7 @@ function system_menu() {
$items['batch'] = array(
'page callback' => 'system_batch_page',
'access callback' => TRUE,
+ 'theme callback' => '_system_batch_theme',
'type' => MENU_CALLBACK,
'file' => 'system.admin.inc',
);
@@ -1000,6 +1001,22 @@ function system_menu() {
}
/**
+ * Theme callback for the default batch page.
+ */
+function _system_batch_theme() {
+ // Retrieve the current state of the batch.
+ $batch = &batch_get();
+ if (!$batch && isset($_REQUEST['id'])) {
+ require_once DRUPAL_ROOT . '/includes/batch.inc';
+ $batch = batch_load($_REQUEST['id']);
+ }
+ // Use the same theme as the page that started the batch.
+ if (!empty($batch['theme'])) {
+ return $batch['theme'];
+ }
+}
+
+/**
* Implementation of hook_library().
*/
function system_library() {