36 $this->oObject=$oObject;
50 $this->tMessage=$tMessage;
60 $sHtml.=
'<input type="hidden" name="'.$sName.
'" value="'.$this->getValue($sName).
'" '.$this->getOption($tOption).
'/>';
70 public function getToken($sName,$sValue,$tOption=null){
72 $sHtml.=
'<input type="hidden" type="text" name="'.$sName.
'" value="'.$sValue.
'" '.$this->getOption($tOption).
'/>';
73 $sHtml.=$this->getMessage($sName);
84 $sHtml.=
'<input type="text" name="'.$sName.
'" value="'.$this->getValue($sName).
'" '.$this->getOption($tOption).
'/>';
85 $sHtml.=$this->getMessage($sName);
96 $sHtml.=
'<textarea type="text" name="'.$sName.
'" '.$this->getOption($tOption).
'>';
97 $sHtml.=$this->getValue($sName).
'</textarea>';
98 $sHtml.=$this->getMessage($sName);
109 $sHtml.=
'<input type="file" name="'.$sName.
'" '.$this->getOption($tOption).
'/>';
110 $sHtml.=$this->getMessage($sName);
120 public function getSelect($sName,$tValue,$tOption=null){
122 $sCurrentValue=$this->getValue($sName);
125 $sHtml.=
'<select name="'.$sName.
'" '.$this->getOption($tOption).
'>';
126 foreach($tValue as $sValue => $sLabel){
128 if($sValue==$sCurrentValue){
129 $sHtml.=
' selected="selected"';
131 $sHtml.=
' value="'.$sValue.
'">'.$sLabel.
'</option>';
134 $sHtml.=$this->getMessage($sName);
146 $sCurrentValue=$this->getValue($sName);
150 foreach($tValue as $sValue => $sLabel){
151 $sHtml.=
'<input type="radio" name="'.$sName.
'" ';
152 if($sValue==$sCurrentValue){
153 $sHtml.=
' checked="checked"';
155 $sHtml.=
' value="'.$sValue.
'" '.$this->getOption($tOption).
'/>'.$sLabel.
' ';
157 $sHtml.=$this->getMessage($sName);
168 $sCurrentValue=$this->getValue($sName);
170 $sHtml=
'<input type="checkbox" ';
171 if($sCurrentValue==$sValue){
172 $sHtml.=
'checked="checked" ';
174 $sHtml.=
' name="'.$sName.
'" value="'.$sValue.
'" '.$this->getOption($tOption).
'/>';
175 $sHtml.=$this->getMessage($sName);
179 private function getValue($sName){
182 }
else if($this->oObject){
183 if($this->oObject->$sName){
184 return $this->oObject->$sName;
189 private function getMessage($sName){
190 if(isset($this->tMessage[$sName])){
191 if(is_array($this->tMessage[$sName])){
192 return '<p class="error">'.implode(
',',$this->tMessage[$sName]).
'</p>';
194 return '<p class="error">'.$this->tMessage[$sName].
'</p>';
200 private function getOption($tOption=null){
207 foreach($tOption as $sKey => $sValue){
208 $sHtml.=$sKey.
'="'.$sValue.
'" ';
static getParam($sVar, $uElse=null)