You are here

function _megamenu_active_classes in Megamenu 6.2

Same name and namespace in other branches
  1. 7 megamenu.utilities.inc \_megamenu_active_classes()

Determine if a particular mega menu item is active.

TODO: make it better

Parameters

<string> $branch (of mega menu):

1 call to _megamenu_active_classes()
theme_megamenu_menu_tree in ./megamenu.module
Theme a menu tree

File

./megamenu.utilities.inc, line 102
Helper/utility functions

Code

function _megamenu_active_classes($branch) {
  if (!is_array($branch)) {
    return;
  }
  $active = '';
  if ($branch['link']['in_active_trail']) {
    if ($branch['link']['below'] == FALSE) {
      $active = ' active active-trail';
    }
    else {
      $active = ' active-trail';
    }
  }
  return $active;
}