Changeset 606
- Timestamp:
- Dec 8, 2013, 5:08:37 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Version.php
r605 r606 1 1 <?php 2 2 3 $Revision = 60 5; // Subversion revision3 $Revision = 606; // Subversion revision 4 4 $DatabaseRevision = 601; // SQL structure revision 5 5 $ReleaseTime = '2013-12-08'; -
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 } -
trunk/Common/Form/Types/Base.php
r605 r606 65 65 return(true); 66 66 } 67 68 function GetValidationFormat() 69 { 70 return(''); 71 } 67 72 } -
trunk/Common/Form/Types/IPv4Address.php
r605 r606 27 27 return(filter_var($Item['Value'], FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV4))); 28 28 } 29 30 function GetValidationFormat() 31 { 32 return('x.x.x.x kde x je hodnota 0..255'); 33 } 29 34 }
Note:
See TracChangeset
for help on using the changeset viewer.