X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=web%2Fhtdocs%2Fdetails%2Ffound.mc;h=eb9fe8f28a91c7848a2217b68f29fa427b92bb99;hb=edcb616095524e5aa81c7e7dd126d50b69ef9997;hp=677bb6852fe44ad075b11962ddf26387fb8e5f38;hpb=3af6b32f5eeadb0ce5a2835550ea60195766cdef;p=irspy-moved-to-github.git diff --git a/web/htdocs/details/found.mc b/web/htdocs/details/found.mc index 677bb68..eb9fe8f 100644 --- a/web/htdocs/details/found.mc +++ b/web/htdocs/details/found.mc @@ -1,10 +1,10 @@ -%# $Id: found.mc,v 1.3 2006-09-18 19:26:37 mike Exp $ +%# $Id: found.mc,v 1.6 2006-09-20 11:25:42 mike Exp $ <%once> use XML::LibXML; use XML::LibXML::XPathContext; %once> <%perl> -my %params = map { ( $_, $r->param($_)) } $r->param(); +my %params = map { ( $_, $r->param($_)) } grep { $r->param($_) } $r->param(); my $query = ""; foreach my $key (keys %params) { next if $key =~ /^_/; @@ -15,6 +15,18 @@ foreach my $key (keys %params) { } $query = 'cql.allRecords=x' if $query eq ""; +my $sort = $params{"_sort"}; +if ($sort) { + my $modifiers = ""; + if ($sort =~ s/(\/.*)//) { + $modifiers = $1; + } + $query .= " or $sort=/sort"; + $query .= "-desc" if $params{_desc}; + $query .= $modifiers; + $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 +44,8 @@ my $first = $skip+1; my $last = $first+$count-1; $last = $n if $last > $n; %perl> +
- <% $query %>
-
% if ($n == 0) {
No matches
% } elsif ($first > $n) {
@@ -64,10 +75,13 @@ if ($last < $n) {
# | +Title | +Author | Host | Port | DB | + | |
---|---|---|---|---|---|---|---|
<% $i %> | +<% $title %> | +<% $author %> | <% $host %> | <% $port %> | <% $db %> | ">[Check] | +">[Raw] |