Same name and namespace in other branches
  1. 8.9.x core/modules/system/src/Theme/BatchNegotiator.php \Drupal\system\Theme\BatchNegotiator::determineActiveTheme()
  2. 9 core/modules/system/src/Theme/BatchNegotiator.php \Drupal\system\Theme\BatchNegotiator::determineActiveTheme()

File

core/modules/system/src/Theme/BatchNegotiator.php, line 52

Class

BatchNegotiator
Sets the active theme for the batch page.

Namespace

Drupal\system\Theme

Code

public function determineActiveTheme(RouteMatchInterface $route_match) {

  // Retrieve the current state of the batch.
  $request = $this->requestStack
    ->getCurrentRequest();
  $batch =& batch_get();
  if (!$batch && $request->request
    ->has('id')) {
    $batch = $this->batchStorage
      ->load($request->request
      ->get('id'));
  }

  // Use the same theme as the page that started the batch.
  if (!empty($batch['theme'])) {
    return $batch['theme'];
  }
}