You are here

function dhtml_menu_theme_registry_alter in DHTML Menu 8

Same name and namespace in other branches
  1. 6.4 dhtml_menu.module \dhtml_menu_theme_registry_alter()
  2. 6.3 dhtml_menu.module \dhtml_menu_theme_registry_alter()

Implementation of hook_theme_registry_alter(). Replaces the theme functions for the menu_item functions, and stores the original functions in order to call them when this module is done with preprocessing.

File

./dhtml_menu.module, line 54

Code

function dhtml_menu_theme_registry_alter(&$theme_registry) {
  global $theme;

  // Back up the existing theme functions.
  $themes = variable_get('dhtml_menu_theme', array());
  $themes[$theme] = array(
    'menu_item' => $theme_registry['menu_item']['function'],
    'menu_item_link' => $theme_registry['menu_item_link']['function'],
  );
  variable_set('dhtml_menu_theme', $themes);

  // Replace them with our own. These will "preprocess" and call the real functions.
  $theme_registry['menu_item']['function'] = 'dhtml_menu_theme_menu_item';
  $theme_registry['menu_item_link']['function'] = 'dhtml_menu_theme_menu_item_link';
}