diff options
author | ivan <ivan> | 2003-08-08 05:42:13 +0000 |
---|---|---|
committer | ivan <ivan> | 2003-08-08 05:42:13 +0000 |
commit | e283ab567e6890727e4d8e35c1d8097398678753 (patch) | |
tree | 2b15e95819c245027d1b8cb9f0976fd49b5b4190 /httemplate/elements | |
parent | ef7bb336cc67f127fb1d77532ad3da1369c0ae36 (diff) |
- (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
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/header.html | 19 | ||||
-rw-r--r-- | httemplate/elements/menubar.html | 8 | ||||
-rw-r--r-- | httemplate/elements/pager.html | 42 | ||||
-rw-r--r-- | httemplate/elements/table.html | 8 |
4 files changed, 77 insertions, 0 deletions
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. +%> + <HTML> + <HEAD> + <TITLE> + <%= $title %> + </TITLE> + <META HTTP-Equiv="Cache-Control" Content="no-cache"> + <META HTTP-Equiv="Pragma" Content="no-cache"> + <META HTTP-Equiv="Expires" Content="0"> + </HEAD> + <BODY BGCOLOR="#e8e8e8"<%= $etc %>> + <FONT SIZE=7> + <%= $title %> + </FONT> + <BR><BR> + <%= $menubar ? "$menubar<BR><BR>" : '' %> 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!<A HREF="$url">$item</A>!; + } +%> +<%= 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'}); +%> + + <A HREF="<%= $cgi->self_url %>"><B><FONT SIZE="+1">Previous</FONT></B></A> + +<% + } + my $page = 0; + for ( my $poff = 0; $poff < $opt{'total'}; $poff += $opt{'maxrecords'} ) { + $page++; + if ( $opt{'offset'} == $poff ) { +%> + + <FONT SIZE="+2"><%= $page %></FONT> + +<% + } else { + $cgi->param('offset', $poff); +%> + + <A HREF="<%= $cgi->self_url %>">$page</A> + +<% + } + } + unless ( $opt{'offset'} + $opt{'maxrecords'} > $opt{'total'} ) { + $cgi->param('offset', $opt{'offset'} + $opt{'maxrecords'}); +%> + + <A HREF="<%= $cgi->self_url %>"><B><FONT SIZE="+1">Next</FONT></B></A> + +<% + } + } +%> 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 ) { +%> + <TABLE BGCOLOR="<%= $color %>" BORDER=1 WIDTH="100%" CELLSPACING=0 CELLPADDING=2 BORDERCOLOR="#999999"> +<% } else { %> + <TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2 BORDERCOLOR="#999999"> +<% } %> |