_referer=$referer; $this->_basedir=dirname($referer); $this->_script=array(); $this->_header=array(); $this->_currentScript=0; $this->_currentHeader=0; // initialiser les variables d'inclusion // lancer la session session_start(); // vérifier le login } function logCheck($authorizedLevel=0){ include("logcheck.php"); /* TODO: prévoir un niveau de check */ } function setTitle($title){ } function startHeader(){ ob_start(); } function endHeader(){ $this->_header[$this->_currentHeader]=ob_get_contents(); $this->_currentHeader=$this->_currentHeader+1; ob_end_clean(); } function startScript(){ //TODO: faire en sorte de vérifier l'ordre des balises ob_start(); print "\n"; $this->_script[$this->_currentScript]=ob_get_contents(); $this->_currentScript=$this->_currentScript+1; ob_end_clean(); } function startContent(){ //TODO: faire en sorte de vérifier l'ordre des balises ob_start(); } function endContent(){ //TODO: faire en sorte de vérifier l'ordre des balises $this->_content=ob_get_contents(); ob_end_clean(); } function toHTML(){ $htmlCode=""; /* Start of page */ ob_start(); include("header.inc.php"); $htmlCode.=ob_get_contents(); ob_end_clean(); /* Headers */ for($i=0;$i<$this->_currentHeader;$i++) { $htmlCode.=$this->_header[$i]; } /* Javascript */ $htmlCode.="\n"; /* Start of page */ ob_start(); include("bodystart.inc.php"); $htmlCode.=ob_get_contents(); ob_end_clean(); /* Content of page */ $htmlCode.=$this->_content; /* Footer */ ob_start(); include("footer.inc.php"); $htmlCode.=ob_get_contents(); ob_end_clean(); /* End of page */ ob_start(); include("bodyend.inc.php"); $htmlCode.=ob_get_contents(); ob_end_clean(); return $htmlCode; } } // end class } // end ifdef ?>