You are here

function toolbar_visibility_page_top in Toolbar Visibility 8

File

./toolbar_visibility.module, line 27
Contains toolbar_visibility.module.

Code

function toolbar_visibility_page_top(array &$page_top) {
  $current_theme_name = \Drupal::theme()
    ->getActiveTheme()
    ->getName();
  $theme_to_exclude_toolbar = \Drupal::config('toolbar_visibility.default_config')
    ->get('toolbar_visibility_theme');
  if ($theme_to_exclude_toolbar) {

    //dpm($theme_to_exclude_toolbar);
    foreach ($theme_to_exclude_toolbar as $key => $theme_name) {
      if ($theme_name == $current_theme_name) {
        if (isset($page_top['toolbar'])) {
          unset($page_top['toolbar']);
        }
      }
    }
  }
}