---------------------------------------------------------------------------
+Fix stupid things with HTML::Pager and HTML::Template. Since communication
+between swish and HTML::Pager isn't as good as it should be, I must include
+all fields in output every time, creating huge html comments when you want
+just hits (I could turn off die_on_bad_params in HTML::Template, but there
+should be better way...)
+
my @s_arr; # all queries are located here
+ my @path_arr = $q->param('path');
+ my $full = $q->param('full');
+
for(my $i = 1; $i <=10; $i++) {
return show_index($self, $i) if ($q->param("f".$i."_index"));
},
#startnum => 0,
- maxhits => $MAX_HITS,
+ maxhits => $MAX_HITS
);
die $SWISH::errstr unless $sh;
- my $hits = $sh->query(join(" and ",@s_arr)) || 0; # FIX: and/or
+ # construct swish query
+ my $sw_q = join(" and ",@s_arr);
+ if (@path_arr) {
+ $sw_q .= "and (swishdocpath=\"";
+ $sw_q .= join("\" or swishdocpath=\"",@path_arr);
+ $sw_q .= "\")";
+ $tmpl->param('full',1); # show full records
+ }
+
+ my $hits = $sh->query($sw_q);
$tmpl->param('hits',$hits);
- $tmpl->param('search',join(" and ",@s_arr));
+ $tmpl->param('search',$sw_q);
# create a Pager object
my $pager = HTML::Pager->new(
# describe your databases here
-#[ps-libri]
+[ps-libri]
# directory for isis databases
-# isis_db=/data/isis_data/ps/LIBRI/LIBRI
+ isis_db=/data/isis_data/ps/LIBRI/LIBRI
# this will use xml file in import_xml/ dir
-# type=isis
+ type=isis
# this is arbirary xml added to each record (e.g. Library identifier
# or something like that
-# xml=<type>Knjiga</type>
+ xml=<type>Knjiga</type>
#[ge-libri]
# isis_db=/data/isis_data/ge/LIBRI/LIBRI
<h2>Rezultati pretra¾ivanja</h2>
-<p>Your query <TMPL_VAR search> returned <TMPL_VAR hits> results...</p>
-
<form>
+
+<p>Your query <TMPL_VAR search> returned <TMPL_VAR hits> results...
+</p>
+
<TABLE BORDER=0 WIDTH=100%>
<TR><TD><TABLE BORDER=1 WIDTH=100%>
+
+<TMPL_IF NAME="full">
+
+<input type=submit value="Back to all results">
+
+<TMPL_LOOP NAME="PAGER_DATA_LIST">
+ <TR>
+ <td><TMPL_VAR NAME="nr"></td>
+ <td>
+ <TMPL_VAR NAME="headline">
+ <i><TMPL_VAR NAME="path"></i>
+ <b><TMPL_VAR NAME="rank"></b>
+ </td>
+ </tr>
+ <tr><td colspan="2">
+ <table border=0> <TMPL_VAR NAME="html"> </table>
+ </td></td>
+ </TR>
+</TMPL_LOOP>
+
+<TMPL_ELSE>
+
+<input type=submit value="Display details about checked items">
<TMPL_LOOP NAME="PAGER_DATA_LIST">
<TR>
<td><input type=checkbox name="path" value="<TMPL_VAR NAME="path">"><TMPL_VAR NAME="nr"></td>
<TMPL_VAR NAME="headline">
<i><TMPL_VAR NAME="path"></i>
<b><TMPL_VAR NAME="rank"></b>
+ <!-- FIX: remove this <TMPL_VAR NAME="html"> -->
</td>
</tr>
- <TMPL_IF NAME="full">
- <tr><td colspan="2"><table border=1><TMPL_VAR NAME="html"></table></td></td>
- </TMPL_IF>
</TR>
</TMPL_LOOP>
+
+</TMPL_IF>
+
<TR><TD COLSPAN=3 ALIGN=CENTER class="navigacija">
<TMPL_VAR NAME="PAGER_PREV">
<TMPL_VAR NAME="PAGER_JUMP">