Same name and namespace in other branches
  1. 7.x-1.x easy_breadcrumb.module \easy_breadcrumb_init() 1 comment

Implements hook_init().

File

./easy_breadcrumb.module, line 30

Code

function easy_breadcrumb_init() {
    global $theme;
    $site_theme = variable_get('theme_default', 'bartik');
    $admin_theme = variable_get('admin_theme', 'seven');
    // Disable Admin theme breadcrumb, but only if different to site theme.
    if ($theme === $admin_theme && $site_theme !== $admin_theme) {
        $disable_admin_breadcrumb = variable_get(EasyBreadcrumbConstants::DB_VAR_DISABLE_ADMIN_BREADCRUMB, FALSE);
        if ($disable_admin_breadcrumb) {
            // Set the Drupal's default breadcrumb as an empty array to disable it.
            drupal_set_breadcrumb(array());
        }
    }
    else {
        $disable_drupal_default_breadcrumb = variable_get(EasyBreadcrumbConstants::DB_VAR_DISABLE_DEFAULT_DRUPAL_BREADCRUMB, TRUE);
        if ($disable_drupal_default_breadcrumb) {
            // Set the Drupal's default breadcrumb as an empty array to disable it.
            drupal_set_breadcrumb(array());
        }
    }
}