You are here

function i18n_menu_node_set_item in Menu translation - Node 7

Set as current menu item the source node to correctly handle the active trail.

1 call to i18n_menu_node_set_item()
i18n_menu_node_init in ./i18n_menu_node.module
Implementation of hook_init().

File

./i18n_menu_node.module, line 730
Menu translation (Node).

Code

function i18n_menu_node_set_item($node) {
  if (!empty($node->tnid) && $node->tnid != $node->nid && i18n_menu_node_menu_link_enabled($node)) {
    $item = menu_get_item();
    $href = explode('/', $item['href']);
    if ($href[0] == 'node') {
      menu_tree_set_path('main-menu', 'node/' . $node->tnid);
    }
  }
}