You are here

function theme_admin_menu_item in Administration menu 6

Same name and namespace in other branches
  1. 5.3 admin_menu.module \theme_admin_menu_item()
  2. 5 admin_menu.inc \theme_admin_menu_item()
  3. 5.2 admin_menu.module \theme_admin_menu_item()

Generate the HTML output for a single menu item and submenu.

Parameters

string $link: A rendered menu item link.

bool $has_children: Whether this item has children.

string $menu: A string containing any rendered children of this item.

bool $in_active_trail: Whether this item is in the active menu trail.

string $extra_class: An additional CSS class to set for this item.

See also

theme_menu_item()

1 call to theme_admin_menu_item()
admin_menu_tree_output in ./admin_menu.module
Returns a rendered menu tree.

File

./admin_menu.module, line 206
Renders a menu tree for administrative purposes as a dropdown menu at the top of the window.

Code

function theme_admin_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) {
  $class = $menu || $has_children ? 'expandable' : '';
  if (!empty($extra_class)) {
    $class .= ' ' . $extra_class;
  }
  if ($in_active_trail) {
    $class .= ' active-trail';
  }
  return '<li' . (!empty($class) ? ' class="' . $class . '"' : '') . '>' . $link . $menu . '</li>';
}