You are here

function _bootstrap_library_check_theme in Bootstrap Library 8

Verify if current theme is selected.

1 call to _bootstrap_library_check_theme()
bootstrap_library_page_attachments in ./bootstrap_library.module
Implements hook_page_attachments().

File

./bootstrap_library.module, line 85
Primarily Drupal hooks.

Code

function _bootstrap_library_check_theme() {
  $config = \Drupal::config('bootstrap_library.settings');
  $theme = \Drupal::theme()
    ->getActiveTheme()
    ->getName();
  $valid_themes = $config
    ->get('theme.themes');
  $visibility = $config
    ->get('theme.visibility');
  $theme_match = !empty($valid_themes) && in_array($theme, $valid_themes);
  $theme_match = !($visibility xor $theme_match);
  return $theme_match;
}