You are here

function custom_breadcrumbs_theme_registry_alter in Custom Breadcrumbs 7.2

Same name and namespace in other branches
  1. 6.2 custom_breadcrumbs.module \custom_breadcrumbs_theme_registry_alter()

Implements hook_theme_registry_alter().

File

./custom_breadcrumbs.module, line 932
Main file for the Custom breadcrumbs.

Code

function custom_breadcrumbs_theme_registry_alter(&$theme_registry) {
  if (variable_get('custom_breadcrumbs_force_active_trail', FALSE) && !empty($theme_registry['links'])) {
    global $theme;

    // Store the existing theme functions.
    $themes = variable_get('custom_breadcrumbs_menu_theme', array());
    $themes[$theme] = array(
      'menu_item' => isset($theme_registry['menu_item']) ? $theme_registry['menu_item']['function'] : "",
      'menu_item_link' => isset($theme_registry['menu_item_link']) ? $theme_registry['menu_item_link']['function'] : "",
    );
    variable_set('custom_breadcrumbs_menu_theme', $themes);

    // Replace these with our own functions. We will call the original functions
    // after call these override functions.
    $theme_registry['links']['function'] = 'custom_breadcrumbs_override_links';
    $theme_registry['menu_item_link']['function'] = 'custom_breadcrumbs_theme_menu_item_link';
    $theme_registry['menu_item']['function'] = 'custom_breadcrumbs_theme_menu_item';
  }
}