source: main/trunk/greenstone2/macros/query.dm@ 22170

Last change on this file since 22170 was 22170, checked in by davidb, 14 years ago

Removal of some debugging info from SQL query page

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 28.0 KB
Line 
1# this file must be UTF-8 encoded
2package query
3
4
5#######################################################################
6# Macros whose values are set from within the server at runtime. These
7# are here only for reference and to set default values if required.
8#######################################################################
9
10_quotedquery_ {}
11_freqmsg_ {}
12_stopwordsmsg_ {}
13_resultline_ {}
14_thisfirst_ {}
15_thislast_ {}
16_nextfirst_ {}
17_nextlast_ {}
18_prevfirst_ {}
19_prevlast_ {}
20_searchhistorylist_ {}
21#_histvalue0_ to _histvalue19_
22_advformlist_ {}
23_regformlist_ {}
24_sqladvformlist_ {}
25_sqlregformlist_ {}
26#_fqfselection_ {}
27
28
29#######################################################################
30# icons
31#######################################################################
32
33_queryresultsbar_ {
34<div class="divbar">
35<p class="navbar">_texthresults_</p>
36</div>
37}
38
39_searchhistorybar_ {
40<div class="divbar">
41<p class="navbar">_texticonsearchhistorybar_</p>
42</div>
43}
44
45
46# _iconnext_ and _iconprev_ are overridden in this package as we
47# don't want alt text here
48_iconnext_{<img src="_httpiconmore_" width="_widthmore_" height="_heightmore_" border="0" align="top">}
49_iconnext_ [v=1] {}
50_iconprev_{<img src="_httpiconless_" width="_widthless_" height="_heightless_" border="0" align="top">}
51_iconprev_ [v=1] {}
52
53# the small squares for search history
54## " " ## handmade ## mstds ##
55_httpiconmstdsqrof_ {_httpimg_/mstdsof.gif}
56_httpiconmstdsqron_ {_httpimg_/mstdson.gif}
57_widthmstdsqrx_ {13}
58_heightmstdsqrx_ {13}
59
60#######################################################################
61# images
62#######################################################################
63
64# _imagethispage_ set in nav_css/nav_ns4 macro files
65
66#the buttons for the search history entries
67# takes one arg - the entry number (0-num entries)
68_imagehistbutton_ {<a href="_httpquery_" onMouseover="roll('histbutton_1_',1);" onMouseOut="roll('histbutton_1_',0);" onClick="inputQuery(histvalue_1_); return false;"><img name="histbutton_1_" src="_httpiconmstdsqrof_" onLoad="gbutton(this,'_httpiconmstdsqron_');" border="0" alt="_textusequery_" title="_textusequery_"></a>}
69
70
71#######################################################################
72# scripts (and some macros for the scripts)
73#######################################################################
74
75_pagescriptextra_ {_If_("_cgiargqt_" ge "1", _formpagescriptextra_, _selectpagescriptextra_)
76_If_("_cgiarghd_" ne "0",_historypagescriptextra_) }
77
78_selectpagescriptextra_{_If_("_cgiargqto_" eq "2", _formpagescriptextra_,_dummypagescriptextra_)}
79_dummypagescriptextra_{function initialize() \{
80\} }
81_formpagescriptextra_ {
82// query scripts generated by \_query:pagescriptextra\_
83
84_standardfunctions_
85_formfunctions_
86_searchfunctions_
87
88function getsearchargs () \{
89
90 var args="";
91 args = "&fqa=0&fqv="+argfqv+"&fqf="+argfqf;
92 _If_(_cgiargb_,
93 args += "&fqk="+argfqk+"&fqs="+argfqs+"&fqc="+argfqc;
94 )
95 _If_("_cgiarga_" eq "sqlq",args += "&sqlfqf="+argsqlfqf + "&sqlfqc="+argsqlfqc;)
96
97 return args;
98\}
99
100
101
102function getqueryargs () \{
103 return "&fqa=1"+"&q="+argq+"&fqv="+argfqv+"&fqf="+argfqf+
104 "&fqk="+argfqk+"&fqs="+argfqs+"&fqc="+argfqc+
105 "&sqlfqf="+argsqlfqf + "&sqlfqc="+argsqlfqc ;
106\}
107
108}
109
110_historypagescriptextra_{
111
112var histvalue0='_histvalue0_';
113var histvalue1='_histvalue1_';
114var histvalue2='_histvalue2_';
115var histvalue3='_histvalue3_';
116var histvalue4='_histvalue4_';
117var histvalue5='_histvalue5_';
118var histvalue6='_histvalue6_';
119var histvalue7='_histvalue7_';
120var histvalue8='_histvalue8_';
121var histvalue9='_histvalue9_';
122var histvalue10='_histvalue10_';
123var histvalue11='_histvalue11_';
124var histvalue12='_histvalue12_';
125var histvalue13='_histvalue13_';
126var histvalue14='_histvalue14_';
127var histvalue15='_histvalue15_';
128var histvalue16='_histvalue16_';
129var histvalue17='_histvalue17_';
130var histvalue18='_histvalue18_';
131var histvalue19='_histvalue19_';
132
133function inputQuery(value) \{
134 if ("_cgiargqt_" == "0") \{ // text search
135 document.QueryForm.q.value += " "+value;
136 document.QueryForm.q.focus();
137 \}
138 else \{
139 if ("_cgiargb_" == "1") \{ // advanced query
140 document.QueryForm.q.value += " "+value;
141 document.QueryForm.q.focus();
142 updateq();
143 \}
144 else \{ // simple form search
145 // do something here, what??
146 \}
147 \}
148\}
149
150}
151
152_standardfunctions_{
153
154 function getstdargs() \{
155
156 stdarg = "";
157 _If_(_gselection_,_getgarg_)
158 _If_(_jselection_,_getjarg_)
159 _If_(_nselection_,_getnarg_)
160 _If_(_sqlsfselection_,_getsqlsfarg_)
161 _If_(_sfselection_,_getsfarg_)
162
163 if (document.QueryForm.t != null) \{
164 value = document.QueryForm.t.options[document.QueryForm.t.selectedIndex].value;
165 if (value != "_cgiargt_") stdarg += "&t="+value;
166 \}
167 stdarg += "&r=1&hs=1";
168 return stdarg;
169 \}
170
171}
172
173_getgarg_{
174 if (document.QueryForm.g!= null) \{
175 value = document.QueryForm.g.options[document.QueryForm.g.selectedIndex].value;
176 if (value != "_cgiargg_") stdarg += "&g="+value;
177 \}
178}
179
180_getjarg_{
181 value = document.QueryForm.j.options[document.QueryForm.j.selectedIndex].value;
182 if (value != "_cgiargj_") stdarg += "&j="+value;
183}
184
185_getnarg_{
186 value = document.QueryForm.n.options[document.QueryForm.n.selectedIndex].value;
187 if (value != "_cgiargn_") stdarg += "&n="+value;
188}
189
190# currently only supported in lucene
191_getsfarg_{
192_If_("_cgiarga__cgiargct_" eq "q2",
193 value = document.QueryForm.sf.options[document.QueryForm.sf.selectedIndex].value;
194 if (value != "_cgiargsf_") stdarg += "&sf="+value;
195)
196}
197
198# only when in sql mode
199_getsqlsfarg_{
200_If_("_cgiarga__cgiargqt_" eq "sqlq2",
201 value = document.QueryForm.sqlsf.options[document.QueryForm.sqlsf.selectedIndex].value;
202 if (value != "_cgiargsqlsf_") stdarg += "&sqlsf="+value;
203)
204}
205
206_formfunctions_{
207
208argfqf="_cgiargfqf_";
209argfqv="_cgiargfqv_";
210argfqk="_cgiargfqk_";
211argfqs="_cgiargfqs_";
212argfqc="_cgiargfqc_";
213_If_("_cgiarga_" eq "sqlq",
214argsqlfqf="_cgiargsqlfqf_";
215argsqlfqc="_cgiargsqlfqc_";
216)
217argq = "";
218
219function initialize () \{
220
221 if (document.QueryForm.fqf != null) \{initfqf(); \}
222 if (document.QueryForm.fqv != null) \{initfqv(); \}
223 if (document.QueryForm.fqs != null) \{initfqs(); \}
224 if (document.QueryForm.fqk != null) \{initfqk(); \}
225 if (document.QueryForm.fqc != null) \{initfqc(); \}
226_If_("_cgiarga_" eq "sqlq",
227 if (document.QueryForm.sqlfqf != null) \{initsqlfqf(); \}
228 if (document.QueryForm.sqlfqc != null) \{initsqlfqc(); \}
229)
230 if (document.QueryForm.q != null) \{initq(); \}
231\}
232
233// makes a form submit itself when enter is pressed in a text field
234function entersubmit(event) \{
235
236 if (window.event && window.event.keyCode == 13) \{
237 beginSearch();
238 \} else \{
239 if (event && event.which == 13) \{
240 beginSearch();
241 \} else \{
242 return true;
243 \}
244 \}
245\}
246
247
248// fqf - the field selection box
249function initfqf() \{
250 var i;
251 fqf = argfqf.split(",");
252 num_opts = document.QueryForm.fqf[0].options.length; // assumes all have the same options
253 for (i=0; i<fqf.length && i<document.QueryForm.fqf.length; i++) \{
254 if (fqf[i] != "")\{
255 for (j=0;j<num_opts;j++) \{
256 if (fqf[i]== document.QueryForm.fqf[i].options[j].value) \{
257 document.QueryForm.fqf[i].options[j].selected = true;
258 break;
259 \}
260 \}
261 \}
262 \}
263 if (fqf.length < document.QueryForm.fqf.length) \{ // initialize remaining ones
264 for (i=fqf.length;i<document.QueryForm.fqf.length;i++) \{
265 var z=i;
266 while (z >= num_opts) \{
267 z = z-(num_opts);
268 \}
269 document.QueryForm.fqf[i].options[z].selected = true;
270
271 \}
272 \}
273 updatefqf();
274
275\}
276
277function updatefqf() \{
278
279 var i;
280 argfqf = "";
281 var j = document.QueryForm.fqf[0].selectedIndex;
282 argfqf += document.QueryForm.fqf[0].options[j].value;
283 for (i=1; i<document.QueryForm.fqf.length;i++) \{
284 j = document.QueryForm.fqf[i].selectedIndex;
285 argfqf += "," + document.QueryForm.fqf[i].options[j].value;
286 \}
287
288\}
289
290
291function clearfqf() \{
292 var i;
293 for (i=0;i<document.QueryForm.fqf.length;i++) \{
294 var z = i;
295 if (i >= document.QueryForm.fqf[i].options.length) z = z-document.QueryForm.fqf[i].options.length;
296 document.QueryForm.fqf[i].options[z].selected = true;
297 \}
298 updatefqf();
299\}
300
301
302// sqlfqf - the field selection box
303function initsqlfqf() \{
304 var i;
305 sqlfqf = argsqlfqf.split(",");
306 num_opts = document.QueryForm.sqlfqf[0].options.length; // assumes all have the same options
307 for (i=0; i<sqlfqf.length && i<document.QueryForm.sqlfqf.length; i++) \{
308 if (sqlfqf[i] != "")\{
309 for (j=0;j<num_opts;j++) \{
310 if (sqlfqf[i]== document.QueryForm.sqlfqf[i].options[j].value) \{
311 document.QueryForm.sqlfqf[i].options[j].selected = true;
312 break;
313 \}
314 \}
315 \}
316 \}
317 if (sqlfqf.length < document.QueryForm.sqlfqf.length) \{ // initialize remaining ones
318 for (i=sqlfqf.length;i<document.QueryForm.sqlfqf.length;i++) \{
319 var z=i;
320 while (z >= num_opts) \{
321 z = z-(num_opts);
322 \}
323 document.QueryForm.sqlfqf[i].options[z].selected = true;
324
325 \}
326 \}
327 updatesqlfqf();
328
329\}
330
331function updatesqlfqf() \{
332
333 var i;
334 argsqlfqf = "";
335 var j = document.QueryForm.sqlfqf[0].selectedIndex;
336 argsqlfqf += document.QueryForm.sqlfqf[0].options[j].value;
337 for (i=1; i<document.QueryForm.sqlfqf.length;i++) \{
338 j = document.QueryForm.sqlfqf[i].selectedIndex;
339 argsqlfqf += "," + document.QueryForm.sqlfqf[i].options[j].value;
340 \}
341
342\}
343
344
345function clearsqlfqf() \{
346 var i;
347 for (i=0;i<document.QueryForm.sqlfqf.length;i++) \{
348 var z = i;
349 if (i >= document.QueryForm.sqlfqf[i].options.length) z = z-document.QueryForm.sqlfqf[i].options.length;
350 document.QueryForm.sqlfqf[i].options[z].selected = true;
351 \}
352 updatesqlfqf();
353\}
354
355
356
357
358// fqc - the boolean operator selection box
359function initfqc() \{
360 var i,j;
361 fqc = argfqc.split(",");
362 if (_cgiargfqn_ == 2) \{ // there will only be one fqc element
363 for (j=0;j<document.QueryForm.fqc.options.length;j++) \{
364 if (fqc[0] == document.QueryForm.fqc.options[j].value) \{
365 document.QueryForm.fqc.options[j].selected = true;
366 break;
367 \}
368 \}
369 \}
370 else \{
371 for (i=0; i<fqc.length;i++) \{
372 for (j=0;j<document.QueryForm.fqc[i].options.length;j++) \{
373 if (fqc[i] == document.QueryForm.fqc[i].options[j].value) \{
374 document.QueryForm.fqc[i].options[j].selected = true;
375 break;
376 \}
377 \}
378 \}
379 \}
380 updatefqc();
381
382\}
383
384function updatefqc() \{
385
386 var i,j;
387 argfqc = "";
388 if (_cgiargfqn_ == 2) \{
389 j = document.QueryForm.fqc.selectedIndex;
390 argfqc += document.QueryForm.fqc.options[j].value;
391 \}
392 else \{
393 j = document.QueryForm.fqc[0].selectedIndex;
394 argfqc += document.QueryForm.fqc[0].options[j].value;
395 for (i=1;i<document.QueryForm.fqc.length;i++) \{
396 j = document.QueryForm.fqc[i].selectedIndex;
397 argfqc += "," + document.QueryForm.fqc[i].options[j].value;
398 \}
399 \}
400
401\}
402
403
404function clearfqc() \{
405
406 var i;
407 if (_cgiargfqn_ == 2) \{
408 document.QueryForm.fqc.options[0].selected = true;
409 \}
410 else \{
411 for (i=0; i<document.QueryForm.fqc.length; i++) \{
412 document.QueryForm.fqc[i].options[0].selected = true;
413 \}
414 \}
415 updatefqc();
416\}
417
418
419
420// sqlfqc - the SQL operator selection box
421function initsqlfqc() \{
422 var i,j;
423 sqlfqc = argsqlfqc.split(",");
424 if (_cgiargsqlfqn_ == 2) \{ // there will only be one sqlfqc element
425 for (j=0;j<document.QueryForm.sqlfqc.options.length;j++) \{
426 if (sqlfqc[0] == document.QueryForm.sqlfqc.options[j].value) \{
427 document.QueryForm.sqlfqc.options[j].selected = true;
428 break;
429 \}
430 \}
431 \}
432 else \{
433 for (i=0; i<sqlfqc.length;i++) \{
434 for (j=0;j<document.QueryForm.sqlfqc[i].options.length;j++) \{
435 if (sqlfqc[i] == document.QueryForm.sqlfqc[i].options[j].value) \{
436 document.QueryForm.sqlfqc[i].options[j].selected = true;
437 break;
438 \}
439 \}
440 \}
441 \}
442 updatesqlfqc();
443
444\}
445
446function updatesqlfqc() \{
447
448 var i,j;
449 argsqlfqc = "";
450 if (_cgiargsqlfqn_ == 2) \{
451 j = document.QueryForm.sqlfqc.selectedIndex;
452 argsqlfqc += document.QueryForm.sqlfqc.options[j].value;
453 \}
454 else \{
455 j = document.QueryForm.sqlfqc[0].selectedIndex;
456 argsqlfqc += document.QueryForm.sqlfqc[0].options[j].value;
457 for (i=1;i<document.QueryForm.sqlfqc.length;i++) \{
458 j = document.QueryForm.sqlfqc[i].selectedIndex;
459 argsqlfqc += "," + document.QueryForm.sqlfqc[i].options[j].value;
460 \}
461 \}
462
463\}
464
465
466function clearsqlfqc() \{
467
468 var i;
469 if (_cgiargsqlfqn_ == 2) \{
470 document.QueryForm.sqlfqc.options[0].selected = true;
471 \}
472 else \{
473 for (i=0; i<document.QueryForm.sqlfqc.length; i++) \{
474 document.QueryForm.sqlfqc[i].options[0].selected = true;
475 \}
476 \}
477 updatesqlfqc();
478\}
479
480
481
482
483// fqv - the query word/phrase text box
484function initfqv() \{
485 var i;
486 fqv= argfqv.split(",");
487 for (i=0; i<fqv.length && i<document.QueryForm.fqv.length; i++) \{
488 document.QueryForm.fqv[i].value = fqv[i];
489 \}
490 updatefqv();
491
492
493\}
494
495 //argfqv += escape(format(document.QueryForm.fqv[0].value));
496
497function updatefqv() \{
498 var i;
499 argfqv="";
500 argfqv += format(document.QueryForm.fqv[0].value);
501 for (i=1; i<document.QueryForm.fqv.length;i++) \{
502 argfqv += ",";
503 argfqv += format(document.QueryForm.fqv[i].value);
504 \}
505\}
506
507function clearfqv() \{
508 var i;
509 for (i=0; i< document.QueryForm.fqv.length;i++) \{
510 document.QueryForm.fqv[i].value = "";
511 \}
512 updatefqv();
513\}
514
515// fqs - the stemming checkboxes
516function initfqs() \{
517
518 var i;
519 fqs = argfqs.split(",");
520 for (i=0; i<fqs.length; i++) \{
521 if (fqs[i]=="1") \{
522 document.QueryForm.fqs[i].checked = true;
523 \}
524 \}
525 updatefqs();
526
527\}
528
529function updatefqs() \{
530 argfqs="";
531 if (document.QueryForm.fqs[0].checked) \{
532 argfqs += "1";
533 \}
534 else \{
535 argfqs += "0";
536 \}
537 var i;
538 for (i=1; i<document.QueryForm.fqs.length; i++) \{
539 if (document.QueryForm.fqs[i].checked) \{
540 argfqs += ",1";
541 \}
542 else \{
543 argfqs += ",0";
544 \}
545 \}
546\}
547
548
549function clearfqs() \{
550 var i;
551 for (i=0; i<document.QueryForm.fqs.length; i++) \{
552 document.QueryForm.fqs[i].checked = false;
553 \}
554 updatefqs();
555\}
556
557// kqk - the casefolding checkboxes
558function initfqk() \{
559 var i;
560 fqk = argfqk.split(",");
561 for (i=0; i<fqk.length; i++) \{
562 if (fqk[i]=="1") \{
563 document.QueryForm.fqk[i].checked = true;
564 \}
565 \}
566 updatefqk();
567
568\}
569
570
571function updatefqk() \{
572 argfqk="";
573 if (document.QueryForm.fqk[0].checked) \{
574 argfqk += "1";
575 \}
576 else \{
577 argfqk += "0";
578 \}
579 var i;
580 for (i=1; i<document.QueryForm.fqk.length; i++) \{
581 if (document.QueryForm.fqk[i].checked) \{
582 argfqk += ",1";
583 \}
584 else \{
585 argfqk += ",0";
586 \}
587 \}
588\}
589
590function clearfqk() \{
591 var i;
592 for (i=0; i<document.QueryForm.fqk.length; i++) \{
593 document.QueryForm.fqk[i].checked = false;
594 \}
595 updatefqk();
596\}
597
598// q - the advanced query box
599function initq() \{
600 updateq();
601\}
602
603function updateq() \{
604
605 argq = "";
606 argq += format(document.QueryForm.q.value);
607\}
608
609function clearq() \{
610 document.QueryForm.q.value="";
611\}
612
613
614// convert commas and spaces to plus
615// also convert other illegal characters to %xx codes
616function format(string) \{
617 var str = "" + string;
618 var out = "", flag = 0;
619 var ch = "";
620 var j;
621 for (j = 0; j < str.length; j++) \{
622 ch=str.charAt(j);
623 if (ch == " "|| ch == ",") \{
624 if (flag == 0) \{
625 out += "+";
626 flag=1;
627 \}
628 continue;
629 \}
630 if (ch == ";" || ch == ":" || ch == "/" || ch == "?" ||
631 ch == "@" || ch == "&" || ch == "=" || ch == "#" ||
632 ch == "%") \{
633 out += escape(ch);
634 flag=0;
635 continue;
636 \}
637 out += str.charAt(j);
638 flag=0;
639 \}
640 return out;
641\}
642
643}
644
645#_httpquery_ has a=q&e=compressedargs
646#if adv form, need to set k=0 and s=0
647_advformargs_{_If_(_cgiargb_,&k=0&s=0)}
648
649_searchfunctions_ {
650
651function beginSearch() \{
652 window.location="_httpquery_"+getstdargs()+"_advformargs_"+getsearchargs();
653\}
654
655function runQuery() \{
656window.location="_httpquery_"+getstdargs()+"_advformargs_"+getqueryargs();
657\}
658
659function clearForm() \{
660 clearfqf();
661_If_("_cgiarga_" eq "sqlq",
662 clearsqlfqf();
663)
664 clearfqv();
665
666 if ("_cgiargb_" == "1") \{
667 clearfqk();
668 clearfqs();
669 clearfqc();
670_If_("_cgiarga_" eq "sqlq",
671 clearsqlfqc();
672)
673 \}
674
675\}
676
677}
678
679#######################################################################
680# headers
681# these are overridden so we can put an onLoad event handler
682# in the <body> tag of this page - for mgpp, form search pages
683#######################################################################
684
685#copied from prefs
686
687_header_ {_cgihead_
688_htmlhead_(class="bgimage" onLoad="initialize();")_startspacer__pagebanner_
689}
690
691# this declaration ends up being the same as style=restrict, never mind
692_header_[v=1] {_cgihead_
693_htmlhead_(onLoad="initialize();")_pagebanner_
694}
695
696#######################################################################
697# page content
698#######################################################################
699
700
701_pagetitle_ {_If_(_cgiargq_,_textquerytitle_,_textnoquerytitle_)}
702
703
704_content_ {
705
706_optnavigationbar_
707<div class="document">
708<div class="queryform">
709
710_If_("_cgiarga_" eq "sqlq",
711
712 _If_("_cgiargqt_" eq "2",_sqlfieldqueryform_,_sqlqueryform_)
713,
714 _If_(_cgiargct_,_selectqueryform_,_queryform_)
715)
716
717</div>
718
719_If_(_searchhistorylist_,<center>_searchhistorybar_</center><br>
720<center>
721_searchhistorylist_
722</center>)
723_If_(_cgiargq_,_queryresultsbar_
724<small>
725_freqmsg_
726_textpostprocess_
727_If_(_stopwordsmsg_,(_stopwordsmsg_))</small><br />
728_resultline_
729,<div class="divbar">&nbsp;</div>)
730}
731
732_selectqueryform_{_If_("_cgiargqt_" ge "1",_fieldqueryform_,_queryform_)}
733
734_queryform_ {
735<!-- query form (\_query:plainqueryform\_) -->
736<form name="QueryForm" method="get" action="_gwcgi_">
737<p>
738<input type="hidden" name="a" value="q">
739<input type="hidden" name="r" value="1">
740<input type="hidden" name="hs" value="1">
741<input type="hidden" name="e" value="_decodedcompressedoptions_">
742_queryformcontent_
743_optdatesearch_
744</p>
745</form>
746<!-- end of query form -->
747}
748
749
750_sqlqueryform_ {
751
752<!-- simple query box that requires you to type SQL where clause directly -->
753<!-- sqlquery form (\_query:plainqueryform\_) -->
754<form name="QueryForm" method="get" action="_gwcgi_">
755<p>
756<input type="hidden" name="a" value="sqlq">
757<input type="hidden" name="r" value="1">
758<input type="hidden" name="hs" value="1">
759<input type="hidden" name="e" value="_decodedcompressedoptions_">
760_sqlqueryformcontent_
761</p>
762</form>
763<!-- end of sqlquery form -->
764}
765
766
767_ifeellucky_ { <br><input type="checkbox" name="ifl" value="1">_textifeellucky_ }
768_useifeellucky_ { } # Set this to _ifeellucky_ if you want this functionality available
769
770_allowformbreak_{</span> <span class="textselect">}
771
772_queryformcontent_{
773<span class="textselect">
774_textselect_
775</span>
776
777<span class="querybox">
778_If_(_cgiargqb_,_largequerybox_,_smallquerybox_)
779_useifeellucky_
780</span>
781}
782
783
784_sqlqueryformcontent_ {
785<span class="querybox">
786_If_(_cgiargqb_,_query:largequerybox_,_query:smallquerybox_)
787_query:useifeellucky_
788</span>
789}
790
791# Automatically set by receptionist if config file switches
792# date searching on
793_optdatesearch_ { }
794
795
796_datesearch_
797{<table><tr><td>
798 <center>
799_textstartdate_
800<input type="text" name="ds" value="_cgiargds_" size="4" maxlength="4">
801<select name="dsbc" value="_cgiargdsbc_" size="1">
802 <option value="0"_If_(_cgiargdsbc_,, selected)>_textad_
803 <option value="1"_If_(_cgiargdsbc_, selected)>_textbc_
804</select>
805_textenddate_
806<input type="text" name="de" value="_cgiargde_" size="4" maxlength="4">
807<select name="debc" size="1">
808 <option value="0" _If_(_cgiargdebc_,, selected)>_textad_
809 <option value="1" _If_(_cgiargdebc_, selected)>_textbc_
810</select>
811</center>
812</td></tr>
813<tr><td>
814_textexplaineras_
815</td></tr>
816</table>
817</center>
818}
819
820_smallquerybox_ {<nobr><input type="text" name="q" value="_cgiargq_" size="50">&nbsp;<input type="submit" value="_textbeginsearch_"></nobr>}
821
822_largequerybox_ {
823<tr><td><textarea name="q" cols="63" rows="10">
824_cgiargq_
825</textarea></td></tr>
826<tr align="right"><td><table>
827<tr><td><input type="submit" value="_textbeginsearch_"></td>
828</tr></table></td></tr>}
829
830
831_fieldqueryform_ {
832<noscript>
833<p><b>_textnojsformwarning_</b></p>
834</noscript>
835<!-- field query form (\_query:fieldqueryform\_) -->
836<form name="QueryForm" method="get" action="_gwcgi_">
837
838<table><tr><td align="left">
839
840_textformselect_
841</td></tr>
842<tr><td>
843_If_(_cgiargb_,_advancedforms_,_simpleforms_)
844</td></tr>
845</table>
846_If_(_cgiargb_,<div class="divbar">&nbsp;</div>
847_advancedformextra_)
848
849</form>
850<!-- end of query form -->
851}
852
853_sqlfieldqueryform_ {
854<noscript>
855<p><b>_textnojsformwarning_</b></p>
856</noscript>
857<!--sql field query form (\_query:fieldqueryform\_) -->
858<form name="QueryForm" method="get" action="_gwcgi_">
859
860<table><tr><td align="left">
861_textformselect_
862</td></tr>
863<tr><td>
864_If_(_cgiargb_,_sqladvancedforms_,_sqlsimpleforms_)
865</td></tr>
866</table>
867_If_(_cgiargb_,<div class="divbar">&nbsp;</div>
868_advancedformextra_)
869
870</form>
871<!-- end of sql query form -->
872}
873
874
875
876_advancedforms_{
877<table border="0" cellspacing="0" cellpadding="0" width="90%">
878<tr><th></th><th align="left">_textwordphrase_</th>_If_("_cgiargct_" eq "1",<th colspan="2"><nobr>_textfoldstem_</nobr></th>)<th align="center">&nbsp;&nbsp;_textinfield_</th></tr>
879_advformlist_
880<tr>
881<td colspan="2" align="left"><input type="button" value="_textclearform_" onClick="clearForm();"></td>
882<td colspan="3" align="right"><input type="button" value="_textbeginsearch_" onClick="beginSearch();"></td>
883</tr>
884</table>
885}
886
887_sqladvancedforms_{
888<table border="0" cellspacing="0" cellpadding="0" width="90%">
889 <tr>
890 <th></th>
891 <th align="left">_textfieldphrase_</th>
892 <th></th>
893 <th align="center">&nbsp;&nbsp;_textinwords_</th>
894 </tr>
895 _sqladvformlist_
896 <tr>
897 <td colspan="2" align="left">
898 <input type="button" value="_textclearform_" onClick="clearForm();">
899 </td>
900 <td colspan="3" align="right">
901 <input type="button" value="_textbeginsearch_" onClick="beginSearch();">
902 </td>
903 </tr>
904</table>
905}
906
907
908
909_advancedformextra_{
910<table>
911<tr><td align="left">_textadvquery_</td></tr>
912<tr><td><textarea name="q" cols="57" rows="3" onChange="updateq();">_cgiargq_</textarea></td>
913<td valign="bottom">
914<input type="button" value="_textrunquery_" onClick="runQuery();"></td></tr>
915</table>
916
917
918_If_("_cgiarga_" eq "sqlq",
919<p>For example:<br>
920<i>
921 element in ('dc.Keywords') AND value='Farming'<br>
922 element in ('dls.Title') AND value LIKE 'F%'<br>
923 element in ('dls.Title') AND value<'F%'<br>
924</i>
925)
926
927}
928
929_simpleforms_{
930<table border="0" cellspacing="0" cellpadding="0" width="90%">
931<tr><th align="left">_textwordphrase_</th><th align="left">&nbsp;&nbsp;_textinfield_</th></tr>
932_regformlist_
933<tr>
934<td align="left"><input type="button" value="_textclearform_" onClick="clearForm();"></td>
935<td align="right"><input type="button" value="_textbeginsearch_" onClick="beginSearch();"></td>
936</tr>
937</table>}
938
939_sqlsimpleforms_{
940<table border="0" cellspacing="0" cellpadding="0" width="90%">
941 <tr>
942 <th align="left">_textfieldphrase_</th>
943 <th></th>
944 <th align="left">&nbsp;&nbsp;_textinwords_</th>
945 </tr>
946 _sqlregformlist_
947 <tr>
948 <td align="left">
949 <input type="button" value="_textclearform_" onClick="clearForm();">
950 </td>
951 <td align="right">
952 <input type="button" value="_textbeginsearch_" onClick="beginSearch();">
953 </td>
954 </tr>
955</table>
956}
957
958#
959# Full-text versions
960#
961
962_regformelement_{
963<tr><td><input type="text" size="39" name="fqv" onChange="updatefqv();" onkeypress="updatefqv(); entersubmit(event);"></td>
964<td>_fqfselection_</td></tr>}
965
966#has no and/or/not selection box
967_firstadvformelement_{
968<tr><td></td><td><input type="text" size="31" name="fqv" onChange="updatefqv();" onkeypress="updatefqv(); entersubmit(event);"></td>
969_If_("_cgiargct_" eq "1",<td align="center"><input type="checkbox" name="fqk" onClick="updatefqk();"></td>
970<td align="center"><input type="checkbox" name="fqs" onClick="updatefqs();"></td>)
971<td align="right">_fqfselection_</td></tr>}
972
973_advformelement_{
974<tr><td>_fqcselection_</td>
975<td><input type="text" size="31" name="fqv" onChange="updatefqv();" onkeypress="updatefqv(); entersubmit(event);"></td>
976_If_("_cgiargct_" eq "1",<td align="center"><input type="checkbox" name="fqk" onClick="updatefqk();"></td>
977<td align="center"><input type="checkbox" name="fqs" onClick="updatefqs();"></td>)
978<td align="right">_fqfselection_</td></tr>}
979
980
981
982_fqcselection_ {
983<select name="fqc" onChange="updatefqc();">
984<option value="and">_textand_
985<option value="or">_textor_
986<option value="not">_textandnot_
987</select>}
988
989
990_andorfqcselection_ {
991<select name="fqc" onChange="updatefqc();">
992<option value="and">_textand_
993<option value="or">_textor_
994</select>}
995
996
997#
998# SQL versions of regformelement, firstsqladvformelement, advformelement
999#
1000
1001_sqlregformelement_{
1002<tr>
1003 <td>
1004 _sqlfqfselection_
1005 </td>
1006 <td>
1007 _sqlfqcselection_
1008 </td>
1009 <td>
1010 <input type="text" size="39" name="fqv" onChange="updatefqv();"
1011 onkeypress="updatefqv(); entersubmit(event);">
1012 </td>
1013</tr>
1014}
1015
1016_firstsqladvformelement_{
1017<tr>
1018 <td>
1019 </td>
1020 <td align="right">
1021 _sqlfqfselection_
1022 </td>
1023 <td>
1024 _sqlfqcselection_
1025 </td>
1026 <td>
1027 <input type="text" size="31" name="fqv" onChange="updatefqv();"
1028 onkeypress="updatefqv(); entersubmit(event);">
1029 </td>
1030</tr>
1031}
1032
1033_sqladvformelement_{
1034<tr>
1035 <td>
1036 _andorfqcselection_
1037 </td>
1038 <td align="right">
1039 _sqlfqfselection_
1040 </td>
1041 <td>
1042 _sqlfqcselection_
1043 </td>
1044 <td>
1045 <input type="text" size="31" name="fqv" onChange="updatefqv();" onkeypress="updatefqv(); entersubmit(event);">
1046 </td>
1047</tr>
1048}
1049
1050
1051_sqlfqcselection_ {
1052<select name="sqlfqc" onChange="updatesqlfqc();">
1053 <option value="=">matches
1054 <option value="&lt;">&lt;
1055 <option value="&lt;=">&lt;=
1056 <option value="LIKE">like
1057 <option value="&gt;=">&gt;=
1058 <option value="&gt;">&gt;
1059 <option value="&lt;&gt;">&lt;&gt;
1060
1061</select>}
1062
1063#
1064# end of SQL version
1065#
1066
1067_textselect_ {_If_(_cgiargb_,_chooseadvancedsearch_,_choosesimplesearch_)}
1068
1069_choosesimplesearch_ {_If_("_cgiargqt_" eq "2",_textsimplesqlsearch_,_textsimplesearch_)}
1070
1071_chooseadvancedsearch_ {_If_("_cgiarqt_" eq "2",_textadvancedsqlsearch_,_choosesimplesearchct_)}
1072_chooseadvancedsearchct_ {_If_(_cgiargct_,_If_("_cgiargct_" eq "2",_textadvancedlucenesearch_,_textadvancedmgppsearch_),_textadvancedsearch_}
1073
1074# formed based versions
1075_textformselect_ {_If_(_cgiargb_,_chooseformadvancedsearch_,_chooseformsimplesearch_)}
1076_chooseformsimplesearch_ {_If_("_cgiargqt_" eq "2",_textformsimplesearchsql_,_textformsimplesearch_)}
1077
1078_chooseformadvancedsearch_ {_If_("_cgiargqt_" eq "2",_textformadvancedsearchsql_,_chooseformadvancedsearchct_)}
1079_chooseformadvancedsearchct_ {_If_("_cgiargct_" eq "1",_textformadvancedsearchmgpp_)_If_("_cgiargct_" eq "2",_textformadvancedsearchlucene_)}
1080
1081# mg uses hselection for index, mgpp uses fqfselection
1082_indexselection_{_If_(_cgiargct_,_fqfselection_,_hselection_)}
1083
1084# we want to put the links to previous/next pages of results
1085# in the footer
1086_pagefooterextra_ {
1087<center>
1088<table cellspacing="0" cellpadding="0" width="_pagewidth_">
1089<tr>
1090<td align="left">_If_(_prevfirst_,<a href="_httpquery_&amp;r=_prevfirst_">_iconprev__textmatches__prevfirst_ - _prevlast_</a>)</td>
1091<td align="right">_If_(_nextfirst_,<a href="_httpquery_&amp;r=_nextfirst_">_textmatches__nextfirst_ - _nextlast__iconnext_</a>)</td>
1092</tr></table>
1093</center>
1094
1095</div> <!-- document -->
1096}
1097
1098_querytypeselection_ {
1099<select name="t">
1100<option value="1"_If_(_cgiargt_, selected)>_If_(_cgiargb_,_textranked_,_textsome_)
1101<option value="0"_If_(_cgiargt_,, selected)>_If_(_cgiargb_,_textboolean_,_textall_)
1102</select>
1103}
1104
1105
1106_formquerytypesimpleselection_ {
1107<select name="t">
1108<option value="1"_If_(_cgiargt_, selected)>_textsome_
1109<option value="0"_If_(_cgiargt_,, selected)>_textall_
1110</select>
1111}
1112
1113_formquerytypeadvancedselection_ {
1114<select name="t">
1115<option value="1"_If_(_cgiargt_, selected)>_textranked_
1116<option value="0"_If_(_cgiargt_,, selected)>_textnatural_
1117</select>
1118}
1119
1120# this one is not used by english.dm any more. But I have added it back for the other languages that haven't updated the translations for their form search macros.
1121_formquerytypeselection_ {
1122<select name="t">
1123<option value="1"_If_(_cgiargt_, selected)>_If_(_cgiargb_,_textranked_,_textsome_)
1124<option value="0"_If_(_cgiargt_,, selected)>_If_(_cgiargb_,_textnatural_,_textall_)
1125</select>
1126}
1127
Note: See TracBrowser for help on using the repository browser.