source: trunk/types/Enumeration.php

Last change on this file was 29, checked in by george, 15 years ago
  • Upraveno: Hledání položek v seznamu dle zadaného filtru.
File size: 691 bytes
Line 
1<?php
2
3class TypeEnumeration extends TypeBase
4{
5 function OnView($Item)
6 {
7 $Type = GetTypeDefinition($Item['Type']);
8 $Output = $Type['Parameters'][$Item['Value']];
9 return($Output);
10 }
11
12 function OnEdit($Item)
13 {
14 $Type = GetTypeDefinition($Item['Type']);
15 $Output = '<select name="'.$Item['Name'].'">';
16 foreach($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 OnLoad($Item)
26 {
27 return($_POST[$Item['Name']]);
28 }
29}
30
31?>
Note: See TracBrowser for help on using the repository browser.