Changeset 484 for trunk/Common/Forms.php
- Timestamp:
- Feb 10, 2013, 11:31:12 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Common/Forms.php
r465 r484 40 40 } else $UseType = $Item['Type']; 41 41 $Edit = $System->Type->ExecuteTypeEvent($UseType, 'OnView', 42 array('Value' => $this->Values[$Index], 'Name' => $Index, 'Type' => $Item['Type'])); 42 array('Value' => $this->Values[$Index], 'Name' => $Index, 43 'Type' => $Item['Type'], 'Values' => $this->Values)); 43 44 if(array_key_exists('Suffix', $Item)) $Edit .= ' '.$Item['Suffix']; 44 array_push($Table['Rows'], array($Item['Caption'].':', $Edit)); 45 if(!$System->Type->IsHidden($UseType)) 46 array_push($Table['Rows'], array($Item['Caption'].':', $Edit)); 45 47 } 46 48 $Output = '<fieldset><legend>'.$this->Definition['Title'].'</legend>'.Table($Table). … … 62 64 global $Database, $FormTypes, $System; 63 65 66 $Hidden = ''; 67 $IsHidden = false; 64 68 $Table = array( 65 69 //'Header' => array('Položka', 'Hodnota'), … … 76 80 if(!array_key_exists($Index, $this->Values) and isset($Item['Default'])) $this->Values[$Index] = $Item['Default']; 77 81 $Parameters = array('Value' => $this->Values[$Index], 'Name' => $Index, 78 'Type' => $Item['Type'] );82 'Type' => $Item['Type'], 'Values' => $this->Values); 79 83 if(array_key_exists('Null', $Item)) $Parameters['Null'] = $Item['Null']; 80 84 else unset($Parameters['Null']); … … 94 98 if(array_key_exists('Suffix', $Item)) $Edit .= $Item['Suffix']; 95 99 96 array_push($Table['Rows'], array($Item['Caption'].':', $Edit)); 100 if(!$System->Type->IsHidden($UseType)) 101 array_push($Table['Rows'], array($Item['Caption'].':', $Edit)); 102 else $Hidden .= $Edit; 97 103 } 98 104 } 99 105 $Output = '<fieldset><legend>'.$this->Definition['Title'].'</legend>'.Table($Table). 100 '</fieldset>';106 $Hidden.'</fieldset>'; 101 107 return($Output); 102 108 } … … 125 131 $this->Values[$Index] = $System->Type->ExecuteTypeEvent($UseType, 'OnLoadDb', 126 132 array('Value' => $DbRow[$Index], 'Name' => $Index, 127 'Type' => $Item['Type'] ));133 'Type' => $Item['Type'], 'Values' => $this->Values)); 128 134 129 135 //echo($DbRow[$Index].'='.$this->Values[$Index].'<br/>'); … … 142 148 if(!array_key_exists($Index, $this->Values) and isset($Item['Default'])) $this->Values[$Index] = $Item['Default']; 143 149 $Parameters = array('Value' => $this->Values[$Index], 'Name' => $Index, 144 'Type' => $Item['Type'] );150 'Type' => $Item['Type'], 'Values' => $this->Values); 145 151 146 152 if(array_key_exists($Item['Type'], $FormTypes)) … … 157 163 } else $UseType = $Item['Type']; 158 164 $Values[$Index] = $System->Type->ExecuteTypeEvent($UseType, 'OnSaveDb', $Parameters); 165 if(($Item['Type'] == 'Password') and ($Values[$Index] == '')) unset($Values[$Index]); 159 166 160 167 //echo($DbRow[$Index].'='.$this->Values[$Index].'<br/>'); … … 181 188 $Values = array(); 182 189 foreach($this->Definition['Items'] as $Index => $Item) 183 if(!array_key_exists($Item['Type'], $FormTypes) or 184 (array_key_exists($Item['Type'], $FormTypes) and ($FormTypes[$Item['Type']]['Type'] != 'ManyToOne'))) 190 if((!array_key_exists($Item['Type'], $FormTypes) or 191 (array_key_exists($Item['Type'], $FormTypes) and 192 ($FormTypes[$Item['Type']]['Type'] != 'ManyToOne'))) and 193 (!array_key_exists('ReadOnly', $Item) or 194 (array_key_exists('ReadOnly', $Item) and 195 ($Item['ReadOnly'] != true)))) 185 196 { 186 197 //if(array_key_exists($Context.$Index, $_POST)) … … 196 207 } else $UseType = $Item['Type']; 197 208 $Values[$Index] = $System->Type->ExecuteTypeEvent($UseType, 'OnLoad', 198 array('Name' => $Index, 'Type' => $Item['Type'] ));209 array('Name' => $Index, 'Type' => $Item['Type'], 'Values' => $this->Values)); 199 210 } 200 211 return($Values);
Note:
See TracChangeset
for help on using the changeset viewer.