class SchedulerThemeNegotiator in Scheduler 8
Same name and namespace in other branches
- 2.x src/Theme/SchedulerThemeNegotiator.php \Drupal\scheduler\Theme\SchedulerThemeNegotiator
Defines a theme negotiator for the Scheduler routes.
Hierarchy
- class \Drupal\scheduler\Theme\SchedulerThemeNegotiator implements ThemeNegotiatorInterface
Expanded class hierarchy of SchedulerThemeNegotiator
1 string reference to 'SchedulerThemeNegotiator'
1 service uses SchedulerThemeNegotiator
File
- src/
Theme/ SchedulerThemeNegotiator.php, line 11
Namespace
Drupal\scheduler\ThemeView source
class SchedulerThemeNegotiator implements ThemeNegotiatorInterface {
/**
* {@inheritdoc}
*/
public function applies(RouteMatchInterface $route_match) {
// Use the Scheduler theme negotiator for the user 'scheduled' tab.
$applies = $route_match
->getRouteName() == 'view.scheduler_scheduled_content.user_page';
return $applies;
}
/**
* {@inheritdoc}
*/
public function determineActiveTheme(RouteMatchInterface $route_match) {
// Return the admin theme.
$config = \Drupal::service('config.factory')
->getEditable('system.theme');
$admin_theme = $config
->get('admin');
return $admin_theme;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SchedulerThemeNegotiator:: |
public | function |
Whether this theme negotiator should be used to set the theme. Overrides ThemeNegotiatorInterface:: |
|
SchedulerThemeNegotiator:: |
public | function |
Determine the active theme for the request. Overrides ThemeNegotiatorInterface:: |