blob: 07b0a01d51140d047c2f24d68fe03427e02098e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
<% include('tr-td-label.html', @_ ) %>
<TD <% $style %>>
<SELECT NAME = "<% $opt{field} %>"
ID = "<% $opt{id} %>"
previousValue = "<% $curr_value %>"
previousText = "<% $labels->{$curr_value} || $curr_value %>"
<% $onchange %>
>
% if ( $opt{options} ) {
%
% foreach my $option ( @{ $opt{options} } ) { #just arrayref for now
<OPTION VALUE="<% $option %>"
<% $opt{curr_value} eq $option ? 'SELECTED' : '' %>
>
<% $labels->{$option} || $option %>
</OPTION>
% }
%
% } else { #deprecated weird value hashref used only by reason.html
%
% my $aref = $opt{'value'}->{'values'};
% my $vkey = $opt{'value'}->{'vcolumn'};
% my $ckey = $opt{'value'}->{'ccolumn'};
% foreach my $v (@$aref) {
<OPTION VALUE="<% $v->$vkey %>"
<% ($opt{curr_value} eq $v->$vkey) ? 'SELECTED' : '' %>
>
<% $v->$ckey %>
</OPTION>
% }
%
% }
</SELECT>
</TD>
</TR>
<%init>
my %opt = @_;
my $onchange = $opt{'onchange'}
? 'onChange="'. $opt{'onchange'}. '(this)"'
: '';
my $labels = $opt{'option_labels'} || $opt{'labels'};
my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
my $curr_value = $opt{'curr_value'};
</%init>
|