diff options
author | cvs2git <cvs2git> | 2009-10-11 02:42:17 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2009-10-11 02:42:17 +0000 |
commit | a83a000a027d1272e813259d09230d701d84df64 (patch) | |
tree | 71500c957e6d7db3e1ad3d59e74ca7bbb14e44ff /httemplate/edit/part_export.cgi | |
parent | 097a12385d80ef52f37d4cc2bb93bc3f81e6f8e6 (diff) | |
parent | 0b69c091543b56a45f2ae6b8718fc67f381a6686 (diff) |
This commit was manufactured by cvs2svn to create branchfreeside_1_9_1
'FREESIDE_1_9_BRANCH'.
Diffstat (limited to 'httemplate/edit/part_export.cgi')
-rw-r--r-- | httemplate/edit/part_export.cgi | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/httemplate/edit/part_export.cgi b/httemplate/edit/part_export.cgi index d579797..8b697e1 100644 --- a/httemplate/edit/part_export.cgi +++ b/httemplate/edit/part_export.cgi @@ -79,13 +79,28 @@ my $widget = new HTML::Widgets::SelectLayers( ); $html .= qq!<TR><TD ALIGN="right">$label</TD><TD>!; if ( $type eq 'select' ) { - $html .= qq!<SELECT NAME="$option">!; - foreach my $select_option ( @{$optinfo->{options}} ) { + my $size = defined($optinfo->{size}) ? " SIZE=" . $optinfo->{size} : ''; + my $multi = defined($optinfo->{multi}) ? ' MULTIPLE' : ''; + $html .= qq!<SELECT NAME="$option"$multi$size>!; + my @values = split '\s+', $value if $multi; + my @options; + if (defined($optinfo->{option_values})) { + my $valsub = $optinfo->{option_values}; + @options = &$valsub(); + } elsif (defined($optinfo->{options})) { + @options = @{$optinfo->{options}}; + } + foreach my $select_option ( @options ) { #if ( ref($select_option) ) { #} else { - my $selected = $select_option eq $value ? ' SELECTED' : ''; + my $selected = ($multi ? grep {$_ eq $select_option} @values : $select_option eq $value ) ? ' SELECTED' : ''; + my $label = $select_option; + if (defined($optinfo->{option_label})) { + my $labelsub = $optinfo->{option_label}; + $label = &$labelsub($select_option); + } $html .= qq!<OPTION VALUE="$select_option"$selected>!. - qq!$select_option</OPTION>!; + qq!$label</OPTION>!; #} } $html .= '</SELECT>'; |