Changeset 4763


Ignore:
Timestamp:
2003-06-23T14:34:35+12:00 (21 years ago)
Author:
kjdon
Message:

changed the prefs slightly. now longer uses javascript to add in the form search stuff - can use the prefs page without java script now (however, cant actually do form searching without javascript yet - thats my next job :-) ) form type uses qf arg now instead of b arg, so the two can coexist on the same page. what prefs are shown depends on teh qto arg - this indicates in form, plain of both search types are available, and the prefs page changes accordingly.

File:
1 edited

Legend:

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

    r4199 r4763  
    4343  for (i = 0; i < document.links.length; i++)
    4444    savedhrefs[i] = document.links[i].href;
    45 
    46   // only add form search option if mgpp (ct arg) and javascript
    47 _If_("_cgiargct_" eq "1",var opt=new Option\("_textformsearch_"\, "1"\); document.PrefForm.qt.options[1]=opt;,//)_If_("_cgiargqt_" eq "1",opt.selected=1;)
    4845
    4946  s = "_cgiargcc_";
     
    8582  for (i = 0; i < document.links.length; i++)
    8683    savedhrefs[i] = document.links[i].href;
    87   // only add form search option if mgpp (ct arg) and javascript
    88 _If_("_cgiargct_" eq "1",var opt=new Option\("_textformsearch_"\, "1"\); document.PrefForm.qt.options[1]=opt;,//)_If_("_cgiargqt_" eq "1",opt.selected=1;)
    89 \}
     84
     85\}
     86
    9087}
    9188
    9289_getargsfunction_ {
    9390function getargs () \{
    94   return argk + args + argm + argo + argrd + arghd + argb + argqb + argfqn_If_(_collectionoption_,_ccsargs_)_If_(_htmloptions_,_htmlargs_);
     91  return argk + args + argm + argo + argrd + arghd + argb + argqf + argqb + argfqn_If_(_collectionoption_,_ccsargs_)_If_(_htmloptions_,_htmlargs_);
    9592\}
    9693}
     
    142139argo = "";
    143140argb = "";
     141argqf = "";
    144142arghd = "";
    145143argqb = "";
     
    198196  if (value != _cgiargb_) argb = "&b=" + value;
    199197  else argb = "";
     198  updatehrefs();
     199\}
     200function updateqf (value) \{
     201  if (value != _cgiargqf_) argqf = "&qf=" + value;
     202  else argqf = "";
    200203  updatehrefs();
    201204\}
     
    245248\}
    246249
    247 function updateqt () \{
    248   value = document.PrefForm.qt.options[document.PrefForm.qt.selectedIndex].value;
    249   location.href = location.href + "&qt=" + value + getargs();
     250function updateqt (value) \{
     251  if (value != _cgiargqt_) location.href = location.href + "&qt=" + value + getargs();
    250252\}
    251253}
     
    344346}
    345347
     348_formmodeoption_{
     349<td valign=baseline>_textformtype_</td>
     350<td><input type=radio name=qf value=0 onClick="updateqf(0);"
     351        _If_(_cgiargf_,, checked)>_textsimple_<br>
     352<input type=radio name=qf value=1 onClick="updateqf(1);"
     353        _If_(_cgiargqf_, checked)>_textadvanced_</td>
     354}
     355
     356_formnumfieldoption_ {<td></td><td>_textwith_
     357<select name="fqn" onChange="updatefqn();">
     358  <option value="2"_If_("_cgiargfqn_" eq "2", selected)>2 
     359  <option value="4"_If_("_cgiargfqn_" eq "4", selected)>4
     360  <option value="6"_If_("_cgiargfqn_" eq "6", selected)>6
     361  <option value="8"_If_("_cgiargfqn_" eq "8", selected)>8
     362</select>_textfields_</td>
     363}
    346364
    347365_searchhistoryop_ {
     
    428446_If_(_collectionoption_,_collectionprefs_)
    429447_presentationprefs_
    430 _If_("_cgiargct_" eq "1",_mgppsearchprefs_,_mgsearchprefs_)
    431 
     448_searchprefs_
    432449</blockquote>
    433450</form>
    434451}
    435452
    436 #search prefs for mg collections
    437 _mgsearchprefs_ {
     453#search prefs
     454_searchprefs_ {
    438455<center><table border=0 cellpadding=0 cellspacing=0 width=_pagewidth_><tr>
    439456<td><h3>_textsearchprefs_</h3></td>
     
    442459
    443460<table>
    444 <tr>_boxsizeoption_</tr>
     461_querytypedependantoptions_
    445462
    446463<tr>_caseoption_</tr>
    447464
    448465<tr>_stemoption_</tr>
    449 
    450 <tr>_modeoption_</tr>
    451466
    452467<tr>_searchhistoryop_</tr>
     
    462477_iconblankbar_
    463478<blockquote>
     479}
     480
     481_querytypedependantoptions_ {
     482_If_("_cgiargct_" eq "0", _plainqueryoptions_,_mgppqueryoptions_)
     483}
     484
     485_mgppqueryoptions_{
     486  _If_("_cgiargqto_" eq "1", _plainqueryoptions_)
     487  _If_("_cgiargqto_" eq "2", _formqueryoptions_)
     488  _If_("_cgiargqto_" eq "3", _dualqueryoptions_)
     489}
     490
     491#query options for mg colls and mgpp colls with only plain searching
     492_plainqueryoptions_ {
     493<tr>_modeoption_</tr>
     494
     495<tr>_boxsizeoption_</tr>
     496}
     497
     498#query options for mgpp colls with only form searching
     499_formqueryoptions_ {
     500<tr>_formmodeoption_</tr>
     501<tr>_formnumfieldoption_</tr>
     502}
     503
     504#query options for mgpp colls with both types of search available
     505_dualqueryoptions_ {
     506<tr><td colspan=2><input type=radio name=qt value=0 onClick="updateqt(0);" _If_(_cgiargqt_,, checked)>Plain search</td></tr>
     507<tr><td></td><td><table>_plainqueryoptions_</table></td></tr>
     508<tr><td colspan=2><input type=radio name=qt value=1 onClick="updateqt(1);" _If_(_cgiargqt_,checked)>Form search</td></tr>
     509<tr><td></td><td><table>_formqueryoptions_</table></td></tr>
    464510}
    465511
     
    486532}
    487533
    488 #######################################################
    489 ## new stuff for prefs for form vs text search - for mgpp collections
    490 _mgppsearchprefs_ {
    491 <h3>_textsearchprefs_</h3>
    492 <table>
    493 <tr>_searchtypeop_</tr>
    494 
    495 _If_(_cgiargqt_,_formsearchoptions_,_textsearchoptions_)
    496 
    497 <tr>_caseoption_</tr>
    498 
    499 <tr>_stemoption_</tr>
    500 
    501 <tr>_searchhistoryop_</tr>
    502 
    503 <tr><td colspan=2>_textprefop_</td></tr></table>
    504 <input type=submit value="Update settings"><!--non-javascript users only-->
    505 </blockquote>
    506 _iconblankbar_
    507 <blockquote>
    508 }
    509 
    510 
    511 _searchtypeop_ {
    512 <td>_texttypesearch_</td>
    513 <td><select name="qt" onChange="updateqt();">
    514   <option value="0"_If_("_cgiargqt_" eq "0", selected)>_texttextsearch_
    515 <!-- textformsearch option done in initialize function -->
    516 </select></td>
    517 }
    518 
    519 _formsearchoptions_ {
    520 <tr>_formmodeoption_</tr>
    521 }
    522 
    523 _textsearchoptions_ {
    524 <tr>_boxsizeoption_</tr>
    525 <tr>_modeoption_</tr>
    526 }
    527 
    528 _formmodeoption_{
    529 <td valign=baseline>_textformtype_</td>
    530 <td><input type=radio name=b value=0 onClick="updateb(0);"
    531         _If_(_cgiargb_,, checked)>_textsimple_<br>
    532 <input type=radio name=b value=1 onClick="updateb(1);"
    533         _If_(_cgiargb_, checked)>_textadvanced_<br>
    534 _formnumoption_</td>
    535 }
    536 
    537 _formnumoption_ {_textwith_
    538 <select name="fqn" onChange="updatefqn();">
    539   <option value="2"_If_("_cgiargfqn_" eq "2", selected)>2 
    540   <option value="4"_If_("_cgiargfqn_" eq "4", selected)>4
    541   <option value="6"_If_("_cgiargfqn_" eq "6", selected)>6
    542   <option value="8"_If_("_cgiargfqn_" eq "8", selected)>8
    543 </select>_textfields_</td>
    544 }
    545 
    546534
    547535#######################################################################
Note: See TracChangeset for help on using the changeset viewer.