summaryrefslogtreecommitdiff
path: root/httemplate/search/elements
diff options
context:
space:
mode:
authorivan <ivan>2006-04-22 00:58:40 +0000
committerivan <ivan>2006-04-22 00:58:40 +0000
commit1a033848671cad2cbe7687b37fc718b3b2a68b83 (patch)
tree01fc1ca352726cdc5786e0ccaf78515e9326ba84 /httemplate/search/elements
parent303cb4ce4b6ce634e108e3b7a0b43086a5e4f184 (diff)
start of package class web UI (add/edit package classes, package class selection in package def edit)
Diffstat (limited to 'httemplate/search/elements')
-rw-r--r--httemplate/search/elements/search.html57
1 files changed, 45 insertions, 12 deletions
diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html
index 7f7243588..6cf574164 100644
--- a/httemplate/search/elements/search.html
+++ b/httemplate/search/elements/search.html
@@ -8,8 +8,12 @@
# 'name' => 'items', #name for the records returned
#
# # some HTML callbacks...
- # 'menubar' => '', #menubar arrayref
- # 'html_init' => '', #after the header/menubar and before the pager
+ # 'menubar' => '', #menubar arrayref
+ # 'html_init' => '', #after the header/menubar and before the pager
+ # 'html_foot' => '', #at the bottom
+ # 'html_posttotal' => '', #at the bottom
+ # # (these three can be strings or coderefs)
+ #
#
# #literal SQL query string or qsearch hashref, required
# 'query' => {
@@ -39,6 +43,10 @@
# # (if not specified the database column names will be used)
# 'header' => [ '#', 'Item' ],
#
+ # 'disable_download' => '', # set true to hide the CSV/Excel download links
+ # 'disable_nonefound' => '', # set true to disable the "No matching Xs found"
+ # # message
+ #
# #listref - each item is a literal column name (or method) or coderef
# #if not specified all columns will be shown
# 'fields' => [
@@ -286,7 +294,13 @@
include( '/elements/menubar.html', @menubar )
)
%>
- <%= defined($opt{'html_init'}) ? $opt{'html_init'} : '' %>
+ <%= defined($opt{'html_init'})
+ ? ( ref($opt{'html_init'})
+ ? &{$opt{'html_init'}}()
+ : $opt{'html_init'}
+ )
+ : ''
+ %>
<% my $pager = include ( '/elements/pager.html',
'offset' => $offset,
'num_rows' => scalar(@$rows),
@@ -295,26 +309,38 @@
);
%>
<% unless ( $total ) { %>
- No matching <%= $opt{'name'} %> found.<BR>
+ <% unless ( $opt{'disable_nonefound'} ) { %>
+ No matching <%= $opt{'name'} %> found.<BR>
+ <% } %>
<% } else { %>
<TABLE>
<TR>
<TD VALIGN="bottom">
- <%= $total %> total <%= $opt{'name'} %><BR>
+ <%= $total %> total <%= $opt{'name'} %>
+ <%= defined($opt{'html_posttotal'})
+ ? ( ref($opt{'html_posttotal'})
+ ? &{$opt{'html_posttotal'}}()
+ : $opt{'html_posttotal'}
+ )
+ : ''
+ %>
+ <BR>
<% if ( $opt{'count_addl'} ) { %>
<% my $n=0; foreach my $count ( @{$opt{'count_addl'}} ) { %>
<%= sprintf( $count, $count_arrayref->[++$n] ) %><BR>
<% } %>
<% } %>
</TD>
- <TD ALIGN="right">
- <% $cgi->param('_type', "$xlsname.xls" ); %>
- Download full results<BR>
- as <A HREF="<%= $cgi->self_url %>">Excel spreadsheet</A><BR>
- <% $cgi->param('_type', 'csv'); %>
- as <A HREF="<%= $cgi->self_url %>">CSV file</A>
- </TD>
+ <% unless ( $opt{'disable_download'} ) { %>
+ <TD ALIGN="right">
+ <% $cgi->param('_type', "$xlsname.xls" ); %>
+ Download full results<BR>
+ as <A HREF="<%= $cgi->self_url %>">Excel spreadsheet</A><BR>
+ <% $cgi->param('_type', 'csv'); %>
+ as <A HREF="<%= $cgi->self_url %>">CSV file</A>
+ </TD>
+ <% } %>
</TR>
<TR>
<TD COLSPAN=2>
@@ -471,6 +497,13 @@
</TABLE>
<% } %>
+ <%= defined($opt{'html_foot'})
+ ? ( ref($opt{'html_foot'})
+ ? &{$opt{'html_foot'}}()
+ : $opt{'html_foot'}
+ )
+ : ''
+ %>
<%= include( '/elements/footer.html' ) %>
<% } %>
<% } %>