/** * Adds an item to the menu. * * @param string $label Item label * @param string $href Link to open if clicked * @return uiNavigationItem The created item */ function &AddItem($label, $href = false) { $item = new uiNavigationItem(); $item->content(new Anchor($href, $label)); $this->content($item); return $item; }
function &AddItem($label, $href = false) { if (count($this->_content) < 1 || !$this->_content[count($this->_content) - 1] instanceof uiNavigation) { $this->content(new uiNavigation(true)); } $item = new uiNavigationItem(true); $item->content(new Anchor($href, $label)); $this->_content[count($this->_content) - 1]->content($item); return $item; }