You are here

function theme_og_subgroups_menu_tree_branch in Subgroups for Organic groups 6

Theme a group hierachy tree branch

Parameters

$group: Optionally supply a group to focus

$branch: An array of tree branch stems

$parents: An array, keyed by group nid, of the $group's parents

Return value

An HTML-rendered tree of group links

1 theme call to theme_og_subgroups_menu_tree_branch()
theme_og_subgroups_menu_tree in includes/theme.inc
Theme a group hierachy tree

File

includes/theme.inc, line 110

Code

function theme_og_subgroups_menu_tree_branch($group, $branch, $parents) {
  $content = '';
  foreach ($branch as $stem) {
    $class = array();
    if ($group->nid == $stem->nid) {
      $class[] = 'og-subgroups-tree-active-trail';
    }
    if (in_array($stem->nid, array_keys($parents))) {
      $class[] = 'open';
      $class[] = 'og-subgroups-tree-active-trail';
    }
    $content .= '<li' . (!empty($class) ? ' class="' . implode(" ", $class) . '"' : '') . '>' . theme('og_subgroups_menu_tree_link', $group, $stem);
    if (!empty($stem->children)) {
      $content .= '<ul>' . theme('og_subgroups_menu_tree_branch', $group, $stem->children, $parents) . '</ul>';
    }
    $content .= '</li>';
  }
  return $content;
}