You are here

function menu_minipanels_theme_menu_item_link in Menu Minipanels 6

This replacement theme function adds minipanels support to theme_links() without disturbing themes that may also implement this theme function.

See also

menu_minipanels_theme_registry_alter.

1 string reference to 'menu_minipanels_theme_menu_item_link'
menu_minipanels_theme_registry_alter in ./menu_minipanels.module
Implements hook_theme_registry_alter().

File

./menu_minipanels.module, line 393
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_menu_item_link($link) {
  $matches = array();
  if (!empty($link['options']['minipanel'])) {
    if (empty($link['localized_options'])) {
      $link['localized_options'] = array(
        'attributes' => array(),
      );
    }
    $prefix = '';
    if (!empty($link['localized_options']['attributes']['class'])) {
      $prefix = $link['localized_options']['attributes']['class'] . ' ';
    }
    $link['localized_options']['attributes']['class'] = $prefix . _menu_minipanels_include($link['options']['minipanel'], $link['options']['menu_minipanels_hover']);
  }
  return theme('menu_minipanels_theme_menu_item_link_default', $link);
}