diff options
author | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2010-12-27 00:04:45 +0000 |
commit | c82d349f864e6bd9f96fd1156903bc1f7193a203 (patch) | |
tree | e117a87533656110b6acd56fc0ca64289892a9f5 /httemplate/search/elements/search-csv.html | |
parent | 74e058c8a010ef6feb539248a550d0bb169c1e94 (diff) |
This commit was manufactured by cvs2svn to create tag 'TORRUS_1_0_9'.TORRUS_1_0_9
Diffstat (limited to 'httemplate/search/elements/search-csv.html')
-rw-r--r-- | httemplate/search/elements/search-csv.html | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/httemplate/search/elements/search-csv.html b/httemplate/search/elements/search-csv.html deleted file mode 100644 index 9eb1b66..0000000 --- a/httemplate/search/elements/search-csv.html +++ /dev/null @@ -1,54 +0,0 @@ -% $csv->combine(@$header); #or die $csv->status; -% -<% $opt{no_csv_header} ? '' : $csv->string %>\ -% -% foreach my $row ( @$rows ) { -% -% if ( $opt{'fields'} ) { -% -% my @line = (); -% -% foreach my $field ( @{$opt{'fields'}} ) { -% if ( ref($field) eq 'CODE' ) { -% push @line, map { -% ref($_) eq 'ARRAY' -% ? '(N/A)' #unimplemented -% : $_; -% } -% &{$field}($row); -% } else { -% push @line, $row->$field(); -% } -% } -% -% $csv->combine(@line); #or die $csv->status; -% -% } else { -% $csv->combine(@$row); #or die $csv->status; -% } -% -% -<% $csv->string %>\ -% -% } -<%init> - -my %args = @_; -my $header = $args{'header'}; -my $rows = $args{'rows'}; -my %opt = %{ $args{'opt'} }; - -#http_header('Content-Type' => 'text/comma-separated-values' ); #IE chokes -#http_header('Content-Type' => 'text/plain' ); -http_header('Content-Type' => 'text/csv' ); # So saith RFC 4180 -http_header('Content-Disposition' => - 'attachment;filename="'.($opt{'name'} || PL($opt{'name_singular'}) ).'.csv"'); - -my $quote_char = '"'; -$quote_char = $opt{csv_quote} if exists($opt{csv_quote}); - -my $csv = new Text::CSV_XS { 'always_quote' => $opt{avoid_quote} ? 0 : 1, - 'eol' => "\n", #"\015\012", #"\012" - }; - -</%init> |