Changeset 7 for trunk/Packages/Common/Form/Types/Enumeration.php
- Timestamp:
- Apr 14, 2020, 11:13:32 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/Form/Types/Enumeration.php
r1 r7 8 8 { 9 9 $Type = $this->FormManager->Type->GetTypeDefinition($Item['Type']); 10 if (array_key_exists($Item['Value'], $Type['Parameters']['States']))10 if (array_key_exists($Item['Value'], $Type['Parameters']['States'])) 11 11 $Output = $Type['Parameters']['States'][$Item['Value']]; 12 12 else $Output = $Item['Value']; 13 return ($Output);13 return $Output; 14 14 } 15 15 … … 18 18 $Type = $this->FormManager->Type->GetTypeDefinition($Item['Type']); 19 19 $Output = '<select name="'.$Item['Name'].'">'; 20 if (array_key_exists('Null', $Item) and $Item['Null'])20 if (array_key_exists('Null', $Item) and $Item['Null']) 21 21 { 22 if ($Item['Value'] == NULL) $Selected = ' selected="1"'; else $Selected = '';22 if ($Item['Value'] == NULL) $Selected = ' selected="1"'; else $Selected = ''; 23 23 $Output .= '<option value=""'.$Selected.'></option>'; 24 24 } 25 foreach ($Type['Parameters']['States'] as $Index => $StateName)25 foreach ($Type['Parameters']['States'] as $Index => $StateName) 26 26 { 27 if ($Item['Value'] == $Index) $Selected = ' selected="1"'; else $Selected = '';27 if ($Item['Value'] == $Index) $Selected = ' selected="1"'; else $Selected = ''; 28 28 $Output .= '<option value="'.$Index.'"'.$Selected.'>'.$StateName.'</option>'; 29 29 } 30 30 $Output .= '</select>'; 31 return ($Output);31 return $Output; 32 32 } 33 33 34 34 function OnLoad($Item) 35 35 { 36 if ($_POST[$Item['Name']] == '') return(NULL);37 return ($_POST[$Item['Name']]);36 if ($_POST[$Item['Name']] == '') return NULL; 37 return $_POST[$Item['Name']]; 38 38 } 39 39 40 40 function OnLoadDb($Item) 41 41 { 42 if ($Item['Value'] == '') return(NULL);43 else return ($Item['Value']);42 if ($Item['Value'] == '') return NULL; 43 else return $Item['Value']; 44 44 } 45 45 }
Note:
See TracChangeset
for help on using the changeset viewer.