00001 <?PHP 00002 00003 00004 include_once("LabelText.php"); 00005 00006 00007 class LabelImage extends LabelText 00008 { 00009 00010 private $m_Prefix ; 00011 00012 protected function readMetaData(&$xmlArr) 00013 { 00014 parent::readMetaData($xmlArr); 00015 $this->m_Prefix = isset($xmlArr["ATTRIBUTES"]["URLPREFIX"]) ? $xmlArr["ATTRIBUTES"]["URLPREFIX"] : null; 00016 $this->m_Prefix = Expression::evaluateExpression($this->m_Prefix,$this); 00017 } 00018 00024 public function render() 00025 { 00026 $this->m_Prefix = Expression::evaluateExpression($this->m_Prefix, $formobj); 00027 $func = $this->getFunction(); 00028 if($this->m_Width){ 00029 $width_str = " width=\"".$this->m_Width."\" "; 00030 } 00031 if($this->m_Height){ 00032 $height_str = " height=\"".$this->m_Height."\" "; 00033 } 00034 $value = $this->getText()?$this->getText():$this->getValue(); 00035 if($value){ 00036 00037 if ($this->m_Link) 00038 { 00039 $link = $this->getLink(); 00040 $target = $this->getTarget(); 00041 $sHTML = "<a href=\"$link\" $target $func $style>" . "<img src=\"".$this->m_Prefix.$value."\" border=\"0\" $width_str $height_str />" . "</a>"; 00042 } 00043 else 00044 { 00045 $sHTML = "<img border=\"0\" src=\"".$this->m_Prefix.$value."\" $func $width_str $height_str />"; 00046 } 00047 00048 00049 } 00050 return $sHTML; 00051 } 00052 00053 } 00054 00055 ?>