label =$label; $this->labelpos=$labelpos; $this->link =$link; $this->id =$id; $this->flyout =$flyout; $this->submenus=array(); } function addLabel($label=' ', $pos='right') { if ($label) $this->label = $label; $this->labelpos = $pos; } function addLink($link='#') { $this->link = $link; } function addOnclick($onclick) { $this->onclick = $onclick; } function addFlyout($flyout='down') { $this->flyout = $flyout; } function addClass($class, $submenuclass='', $iconclass='icon_general') { $this->class = $class; $this->submenuclass = $submenuclass; $this->iconclass = $iconclass; } function addTarget($target) { $this->target = $target; } function addSubMenu($obj) { $this->submenus[] = $obj; } // public function __toString() { return $this->getMenuAsList(); } // Get the menu as a simple list - for accessible interfaces, search engines and CSS menus function getMenuAsList() { $link = ''; if ($this->link) { if ($this->target !== null) { $link .= ' target="'.$this->target.'"'; } if ($this->link=='#') { if ($this->onclick !== null) { $link .= ' onclick="'.$this->onclick.'"'; } $html=''.$this->label.''; } else { $html=''.$this->label.''; } } else { $html=$this->label; } if ($this->submenus) { $html.='