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

Last change on this file since 28498 was 28223, checked in by kjdon, 11 years ago

tidying up advanced form stem/case/accent boxes. added in boxes and javascript for accentfolding tick boxes. Made all three dependent on ks/ss/afs support args for display - if the collection doesn't provide stemming for example, then we don't want any stemming checkboxes

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