00001 <?PHP 00017 include_once("InputElement.php"); 00018 00027 class InputText extends InputElement 00028 { 00029 protected function readMetaData(&$xmlArr){ 00030 parent::readMetaData($xmlArr); 00031 $this->m_cssClass = isset($xmlArr["ATTRIBUTES"]["CSSCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSCLASS"] : "input_text"; 00032 $this->m_cssErrorClass = isset($xmlArr["ATTRIBUTES"]["CSSERRORCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSERRORCLASS"] : $this->m_cssClass."_error"; 00033 $this->m_cssFocusClass = isset($xmlArr["ATTRIBUTES"]["CSSFOCUSCLASS"]) ? $xmlArr["ATTRIBUTES"]["CSSFOCUSCLASS"] : $this->m_cssClass."_focus"; 00034 } 00040 public function render() 00041 { 00042 if($this->m_Value!=null){ 00043 $value = $this->m_Value; 00044 }else{ 00045 $value = $this->getText(); 00046 } 00047 00048 if($value==""){ 00049 $value = $this->getDefaultValue(); 00050 } 00051 $disabledStr = ($this->getEnabled() == "N") ? "READONLY=\"true\"" : ""; 00052 $style = $this->getStyle(); 00053 $func = $this->getFunction(); 00054 00055 $formobj = $this->GetFormObj(); 00056 if($formobj->m_Errors[$this->m_Name]){ 00057 $func .= "onchange=\"this.className='$this->m_cssClass'\""; 00058 }else{ 00059 $func .= "onfocus=\"this.className='$this->m_cssFocusClass'\" onblur=\"this.className='$this->m_cssClass'\""; 00060 } 00061 00062 $sHTML = "<INPUT NAME=\"" . $this->m_Name . "\" ID=\"" . $this->m_Name ."\" VALUE=\"" . $value . "\" $disabledStr $this->m_HTMLAttr $style $func />"; 00063 if($this->m_Hint){ 00064 $sHTML.="<script> 00065 \$j('#" . $this->m_Name . "').tbHinter({ 00066 text: '".$this->m_Hint."' 00067 }); 00068 </script>"; 00069 } 00070 return $sHTML; 00071 } 00072 00073 } 00074 00075 ?>