summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/system.admin.inc4
-rw-r--r--modules/system/system.module17
2 files changed, 17 insertions, 4 deletions
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index aa1d2e9d1..7e672950f 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -2054,10 +2054,6 @@ function system_batch_page() {
require_once DRUPAL_ROOT . '/includes/batch.inc';
$output = _batch_page();
- // Use the same theme that the page that started the batch.
- $batch = &batch_get();
- $GLOBALS['custom_theme'] = $batch['theme'];
-
if ($output === FALSE) {
drupal_access_denied();
}
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() {