You are here

function _megamenu_active_classes in Megamenu 7

Same name and namespace in other branches
  1. 6.2 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()
megamenu_theme_menu_tree in ./megamenu.module
Theme a menu tree.

File

./megamenu.utilities.inc, line 99
Helper/utility functions for Megamenu.

Code

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