DocumentElement.class.php
gehe zur Dokumentation dieser Datei00001 <?php
00002
00013 class DocumentElement extends AbstractElement
00014 {
00015 var $linkedObjectIds = array();
00016
00022 var $footnotes = array();
00023
00024 var $encodeHtml = false;
00025
00034 function parse( $text, $type='wiki' )
00035 {
00036 $parserClass = ucfirst(strtolower($type)).'Parser';
00037 $parser = new $parserClass();
00038
00039 $this->children = $parser->parse( $text );
00040 $this->linkedObjectIds = $parser->linkedObjectIds;
00041 }
00042
00043
00044
00045
00046
00055 function render( $mimeType )
00056 {
00057
00058 switch( $mimeType )
00059 {
00060 case 'text/html':
00061 $this->type = 'html';
00062 break;
00063 case 'text/plain':
00064 $this->type = 'text';
00065 break;
00066 case 'application/pdf':
00067 $this->type = 'pdf';
00068 break;
00069 case 'application/html-dom':
00070 $this->type = 'htmlDom';
00071 break;
00072 case 'application/x-latex':
00073 $this->type = 'latex';
00074 break;
00075 case 'text/xhtml':
00076 $this->type = 'xhtml';
00077 break;
00078 case 'application/docbook+xml':
00079 $this->type = 'docBook';
00080 break;
00081 default:
00082 $this->type = 'html';
00083 }
00084
00085 $rendererClass = ucfirst($this->type).'Renderer';
00086
00087 $renderer = new $rendererClass();
00088 $renderer->children = $this->children;
00089 $renderer->linkedObjectIds = $this->linkedObjectIds;
00090 $renderer->encodeHtml = $this->encodeHtml;
00091
00092 return $renderer->render();
00093 }
00094 }
00095
00096 ?>