Changeset 12780


Ignore:
Timestamp:
2006-09-20T09:31:39+12:00 (18 years ago)
Author:
kjdon
Message:

query form rejigging. mainly for lucene, removed t option for advanced searches, added sf option (sort field), also made the forms left aligned. removed stem and case from lucene advanced form

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/macros/query.dm

    r12768 r12780  
    152152    _If_(_jselection_,_getjarg_)
    153153    _If_(_nselection_,_getnarg_)
    154 
    155     value = document.QueryForm.t.options[document.QueryForm.t.selectedIndex].value;
    156     if (value != "_cgiargt_") stdarg += "&t="+value;
    157 
     154    _If_(_sfselection_,_getsfarg_)
     155    if (document.QueryForm.t != null) \{
     156      value = document.QueryForm.t.options[document.QueryForm.t.selectedIndex].value;
     157      if (value != "_cgiargt_") stdarg += "&t="+value;
     158    \}
    158159    stdarg += "&r=1&hs=1";   
    159160    return stdarg;
     
    177178    value = document.QueryForm.n.options[document.QueryForm.n.selectedIndex].value;
    178179    if (value != "_cgiargn_") stdarg += "&n="+value;
     180}
     181
     182_getsfarg_{
     183    value = document.QueryForm.sf.options[document.QueryForm.sf.selectedIndex].value;
     184    if (value != "_cgiargsf_") stdarg += "&sf="+value;
    179185}
    180186
     
    190196function initialize () \{
    191197
    192    if (document.QueryForm.fqf != null) \{initfqf();\}
    193    initfqv();
    194    if ( "_cgiargb_" == "1") \{
    195       initfqs();       
    196       initfqk();
    197       initfqc();
    198       initq();
    199    \}
    200    
     198   if (document.QueryForm.fqf != null) \{initfqf(); \}
     199   if (document.QueryForm.fqv != null) \{initfqv(); \}
     200   if (document.QueryForm.fqs != null) \{initfqs(); \}
     201   if (document.QueryForm.fqk != null) \{initfqk(); \}
     202   if (document.QueryForm.fqc != null) \{initfqc(); \}
     203   if (document.QueryForm.q != null) \{initq(); \}   
    201204\}
    202205
     
    215218\}
    216219
     220   
    217221// fqf - the field selection box
    218222function initfqf() \{
     
    548552_If_(_cgiargct_,_selectqueryform_,_queryform_)
    549553</div>
     554
    550555_If_(_searchhistorylist_,<center>_searchhistorybar_</center><br>
    551556<center>
     
    580585_ifeellucky_ { <br><input type="checkbox" name="ifl">_textifeellucky_ }
    581586_useifeellucky_ { }  # Set this to _ifeellucky_ if you want this functionality available
     587
     588_allowformbreak_{</span>  <span class="textselect">}
    582589
    583590_queryformcontent_{
     
    621628}
    622629
    623 _smallquerybox_ {<input type="text" name="q" value="_cgiargq_" size="50">&nbsp;<input type="submit" value="_textbeginsearch_">}
     630_smallquerybox_ {<nobr><input type="text" name="q" value="_cgiargq_" size="50">&nbsp;<input type="submit" value="_textbeginsearch_"></nobr>}
    624631
    625632_largequerybox_ {
     
    639646<form name="QueryForm" method="get" action="_gwcgi_">
    640647
    641 <table><tr><td>
    642 <nobr>
     648<table><tr><td align="left">
    643649_textformselect_
    644 </nobr>
    645650</td></tr>
     651<tr><td>
    646652_If_(_cgiargb_,_advancedforms_,_simpleforms_)
     653</tr></td>
    647654</table>
    648655_If_(_cgiargb_,<div class="divbar">&nbsp;</div>
    649 <center>_advancedformextra_</center>)
     656_advancedformextra_)
    650657
    651658</form>
     
    654661
    655662_advancedforms_{
    656 <tr><td><center> <table border="0" cellspacing="0" cellpadding="0" width="90%">
    657 <tr><th></th><th align="left">_textwordphrase_</th><th colspan="2"><nobr>_textfoldstem_</nobr></th><th align="center">&nbsp;&nbsp;_textinfield_</th></tr>   
     663<table border="0" cellspacing="0" cellpadding="0" width="90%">
     664<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>
    658665_advformlist_
    659 <tr><td colspan="2"><input type="button" value="_textclearform_" onClick="clearForm();"></td>
    660 <td colspan="3"><table>
    661 <tr><td><input type="button" value="_textbeginsearch_" onClick="beginSearch();"></td>
    662 </tr></table></td></tr>
    663 </table></td></tr>
     666<tr>
     667<td colspan="2" align="left"><input type="button" value="_textclearform_" onClick="clearForm();"></td>
     668<td colspan="3" align="right"><input type="button" value="_textbeginsearch_" onClick="beginSearch();"></td>
     669</tr>
     670</table>
    664671}
    665672
    666673_advancedformextra_{
    667674<table>
    668 <tr><td>_textadvquery_</td></tr>
     675<tr><td align="left">_textadvquery_</td></tr>
    669676<tr><td><textarea name="q" cols="57" rows="3" onChange="updateq();">_cgiargq_</textarea></td>
    670677<td valign="bottom">
     
    674681
    675682_simpleforms_{
    676 <tr><td><center> <table border="0" cellspacing="0" cellpadding="0" width="90%">
     683<table border="0" cellspacing="0" cellpadding="0" width="90%">
    677684<tr><th align="left">_textwordphrase_</th><th align="left">&nbsp;&nbsp;_textinfield_</th></tr> 
    678685_regformlist_
    679 <tr><td><input type="button" value="_textclearform_" onClick="clearForm();"></td>
    680 <td><table>
    681 <tr><td><input type="button" value="_textbeginsearch_" onClick="beginSearch();"></td>
     686<tr>
     687<td align="left"><input type="button" value="_textclearform_" onClick="clearForm();"></td>
     688<td align="right"><input type="button" value="_textbeginsearch_" onClick="beginSearch();"></td>
    682689</tr>
    683 </table></td></tr>
    684 </table></td></tr>}
     690</table>}
    685691
    686692_regformelement_{
    687 <td><input type="text" size="39" name="fqv" onChange="updatefqv();" onkeypress="updatefqv(); entersubmit(event);"></td>
    688 <td>_fqfselection_</td>}
     693<tr><td><input type="text" size="39" name="fqv" onChange="updatefqv();" onkeypress="updatefqv(); entersubmit(event);"></td>
     694<td>_fqfselection_</td></tr>}
    689695
    690696#has no and/or/not selection box
    691697_firstadvformelement_{
    692 <td></td><td><input type="text" size="31" name="fqv" onChange="updatefqv();" onkeypress="updatefqv(); entersubmit(event);"></td>
    693 <td align="center"><input type="checkbox" name="fqk" onClick="updatefqk();"></td>
    694 <td align="center"><input type="checkbox" name="fqs" onClick="updatefqs();"></td>
    695 <td align="right">_fqfselection_</td>}
     698<tr><td></td><td><input type="text" size="31" name="fqv" onChange="updatefqv();" onkeypress="updatefqv(); entersubmit(event);"></td>
     699_If_("_cgiargct_" eq "1",<td align="center"><input type="checkbox" name="fqk" onClick="updatefqk();"></td>
     700<td align="center"><input type="checkbox" name="fqs" onClick="updatefqs();"></td>)
     701<td align="right">_fqfselection_</td></tr>}
    696702
    697703_advformelement_{
    698 <td>_fqcselection_</td>
     704<tr><td>_fqcselection_</td>
    699705<td><input type="text" size="31" name="fqv" onChange="updatefqv();" onkeypress="updatefqv(); entersubmit(event);"></td>
    700 <td align="center"><input type="checkbox" name="fqk" onClick="updatefqk();"></td>
    701 <td align="center"><input type="checkbox" name="fqs" onClick="updatefqs();"></td>
    702 <td align="right">_fqfselection_</td>}
     706_If_("_cgiargct_" eq "1",<td align="center"><input type="checkbox" name="fqk" onClick="updatefqk();"></td>
     707<td align="center"><input type="checkbox" name="fqs" onClick="updatefqs();"></td>)
     708<td align="right">_fqfselection_</td></tr>}
     709
     710
    703711
    704712_fqcselection_ {
     
    711719_textselect_ {_If_(_cgiargb_,_chooseadvancedsearch_,_textsimplesearch_)}
    712720_chooseadvancedsearch_ {_If_(_cgiargct_,_If_("_cgiargct_" eq "2",_textadvancedlucenesearch_,_textadvancedmgppsearch_),_textadvancedsearch_}
    713 _textformselect_ {_If_(_cgiargb_,_textformadvancedsearch_,_textformsimplesearch_)}
     721_textformselect_ {_If_(_cgiargb_,_chooseformadvancedsearch_,_textformsimplesearch_)}
     722_chooseformadvancedsearch_ {_If_("_cgiargct_" eq "1",_textformadvancedsearchmgpp_)_If_("_cgiargct_" eq "2",_textformadvancedsearchlucene_)}
     723
    714724# mg uses hselection for index, mgpp uses fqfselection
    715725_indexselection_{_If_(_cgiargct_,_fqfselection_,_hselection_)}
Note: See TracChangeset for help on using the changeset viewer.