myAction=$sAction; $this->msView=$sView; } function addChild($oMenuPoint) { $this->asChildren[]=oMenuPoint; } function glGetNumberOfChildren() { return sizeof($this->asChildren); } function gbHasChildren() { return $this->asChildren!==false; } function gaoGetChildren() { return $this->asChildren; } function reset() { $this->mlPos=0; } function getNextChild() { if(isset($this->asChildren[$this->mlPos])) { return $this->asChildren[$this->mlPos]; } return false; } } class CMainMenu { function CMainMenu() { $this->oSystem=&$oSystem; $this->msTPLPath=CURRDIR."tpl/menu/main/"; } function gsGetMenu($oMenu) { if($oMenu->gbHasChildren()) { while($oPoint=$oMenu->getNextChild()) { echo "OK"; } } } } $oMenu[]=new CMenuPoint("Kunden","Kunden"); $oMenu[]=new CMenuPoint("Fahrer","Fahrer"); $oMenu[]=new CMenuPoint("ReWe","ReWe"); $oMenu[]=new CMenuPoint("Daten","Daten"); $oM=new CMenuPoint("",""); $oM->asChildren=$oMenu; $ox=new CMainMenu(); $ox->gsGetMenu($oM);