You are here

public function CssEditorThemeNegotiator::applies in CSS Editor 8

Whether this theme negotiator should be used to set the theme.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match object.

Return value

bool TRUE if this negotiator should be used or FALSE to let other negotiators decide.

Overrides ThemeNegotiatorInterface::applies

File

src/Theme/CssEditorThemeNegotiator.php, line 14

Class

CssEditorThemeNegotiator

Namespace

Drupal\css_editor\Theme

Code

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();
}