You are here

function theme_admin_drilldown_menu_tree_output in Admin 6.2

Same name and namespace in other branches
  1. 7.2 theme/theme.inc \theme_admin_drilldown_menu_tree_output()

Alternative to menu_tree_output() which uses admin implementations of the core menu theme functions.

1 theme call to theme_admin_drilldown_menu_tree_output()
admin_block in ./admin.module
Implementation of hook_block().

File

theme/theme.inc, line 62

Code

function theme_admin_drilldown_menu_tree_output($tree) {
  $output = '';
  $items = array();

  // Pull out just the menu items we are going to render so that we
  // get an accurate count for the first/last classes.
  foreach ($tree as $data) {
    if (!$data['link']['hidden']) {
      $items[] = $data;
    }
  }
  $num_items = count($items);
  foreach ($items as $i => $data) {
    $extra_class = NULL;
    if ($i == 0) {
      $extra_class = 'first';
    }
    if ($i == $num_items - 1) {
      $extra_class = 'last';
    }
    $link = theme('admin_drilldown_menu_item_link', $data['link']);
    $in_active_trail = isset($data['link']['in_active_trail']) ? $data['link']['in_active_trail'] : FALSE;
    if ($data['below']) {
      $output .= theme('admin_drilldown_menu_item', $link, $data['link']['has_children'], theme('admin_drilldown_menu_tree_output', $data['below']), $in_active_trail, $extra_class);
    }
    else {
      $output .= theme('admin_drilldown_menu_item', $link, $data['link']['has_children'], '', $in_active_trail, $extra_class);
    }
  }
  return $output ? theme('admin_drilldown_menu_tree', $output) : '';
}