class CssEditorThemeNegotiator in CSS Editor 8
Hierarchy
- class \Drupal\css_editor\Theme\CssEditorThemeNegotiator implements ThemeNegotiatorInterface
Expanded class hierarchy of CssEditorThemeNegotiator
1 string reference to 'CssEditorThemeNegotiator'
1 service uses CssEditorThemeNegotiator
File
- src/
Theme/ CssEditorThemeNegotiator.php, line 9
Namespace
Drupal\css_editor\ThemeView source
class CssEditorThemeNegotiator implements ThemeNegotiatorInterface {
/**
* {@inheritdoc}
*/
public function applies(RouteMatchInterface $route_match) {
return isset($_REQUEST['theme']) && isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] == Url::fromUri('internal:/admin/appearance/settings/' . $_REQUEST['theme'], array(
'absolute' => TRUE,
))
->toString();
}
/**
* {@inheritdoc}
*/
public function determineActiveTheme(RouteMatchInterface $route_match) {
return $_REQUEST['theme'];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CssEditorThemeNegotiator:: |
public | function |
Whether this theme negotiator should be used to set the theme. Overrides ThemeNegotiatorInterface:: |
|
CssEditorThemeNegotiator:: |
public | function |
Determine the active theme for the request. Overrides ThemeNegotiatorInterface:: |