You are here

function menu_firstchild_translated_menu_link_alter in Menu Firstchild 7

Same name and namespace in other branches
  1. 6 menu_firstchild.module \menu_firstchild_translated_menu_link_alter()

Implementation of hook_translated_menu_link_alter().

File

./menu_firstchild.module, line 45
menu_firstchild.module Main file for the menu_firstchild module.

Code

function menu_firstchild_translated_menu_link_alter(&$item, $map) {
  if ($item['module'] == 'menu' && $item['link_path'] == '<firstchild>') {
    $href = _menu_firstchild_get_firstchild_href($item['mlid']);
    if ($href != NULL) {
      $item['href'] = $href;
      $item['localized_options']['attributes']['class'][] = 'menu-firstchild';
    }
    else {
      $item['hidden'] = TRUE;
    }
  }
}