You are here

function toolbar_visibility_page_alter in Toolbar Visibility 7

Implements hook_page_alter().

File

./toolbar_visibility.module, line 38
Give a way to remove the Drupal Toolbar on selected themes.

Code

function toolbar_visibility_page_alter(&$page) {
  global $theme_key;
  $themes = list_themes();
  $theme_object = $themes[$theme_key];
  if (variable_get('toolbar_visibility_theme', NULL)) {
    if (in_array($theme_object->name, variable_get('toolbar_visibility_theme', NULL))) {
      if (isset($page['page_top']['toolbar'])) {
        unset($page['page_top']['toolbar']);
      }
    }
  }
}