function ToolbarThemeHooks::isClaroAdminAndNotActive

Same name and namespace in other branches
  1. 11.x core/modules/toolbar/src/Hook/ToolbarThemeHooks.php \Drupal\toolbar\Hook\ToolbarThemeHooks::isClaroAdminAndNotActive()

Determines if Claro is the admin theme but not the active theme.

Return value

bool TRUE if Claro is the admin theme but not the active theme.

3 calls to ToolbarThemeHooks::isClaroAdminAndNotActive()
ToolbarThemeHooks::libraryInfoAlter in core/modules/toolbar/src/Hook/ToolbarThemeHooks.php
Implements hook_library_info_alter().
ToolbarThemeHooks::preprocessToolbarForClaro in core/modules/toolbar/src/Hook/ToolbarThemeHooks.php
Implements hook_preprocess_toolbar().
ToolbarThemeHooks::themeRegistryAlter in core/modules/toolbar/src/Hook/ToolbarThemeHooks.php
Implements hook_theme_registry_alter().

File

core/modules/toolbar/src/Hook/ToolbarThemeHooks.php, line 199

Class

ToolbarThemeHooks
Hook implementations for toolbar.

Namespace

Drupal\toolbar\Hook

Code

protected function isClaroAdminAndNotActive() {
  $admin_theme = $this->configFactory
    ->get('system.theme')
    ->get('admin');
  $active_theme = $this->themeManager
    ->getActiveTheme()
    ->getName();
  return $active_theme !== 'claro' && $admin_theme === 'claro';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.