Changeset 606 for trunk/Common/Form/Form.php
- Timestamp:
- Dec 8, 2013, 5:08:37 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Form/Form.php
r605 r606 9 9 var $Definition; 10 10 var $Values; 11 var $ValuesValidate; 11 12 var $ValuesFilter; 12 13 var $OnSubmit; … … 19 20 $this->Definition = array(); 20 21 $this->Values = array(); 21 $this->ValuesFilter = array(); 22 $this->ValuesFilter = array(); 23 $this->ValuesValidate = array(); 22 24 $this->OnSubmit = ''; 23 25 } … … 108 110 if(array_key_exists('Suffix', $Item)) $Edit .= $Item['Suffix']; 109 111 112 $Caption = $Item['Caption'].':'; 113 if(array_key_exists($Index, $this->ValuesValidate) and 114 $this->ValuesValidate[$Index]) { 115 $Format = $this->FormManager->Type->ExecuteTypeEvent($UseType, 'GetValidationFormat', array()); 116 if($Format != '') $Caption .= '<br/><small>'.$Format.'</small>'; 117 $Caption = '<span style="color:red;">'.$Caption.'</span>'; 118 } 110 119 if(!$this->FormManager->Type->IsHidden($UseType)) 111 array_push($Table['Rows'], array($ Item['Caption'].':', $Edit));120 array_push($Table['Rows'], array($Caption, $Edit)); 112 121 else $Hidden .= $Edit; 113 122 } … … 246 255 function Validate() 247 256 { 248 $Val ues = array();257 $Valid = true; 249 258 foreach($this->Definition['Items'] as $Index => $Item) 250 259 if((!array_key_exists($Item['Type'], $this->FormManager->FormTypes) or … … 272 281 else $Parameters['Null'] = false; 273 282 if(!$this->FormManager->Type->ExecuteTypeEvent($UseType, 'Validate', 274 $Parameters)) throw new Exception('not validated'); 275 } 276 return($Values); 283 $Parameters)) { 284 $this->ValuesValidate[$Index] = true; 285 $Valid = false; 286 } 287 } 288 if($Valid == false) throw new Exception('not validated'); 289 return($Valid); 277 290 } 278 291 }
Note:
See TracChangeset
for help on using the changeset viewer.