Changeset 738 for trunk/Common/Form/Form.php
- Timestamp:
- Apr 14, 2015, 10:20:16 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/Common/Form/Form.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Form/Form.php
r737 r738 50 50 { 51 51 if(!array_key_exists($Index, $this->Values) and isset($Item['Default'])) 52 $this->Values[$Index] = $Item['Default'];52 $this->Values[$Index] = $Item['Default']; 53 53 } 54 54 } … … 62 62 function GetValue($Index, $Event = 'OnView') 63 63 { 64 $Item = $this->Definition['Items'][$Index];65 if(array_key_exists($Item['Type'], $this->FormManager->FormTypes))66 {67 if(!array_key_exists($Item['Type'], $this->FormManager->Type->TypeDefinitionList))68 $this->FormManager->Type->RegisterType($Item['Type'], '', $this->FormManager->FormTypes[$Item['Type']]);69 if($this->FormManager->FormTypes[$Item['Type']]['Type'] == 'Reference')70 $UseType = 'OneToMany';71 else if($this->FormManager->FormTypes[$Item['Type']]['Type'] == 'Enumeration')72 $UseType = 'Enumeration';73 } else $UseType = $Item['Type'];74 return $this->FormManager->Type->ExecuteTypeEvent($UseType, $Event,64 $Item = $this->Definition['Items'][$Index]; 65 if(array_key_exists($Item['Type'], $this->FormManager->FormTypes)) 66 { 67 if(!array_key_exists($Item['Type'], $this->FormManager->Type->TypeDefinitionList)) 68 $this->FormManager->Type->RegisterType($Item['Type'], '', $this->FormManager->FormTypes[$Item['Type']]); 69 if($this->FormManager->FormTypes[$Item['Type']]['Type'] == 'Reference') 70 $UseType = 'OneToMany'; 71 else if($this->FormManager->FormTypes[$Item['Type']]['Type'] == 'Enumeration') 72 $UseType = 'Enumeration'; 73 } else $UseType = $Item['Type']; 74 return $this->FormManager->Type->ExecuteTypeEvent($UseType, $Event, 75 75 array('Value' => $this->Values[$Index], 'Name' => $Index, 76 76 'Type' => $Item['Type'], 'Values' => $this->Values, … … 163 163 if(array_key_exists($Index, $this->ValuesValidate) and 164 164 $this->ValuesValidate[$Index]) { 165 $Format = $this->FormManager->Type->ExecuteTypeEvent($UseType, 'GetValidationFormat', array());166 if($Format != '') $Caption .= '<br/><small>'.$Format.'</small>';167 $Caption = '<span style="color:red;">'.$Caption.'</span>';165 $Format = $this->FormManager->Type->ExecuteTypeEvent($UseType, 'GetValidationFormat', array()); 166 if($Format != '') $Caption .= '<br/><small>'.$Format.'</small>'; 167 $Caption = '<span style="color:red;">'.$Caption.'</span>'; 168 168 } 169 169 if(!$this->FormManager->Type->IsHidden($UseType)) … … 305 305 { 306 306 if(isset($Item['Default'])) { 307 if(isset($Item['Null']) and ($Item['Null'] == true))308 $Values[$Index] = null;309 else $Values[$Index] = $Item['Default'];307 if(isset($Item['Null']) and ($Item['Null'] == true)) 308 $Values[$Index] = null; 309 else $Values[$Index] = $Item['Default']; 310 310 } 311 311 } … … 342 342 if(!$this->FormManager->Type->ExecuteTypeEvent($UseType, 'Validate', 343 343 $Parameters)) { 344 $this->ValuesValidate[$Index] = true;345 $Valid = false;344 $this->ValuesValidate[$Index] = true; 345 $Valid = false; 346 346 } 347 347 }
Note:
See TracChangeset
for help on using the changeset viewer.
