You are here

class CssEditorThemeNegotiator in CSS Editor 8

Hierarchy

Expanded class hierarchy of CssEditorThemeNegotiator

1 string reference to 'CssEditorThemeNegotiator'
css_editor.services.yml in ./css_editor.services.yml
css_editor.services.yml
1 service uses CssEditorThemeNegotiator
theme.negotiator.css_editor in ./css_editor.services.yml
Drupal\css_editor\Theme\CssEditorThemeNegotiator

File

src/Theme/CssEditorThemeNegotiator.php, line 9

Namespace

Drupal\css_editor\Theme
View 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

Namesort descending Modifiers Type Description Overrides
CssEditorThemeNegotiator::applies public function Whether this theme negotiator should be used to set the theme. Overrides ThemeNegotiatorInterface::applies
CssEditorThemeNegotiator::determineActiveTheme public function Determine the active theme for the request. Overrides ThemeNegotiatorInterface::determineActiveTheme