You are here

function menu_minipanels_theme_registry_alter in Menu Minipanels 6

Same name and namespace in other branches
  1. 7.2 menu_minipanels.module \menu_minipanels_theme_registry_alter()
  2. 7 menu_minipanels.module \menu_minipanels_theme_registry_alter()

Implements hook_theme_registry_alter().

theme_menu_item_link() is overridden because to print menus, themes and modules generally use menu_tree_output(), and menu_tree_output() calls theme_menu_item_link().

This method *only* works if theme_menu_item_link is called *before* $closure is created in page_preprocess().

If a theme calls theme('menu_tree') in a page.tpl.php for instance, this will not work.

File

./menu_minipanels.module, line 338
Allows an administrator to specify a minipanel to be associated with a Drupal menu item. When that menu item is hovered or clicked (as per config), the minipanel content will be shown using the qTip javascript library.

Code

function menu_minipanels_theme_registry_alter(&$vars) {
  $vars['menu_minipanels_theme_links_default'] = $vars['links'];
  $vars['links']['function'] = 'menu_minipanels_theme_links';
  $vars['menu_minipanels_theme_menu_item_link_default'] = $vars['menu_item_link'];
  $vars['menu_item_link']['function'] = 'menu_minipanels_theme_menu_item_link';
}