public function BatchNegotiator::determineActiveTheme in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/src/Theme/BatchNegotiator.php \Drupal\system\Theme\BatchNegotiator::determineActiveTheme()
Determine the active theme for the request.
Parameters
\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match object.
Return value
string|null Returns the active theme name, else return NULL.
Overrides ThemeNegotiatorInterface::determineActiveTheme
File
- core/
modules/ system/ src/ Theme/ BatchNegotiator.php, line 57 - Contains \Drupal\system\Theme\BatchNegotiator.
Class
- BatchNegotiator
- Sets the active theme for the batch page.
Namespace
Drupal\system\ThemeCode
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'];
}
}