00001 <?php
00002
00003
00004
00005
00006
00008
00016 class STransStdXML extends STransXML
00017 {
00020 protected $transHelperClass = "STransStdXMLHelper";
00021
00026 public function doc() {
00027 return "STransStdXML translates the standard Shodor content"
00028 . " XML format into viewable content HTML";
00029 }
00030
00031
00032
00033
00034
00035
00041 public function getInFormat() {
00042 return 'xml';
00043 }
00044
00050 public function getOutFormat() {
00051 return 'html';
00052 }
00053
00061 public function translate ($si)
00062 {
00063 if(parent::translate($si) === false ) return false;
00064 $xml = SXMLHelper::parse($si->getSource());
00065
00066
00067 $collect = "";
00068 if ($si->getOption('pageDataOnly')){
00069 if (isset($xml->section))
00070 {
00071 foreach($xml->section as $curSection)
00072 { $collect .= $this->transHelper->formatSectionHtml($curSection); }
00073 }
00074 } else {
00075 if (isset($xml->module->unit->page))
00076 {
00077 foreach($xml->module->unit->page->section as $curSection)
00078 { $collect .= $this->transHelper->formatSectionHtml($curSection); }
00079 }
00080 }
00081 $this->sendToTarget($si, $collect);
00082
00083 }
00084
00085 }
00086
00087 ?>