From e283ab567e6890727e4d8e35c1d8097398678753 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 8 Aug 2003 05:42:13 +0000 Subject: - (finish) includes! (closes: Bug#551) - (finish) moving SQL search to including generic elements/search.html - new elements: menubar.html, header.html, pager.html and table.html - have masonize process .html files also --- httemplate/elements/pager.html | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 httemplate/elements/pager.html (limited to 'httemplate/elements/pager.html') diff --git a/httemplate/elements/pager.html b/httemplate/elements/pager.html new file mode 100644 index 000000000..db9ff83bf --- /dev/null +++ b/httemplate/elements/pager.html @@ -0,0 +1,42 @@ +<% + + my %opt = @_; + + my $pager = ''; + if ( $opt{'total'} != $opt{'num_rows'} && $opt{'maxrecords'} ) { + unless ( $opt{'offset'} == 0 ) { + $cgi->param('offset', $opt{'offset'} - $opt{'maxrecords'}); +%> + + Previous + +<% + } + my $page = 0; + for ( my $poff = 0; $poff < $opt{'total'}; $poff += $opt{'maxrecords'} ) { + $page++; + if ( $opt{'offset'} == $poff ) { +%> + + <%= $page %> + +<% + } else { + $cgi->param('offset', $poff); +%> + + $page + +<% + } + } + unless ( $opt{'offset'} + $opt{'maxrecords'} > $opt{'total'} ) { + $cgi->param('offset', $opt{'offset'} + $opt{'maxrecords'}); +%> + + Next + +<% + } + } +%> -- cgit v1.2.1