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/header.html | 19 ++++++++++++++++++ httemplate/elements/menubar.html | 8 ++++++++ httemplate/elements/pager.html | 42 ++++++++++++++++++++++++++++++++++++++++ httemplate/elements/table.html | 8 ++++++++ 4 files changed, 77 insertions(+) create mode 100644 httemplate/elements/header.html create mode 100644 httemplate/elements/menubar.html create mode 100644 httemplate/elements/pager.html create mode 100644 httemplate/elements/table.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html new file mode 100644 index 000000000..581bbabc7 --- /dev/null +++ b/httemplate/elements/header.html @@ -0,0 +1,19 @@ +<% + my($title, $menubar) = @_; + my $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc. +%> + + + + <%= $title %> + + + + + + > + + <%= $title %> + +

+ <%= $menubar ? "$menubar

" : '' %> diff --git a/httemplate/elements/menubar.html b/httemplate/elements/menubar.html new file mode 100644 index 000000000..87a50312c --- /dev/null +++ b/httemplate/elements/menubar.html @@ -0,0 +1,8 @@ +<% + my($item, $url, @html); + while (@_) { + ($item, $url) = splice(@_,0,2); + push @html, qq!$item!; + } +%> +<%= join(' | ', @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 + +<% + } + } +%> diff --git a/httemplate/elements/table.html b/httemplate/elements/table.html new file mode 100644 index 000000000..3b6108719 --- /dev/null +++ b/httemplate/elements/table.html @@ -0,0 +1,8 @@ +<% + my $color = shift; + if ( $color ) { +%> + +<% } else { %> +
+<% } %> -- cgit v1.2.1