TextElement.class.php
gehe zur Dokumentation dieser Datei00001 <?php
00002
00008 class TextElement extends AbstractElement
00009 {
00010 var $text = '';
00011
00012 function TextElement( $t='' )
00013 {
00014 $this->text = $t;
00015
00016 $this->parseStyleClass();
00017 $this->parseTitleText();
00018 }
00019
00020
00021 function parseStyleClass()
00022 {
00023 $char1 = substr($this->text,0,1);
00024 if ( $char1 == "(" )
00025 {
00026 $pos2 = strpos($this->text,")",2);
00027 if ( $pos2 !== false )
00028 {
00029 $this->style = substr($this->text,1,$pos2-1);
00030 $this->text = substr($this->text,$pos2+1);
00031
00032
00033
00034 if ( strpos($this->style,':') === false )
00035 {
00036 $this->class = $this->style;
00037 $this->style = '';
00038 }
00039 }
00040 }
00041 }
00042
00043
00044
00045 function parseTitleText()
00046 {
00047 $char1 = substr($this->text,0,1);
00048 if ( $char1 == "'" )
00049 {
00050 $pos2 = strpos($this->text,"'",2);
00051 if ( $pos2 !== false )
00052 {
00053 $this->title = substr($this->text,1,$pos2-1);
00054 $this->text = substr($this->text,$pos2+1);
00055 }
00056 }
00057 }
00058
00059
00060 }
00061
00062 ?>