private static function __navigationFindGroupIndex(array $nav, $group)
    {
        foreach ($nav as $index => $item) {
            if ($item['name'] === $group) {
                return $index;
            }
        }

        return false;
    }
private static function __navigationFindGroupIndex(array $nav, $group)
    {
        foreach ($nav as $index => $item) {
            if ($item['name'] === $group) {
                return $index;
            }
        }

        return false;
    }
private static function __navigationFindGroupIndex ( array $ nav , $ group ) { foreach ( $ nav as $ index => $ item ) { if ( $ item [ 'name' ] === $ group ) { return $ index ; } } return false ; }
Given an associative array representing the navigation, and a group,
this function will attempt to return the index of the group in the navigation
array. If it is found, it will return the index, otherwise it will return false.

@param array $nav
An associative array of the navigation where the key is the group
index, and the value is an associative array of 'name', 'index' and
'children'. Name is the name of the this group, index is the same as
the key and children is an associative array of navigation items containing
the keys 'link', 'name' and 'visible'. The 'haystack'.
@param string $group
The group name to find, the 'needle'.
@return integer|boolean
If the group is found, the index will be returned, otherwise false.
Given an associative array representing the navigation and a group this function will attempt to return the index of the group in the navigation array . If it is found it will return the index otherwise it will return false .