_root = new JMenuNode('ROOT'); $this->_current = & $this->_root; } function addSeparator() { $this->addChild(new JMenuNode(null, null, 'separator', false)); } function renderMenu($id = 'menu', $class = '') { global $mainframe; $depth = 1; if(!empty($id)) { $id='id="'.$id.'"'; } if(!empty($class)) { $class='class="'.$class.'"'; } /* * Recurse through children if they exist */ while ($this->_current->hasChildren()) { echo "\n"; } if ($this->_css) { // Add style to document head $doc = & JFactory::getDocument(); $doc->addStyleDeclaration($this->_css); } } function renderLevel($depth) { /* * Build the CSS class suffix */ $class = ''; if ($this->_current->hasChildren()) { $class = ' class="node"'; } if($this->_current->class == 'separator') { $class = ' class="separator"'; } if($this->_current->class == 'disabled') { $class = ' class="disabled"'; } /* * Print the item */ echo ""; /* * Print a link if it exists */ if ($this->_current->link != null) { echo "getIconClass($this->_current->class)."\" href=\"".$this->_current->link."\">".$this->_current->title.""; } elseif ($this->_current->title != null) { echo "".$this->_current->title."\n"; } else { echo ""; } /* * Recurse through children if they exist */ while ($this->_current->hasChildren()) { if ($this->_current->class) { echo '