Changeset 19 for types/Enumeration.php
- Timestamp:
- Oct 22, 2008, 9:12:20 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
types/Enumeration.php
r11 r19 1 1 <?php 2 2 3 function TypeEnumerationOnView($Item) 3 class TypeEnumeration 4 4 { 5 global $Types; 5 function OnView($Item) 6 { 7 global $Types; 6 8 7 $Output = $Types[$Item['Type']]['Parameters'][$Item['Value']]; 8 return($Output); 9 $Output = $Types[$Item['Type']]['Parameters'][$Item['Value']]; 10 return($Output); 11 } 12 13 function OnEdit($Item) 14 { 15 global $Types; 16 17 $Output = '<select name="'.$Item['Name'].'">'; 18 foreach($Types[$Item['Type']]['Parameters'] as $Index => $StateName) 19 { 20 if($Item['Value'] == $Index) $Selected = ' selected="1"'; else $Selected = ''; 21 $Output .= '<option value="'.$Index.'"'.$Selected.'>'.$StateName.'</option>'; 22 } 23 $Output .= '</select>'; 24 return($Output); 25 } 26 27 function OnLoad($Item) 28 { 29 return($_POST[$Item['Name']]); 30 } 9 31 } 10 32 11 function TypeEnumerationOnEdit($Item) 12 { 13 global $Types; 14 15 $Output = '<select name="'.$Item['Name'].'">'; 16 foreach($Types[$Item['Type']]['Parameters'] as $Index => $StateName) 17 { 18 if($Item['Value'] == $Index) $Selected = ' selected="1"'; else $Selected = ''; 19 $Output .= '<option value="'.$Index.'"'.$Selected.'>'.$StateName.'</option>'; 20 } 21 $Output .= '</select>'; 22 return($Output); 23 } 24 25 function TypeEnumerationOnLoad($Item) 26 { 27 return($_POST[$Item['Name']]); 28 } 33 $TypeDefinitionList['Enumeration'] = new TypeEnumeration; 29 34 30 35 ?>
Note:
See TracChangeset
for help on using the changeset viewer.