function _system_is_claro_admin_and_not_active in Drupal 9
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 _system_is_claro_admin_and_not_active()
- system_library_info_alter in core/
modules/ system/ system.module - Implements hook_library_info_alter().
- system_preprocess_toolbar in core/
modules/ system/ system.module - Implements hook_preprocess_toolbar().
- system_theme_registry_alter in core/
modules/ system/ system.module - Implements hook_theme_registry_alter().
File
- core/
modules/ system/ system.module, line 1285 - Configuration system that lets administrators modify the workings of the site.
Code
function _system_is_claro_admin_and_not_active() {
$admin_theme = \Drupal::configFactory()
->get('system.theme')
->get('admin');
$active_theme = \Drupal::theme()
->getActiveTheme()
->getName();
return $active_theme !== 'claro' && $admin_theme === 'claro';
}