Changeset 22091


Ignore:
Timestamp:
05/16/10 14:17:51 (11 years ago)
Author:
davidb
Message:

Changes to support sql query

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/macros/pref.dm

    r20744 r22091  
    148148\}
    149149
     150function replacesavedhrefs (from,to) \{
     151  for (i = 0; i < document.links.length; i++) \{
     152    var orighref = savedhrefs[i];
     153    var newhref  = orighref.replace(from,to);
     154    savedhrefs[i] = newhref;
     155  \}
     156\}
     157
    150158function updatek (value) \{
    151159  if (value != _cgiargk_) argk = "&k=" + value;
     
    191199  if (value != "_cgiargqt_") argqt = "&qt=" + value;
    192200  else argqt = "";
     201
     202  // value of 2 signifies SQL search
     203  if (value == 2) \{
     204    replacesavedhrefs(/([?|&])a=q(&?)/,"$1a=sqlq$2");
     205  \}
     206 
    193207  updatehrefs();
    194208\}
     
    338352        _If_(_cgiargqt_,, checked)>_textplainsearchtype_<br>
    339353<input type=radio name=qt value=1 onClick="updateqt(1);"
    340         _If_(_cgiargqt_, checked)>_textformsearchtype_</td>
     354        _If_(_cgiargqt_, checked)>_textformsearchtype_
     355_If_("_cgiargsqlqto_" eq "1", <br>_searchtypeoptionplussql_)
     356</td>
     357}
     358
     359_searchtypeoptionplussql_ {
     360<input type=radio name=qt value=2 onClick="updateqt(2);"
     361        _If_(_cgiargqt_, checked)>_textsqlformsearchtype_</td>
    341362}
    342363
     
    354375  <option value="6"_If_("_cgiargfqn_" eq "6", selected)>6
    355376  <option value="8"_If_("_cgiargfqn_" eq "8", selected)>8
     377</select>
     378}
     379
     380_sqlformnumfieldoption_ {
     381<select name="sqlfqn" onChange="updatesqlfqn();">
     382  <option value="2"_If_("_cgiargsqlfqn_" eq "2", selected)>2 
     383  <option value="4"_If_("_cgiargsqlfqn_" eq "4", selected)>4
     384  <option value="6"_If_("_cgiargsqlfqn_" eq "6", selected)>6
     385  <option value="8"_If_("_cgiargsqlfqn_" eq "8", selected)>8
    356386</select>
    357387}
Note: See TracChangeset for help on using the changeset viewer.