Changeset 605 for trunk/Common/Form/Form.php
- Timestamp:
- Dec 8, 2013, 4:38:25 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Form/Form.php
r581 r605 243 243 return($Values); 244 244 } 245 246 function Validate() 247 { 248 $Values = array(); 249 foreach($this->Definition['Items'] as $Index => $Item) 250 if((!array_key_exists($Item['Type'], $this->FormManager->FormTypes) or 251 (array_key_exists($Item['Type'], $this->FormManager->FormTypes) and 252 ($this->FormManager->FormTypes[$Item['Type']]['Type'] != 'ManyToOne'))) and 253 (!array_key_exists('ReadOnly', $Item) or 254 (array_key_exists('ReadOnly', $Item) and 255 ($Item['ReadOnly'] != true)))) 256 { 257 //if(array_key_exists($Context.$Index, $_POST)) 258 if(array_key_exists($Item['Type'], $this->FormManager->FormTypes)) 259 { 260 if(!array_key_exists($Item['Type'], $this->FormManager->Type->TypeDefinitionList)) 261 $this->FormManager->Type->RegisterType($Item['Type'], '', 262 $this->FormManager->FormTypes[$Item['Type']]); 263 $CustomType = $this->FormManager->FormTypes[$Item['Type']]['Type']; 264 if($CustomType == 'Reference') 265 $UseType = 'OneToMany'; 266 else if($CustomType == 'Enumeration') 267 $UseType = 'Enumeration'; 268 } else $UseType = $Item['Type']; 269 270 $Parameters = array('Value' => $this->Values[$Index]); 271 if(array_key_exists('Null', $Item)) $Parameters['Null'] = $Item['Null']; 272 else $Parameters['Null'] = false; 273 if(!$this->FormManager->Type->ExecuteTypeEvent($UseType, 'Validate', 274 $Parameters)) throw new Exception('not validated'); 275 } 276 return($Values); 277 } 245 278 } 279 246 280 247 281 function MakeLink($Target, $Title)
Note:
See TracChangeset
for help on using the changeset viewer.