You are here

function tb_megamenu_build_page_trail in The Better Mega Menu 7

1 call to tb_megamenu_build_page_trail()
template_preprocess_tb_megamenu in ./tb_megamenu.themes.inc

File

./tb_megamenu.functions.inc, line 103

Code

function tb_megamenu_build_page_trail($page_menu) {
  $trail = array();
  foreach ($page_menu as $item) {
    if ($item['link']['in_active_trail']) {
      $trail[$item['link']['mlid']] = $item;
    }
    elseif ($item['link']['href'] == '<front>' && drupal_is_front_page()) {
      $trail[$item['link']['mlid']] = $item;
    }
    if ($item['below']) {
      $trail += tb_megamenu_build_page_trail($item['below']);
    }
  }
  return $trail;
}