Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

xml-template.inc.php

Go to the documentation of this file.
00001 <?
00010 class XMLTemplate extends BaseTemplate
00011 {
00015     public function drawPage()
00016     {
00017         //tell the browser we're html.
00018         header("Content-type: text/xml; charset=UTF-8");
00019 
00020         //start our header off right.
00021         echo '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\n";
00022         echo "<!-- generator=\"BaseJumper v2\" -->\n";
00023         
00024         //draw our errors...
00025         if ($this->object->hasError())
00026             $this->drawError();
00027         //nope, what about status?.
00028         else if ($this->object->hasStatus())
00029             $this->drawStatus();
00030         //finally we get to content!
00031         else    
00032             $this->drawContent();
00033     }
00034     
00035     public function drawError()
00036     {
00037         echo "<error>" . htmlentities($this->object->getError()) . "</error>";
00038     }
00039 
00040     public function drawStatus()
00041     {
00042         $status = $this->object->getStatus();
00043     
00044         foreach ($status AS $msg)
00045             echo "<status>" . htmlentities($msg) . "</status>\n";
00046     }
00047 }
00048 ?>

Generated on Fri Oct 27 12:26:40 2006 for BaseJumper by doxygen 1.3.9.1