_title=$title; $this->_name=array(); $this->_url=array(); $this->_visible=array(); $this->_params=array(); $this->_defaultLevel=$level; } /* * Ajoute une entrée au menu */ function addItem($param,$name="",$url=""){ array_push($this->_params,$param); /* Verifie s'il s'agit d'un séparateur */ $this->_name[$param]="$name"; $this->_url[$param]="$url"; $this->_level[$param]=$this->_defaultLevel; } /* * Active une entrée du menu */ function setItemLevel($param,$level){ $this->_level[$param]=$level; } function setCurrentLevel($level){ if ($level<0) { $level =0; } $this->_currentLevel=$level; } function toHTML(){ $answer="

".$this->_title."

"; $answer.="_params as $param){ if (($this->_level[$param] ^ $this->_currentLevel)>0){ $answer.="
  • " ."_url[$param] ."\">" .$this->_name[$param] ."" ."
  • \n"; } } $answer.=""; return $answer; } } } ?>