You are here

function _dhtml_menu_stack in DHTML Menu 8

Same name and namespace in other branches
  1. 6.4 dhtml_menu.theme.inc \_dhtml_menu_stack()
  2. 6.3 dhtml_menu.module \_dhtml_menu_stack()

Helper function for storing recursion levels.

Parameters

$link: If a menu item link is passed, it will be pushed onto the stack. Otherwise, one element will be popped off the stack.

Return value

The last element of the stack, if no argument is passed.

2 calls to _dhtml_menu_stack()
dhtml_menu_theme_menu_item in ./dhtml_menu.theme.inc
Preprocessor for menu_item. Checks whether the current item has children that were not rendered, and loads and renders them.
dhtml_menu_theme_menu_item_link in ./dhtml_menu.theme.inc
Preprocessor for menu_item_link. Adds an ID attribute to menu links and helps the module follow the recursion of menu_tree_output().

File

./dhtml_menu.theme.inc, line 118
dhtml_menu.theme.inc All functions related to generating the menu markup.

Code

function _dhtml_menu_stack($link = FALSE) {
  static $stack = array();
  if ($link) {
    $stack[] = $link;
  }
  else {
    return array_pop($stack);
  }
}