From 9c475c9b6fc88195acd1d17122c97ff539e3ddbf Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 19 Sep 2006 16:35:25 +0000 Subject: [PATCH] Add support for sorting. Query is now an

rather than a bold

--- web/htdocs/details/found.mc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/web/htdocs/details/found.mc b/web/htdocs/details/found.mc index a358498..e957091 100644 --- a/web/htdocs/details/found.mc +++ b/web/htdocs/details/found.mc @@ -1,4 +1,4 @@ -%# $Id: found.mc,v 1.4 2006-09-19 11:12:33 mike Exp $ +%# $Id: found.mc,v 1.5 2006-09-19 16:35:25 mike Exp $ <%once> use XML::LibXML; use XML::LibXML::XPathContext; @@ -15,6 +15,13 @@ foreach my $key (keys %params) { } $query = 'cql.allRecords=x' if $query eq ""; +my $sort = $params{"_sort"}; +if ($sort) { + $query .= " or $sort=/sort"; + $query .= "-desc" if $params{_desc}; + $query .= " 0"; +} + ### We can think about keeping the Connection object open to re-use # for multiple requests, but that may not get us much. Same applies # for the XML parser. @@ -32,9 +39,8 @@ my $first = $skip+1; my $last = $first+$count-1; $last = $n if $last > $n; +

<% $query %>

- <% $query %> -
% if ($n == 0) { No matches % } elsif ($first > $n) { -- 1.7.10.4