You are here

function simplemenu_inactive_parents_theme_menu_item_link in SimpleMenu 6

\brief Transform the menu item link.

This function intercepts the menu item link theming function of the system and

1 string reference to 'simplemenu_inactive_parents_theme_menu_item_link'
simplemenu_inactive_parents_theme_registry_alter in ./simplemenu_inactive_parents.module
\brief Alter the menu item link theme registry.

File

./simplemenu_inactive_parents.module, line 42
Make all the simplemenu parent menu items non-clickable.

Code

function simplemenu_inactive_parents_theme_menu_item_link($link) {
  global $theme;
  static $cnt = 0;

  // this is a drop down?
  if (!empty($link['has_children']) && simplemenu_running()) {
    ++$cnt;
    return '<a name="menu-id-' . $cnt . '">' . $link['title'] . '</a>';
  }

  // got a theme function?
  $themes = variable_get('simplemenu_inactive_parents_theme_function', array());
  if (isset($themes[$theme])) {
    return $themes[$theme]($link);
  }

  // somehow the preprocess function did not get called?!
  // use the core default
  return theme_menu_item_link($link);
}