diff options
Diffstat (limited to 'httemplate/browse/part_export.cgi')
-rwxr-xr-x | httemplate/browse/part_export.cgi | 48 |
1 files changed, 45 insertions, 3 deletions
diff --git a/httemplate/browse/part_export.cgi b/httemplate/browse/part_export.cgi index b7ecc00a6..91238a0fd 100755 --- a/httemplate/browse/part_export.cgi +++ b/httemplate/browse/part_export.cgi @@ -43,14 +43,56 @@ function part_export_areyousure(href) { <TD CLASS="inv" BGCOLOR="<% $bgcolor %>"> <% itable() %> % my %opt = $part_export->options; -% foreach my $opt ( keys %opt ) { +% my $defs = $part_export->info->{options}; +% my %multiples; +% foreach my $opt (keys %$defs) { # is a Tie::IxHash +% my $group = $defs->{$opt}->{multiple}; +% if ( $group ) { +% my @values = split("\n", $opt{$opt}); +% $multiples{$group} ||= []; +% push @{ $multiples{$group} }, [ $opt, @values ] if @values; +% delete $opt{$opt}; +% } elsif (length($opt{$opt})) { # the normal case +%# foreach my $opt ( keys %opt ) { <TR> <TD ALIGN="right" VALIGN="top" WIDTH="33%"><% $opt %>: </TD> <TD ALIGN="left" WIDTH="67%"><% encode_entities($opt{$opt}) %></TD> </TR> -% } - +% delete $opt{$opt}; +% } +% } +% # now any that are somehow not in the options list +% foreach my $opt (keys %opt) { +% if ( length($opt{$opt}) ) { + <TR> + <TD ALIGN="right" VALIGN="top" WIDTH="33%"><% $opt %>: </TD> + <TD ALIGN="left" WIDTH="67%"><% encode_entities($opt{$opt}) %></TD> + </TR> +% } +% } +% # now show any multiple-option groups +% foreach (sort keys %multiples) { +% my $set = $multiples{$_}; + <TR><TD ALIGN="center" COLSPAN=2><TABLE CLASS="grid"> + <TR> +% foreach my $col (@$set) { + <TH><% shift @$col %></TH> +% } + </TR> +% while ( 1 ) { + <TR> +% my $end = 1; +% foreach my $col (@$set) { + <TD><% shift @$col %></TD> +% $end = 0 if @$col; +% } + </TR> +% last if $end; +% } + </TABLE></TD></TR> +% } #foreach keys %multiples + </TABLE> </TD> |