% if ( exists($opt{'redirect'}) && $opt{'redirect'}
% && scalar(@$rows) == 1 && $total == 1
% && $type ne 'html-print'
% ) {
% my $redirect = $opt{'redirect'};
% $redirect = &{$redirect}($rows->[0], $cgi) if ref($redirect) eq 'CODE';
% my( $url, $method ) = @$redirect;
% redirect( $url. $rows->[0]->$method() );
% } elsif ( exists($opt{'redirect_empty'}) && ! scalar(@$rows) && $total == 0
% && $type ne 'html-print'
% && $opt{'redirect_empty'}
% && ( ref($opt{'redirect_empty'}) ne 'CODE'
% || &{$opt{'redirect_empty'}}($cgi) )
% ) {
% my $redirect = $opt{'redirect_empty'};
% $redirect = &{$redirect}($cgi) if ref($redirect) eq 'CODE';
% redirect( $redirect );
% } else {
% if ( $opt{'name_singular'} ) {
% $opt{'name'} = PL($opt{'name_singular'});
% }
% ( my $xlsname = $opt{'name'} ) =~ s/\W//g;
% if ( $total == 1 ) {
% if ( $opt{'name_singular'} ) {
% $opt{'name'} = $opt{'name_singular'}
% } else {
% #$opt{'name'} =~ s/s$// if $total == 1;
% $opt{'name'} =~ s/((s)e)?s$/$2/ if $total == 1;
% }
% }
%
% if ( $type eq 'html-print' ) {
<% $opt{nohtmlheader}
? ''
: include( '/elements/header-popup.html', $opt{'title'} )
%>
% } elsif ( $type eq 'select' ) {
<% $opt{nohtmlheader}
? ''
: include( '/elements/header-popup.html', $opt{'title'} )
%>
<% defined($opt{'html_init'})
? ( ref($opt{'html_init'})
? &{$opt{'html_init'}}()
: $opt{'html_init'}
)
: ''
%>
% } else {
%
% my @menubar = ();
% if ( $opt{'menubar'} ) {
% @menubar = @{ $opt{'menubar'} };
% #} else {
% # @menubar = ( 'Main menu' => $p );
% }
<% $opt{nohtmlheader}
? ''
: include( '/elements/header.html', $opt{'title'},
include( '/elements/menubar.html', @menubar )
)
%>
<% defined($opt{'html_init'})
? ( ref($opt{'html_init'})
? &{$opt{'html_init'}}()
: $opt{'html_init'}
)
: ''
%>
% }
% unless ( $total ) {
% unless ( $opt{'disable_nonefound'} ) {
No matching <% $opt{'name'} %> found.
% }
% }
%
% if ( $total || $opt{'disableable'} ) { #hmm... and there *are* ones to show??
% unless ( $opt{'disable_download'} || $type eq 'html-print' ) { |
Download full results % $cgi->param('_type', "$xlsname.xls" ); as query_string %>">Excel spreadsheet % $cgi->param('_type', 'csv'); as query_string %>">CSV file % if ( defined($opt{xml_elements}) ) { % $cgi->param('_type', 'xml'); as query_string %>">XML file % } % $cgi->param('_type', 'html-print'); as query_string %>">printable copy |
% $cgi->param('_type', "html" );
% }
||
% my $pager = ''; % unless ( $type eq 'html_print' ) { <% $pager = include( '/elements/pager.html', 'offset' => $offset, 'num_rows' => scalar(@$rows), 'total' => $total, 'maxrecords' => $maxrecords, ) %> <% defined($opt{'html_form'}) ? ( ref($opt{'html_form'}) ? &{$opt{'html_form'}}() : $opt{'html_form'} ) : '' %> % } <% include('/elements/table-grid.html') %> | |||
<% $style %> > <% $label %> | % }|||
---|---|---|---|
<% $label %> | % }|||
{$_}. '"'; % } % grep exists($e->{$_}), % qw( align bgcolor colspan rowspan % style valign width ) % ). % '>'. % % ( $e->{'link'} % ? '' % : '' % ). % ( $e->{'size'} % ? '' % : '' % ). % ( $e->{'data_style'} % ? '<'. uc($e->{'data_style'}). '>' % : '' % ). % $e->{'data'}. % ( $e->{'data_style'} % ? ''. uc($e->{'data_style'}). '>' % : '' % ). % ( $e->{'size'} ? '' : '' ). % ( $e->{'link'} ? '' : '' ). % ' | '; % % } @$rowref ). % % '
<% $cstyle %>><% $font %><% $a %><% $s %><% $field %><% $es %><% $a ? '' : '' %><% $font ? '' : '' %> | % } % % } else { % % foreach ( @$row ) {<% $_ %> | % } % % } % } % if ( $opt{'footer'} ) {
<% $footer %> | % }