summaryrefslogtreecommitdiff
path: root/httemplate/search/elements/search-html.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/search/elements/search-html.html')
-rw-r--r--httemplate/search/elements/search-html.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/httemplate/search/elements/search-html.html b/httemplate/search/elements/search-html.html
index 98f9c4476..d6cc62691 100644
--- a/httemplate/search/elements/search-html.html
+++ b/httemplate/search/elements/search-html.html
@@ -190,11 +190,26 @@
<TR>
% my $h2 = 0;
% my $colspan = 0;
+% my @fields = @{ $opt{'sort_fields'} || $opt{'fields'}};
+% my $order_by = $cgi->param('order_by');
% foreach my $header ( @{ $opt{header} } ) {
+%
+% my $field = shift @fields;
+%
% $colspan-- if $colspan > 0;
% next if $colspan;
%
% my $label = ref($header) ? $header->{label} : $header;
+% unless ( ref($field) || !$field ) {
+% if ( $order_by eq $field ) {
+% $cgi->param('order_by', "$field DESC");
+% } else {
+% $cgi->param('order_by', $field);
+% }
+% $label = qq(<A HREF="$self_url?). $cgi->query_string.
+% qq(">$label</A>);
+% }
+%
% $colspan = ref($header) ? $header->{colspan} : 0;
% my $rowspan = 1;
% my $style = '';