# this file must be UTF-8 encoded package preferences # set within server # collectionoption is only set when cross-collection searching is turned on _collectionoption_ {} # this macro will be set to "1" when the "source docs retrived from dl/web # button is required - i.e. whenever PreferenceDocsFromWeb isn't set to false # in collect.cfg _PreferenceDocsFromWeb_ {} # this macro will be set to _textprefschanged_ when the "set preferences" # button has been pressed _prefschanged_ {} ####################################################################### # global navigation links ####################################################################### # this is overridden here as we don't want a 'preferences' link on this page _globallinks_ {_homelink_ _helplink_} ####################################################################### # scripts # note that changing either the "m" or the "o" argument # from the preferences page necessitates reseting the "r" # argument to 1 ####################################################################### _ccsfunctions_ {argcc = ""; savedccs = new Object(); function initialize () \{ for (i = 0; i < document.links.length; i++) savedhrefs[i] = document.links[i].href; s = "_cgiargccJssafe_"; a = s.split (","); for (i = 0; i < a.length ;i++) \{ for (j = 0; j < document.PrefForm.cc.length; j++) \{ if (a[i] == document.PrefForm.elements["cc"][j].value) \{ document.PrefForm.elements["cc"][j].checked = true; savedccs[a[i]] = 1; argcc = argcc + "&cc=" + a[i]; break; \} else \{ savedccs[a[i]] = 0; \} \} \} updatehrefs(); \} function updatecc (collection) \{ if (savedccs[collection] == 1) savedccs[collection] = 0; else savedccs[collection] = 1; var i; argcc = ""; var changed = 0; for (i in savedccs) if (savedccs[i] == 1) \{ argcc += "&cc=" + i; changed = 1; \} if (changed == 1) argcc += "&r=1"; updatehrefs(); \} } _standardfunctions_ { function initialize () \{ for (i = 0; i < document.links.length; i++) savedhrefs[i] = document.links[i].href; \} } _getargsfunction_ { function getargs () \{ return argk + args + argaf + argm + argo + argrd + arghd + argb + argqb + argfqn + argqt_If_(_collectionoption_,_ccsargs_)_If_(_htmloptions_,_htmlargs_); \} } _ccsargs_ {+ argcc} _htmlargs_ {+ argel + argil + argfc + arghl} _htmlfunctions_ {argel = ""; argil = ""; argfc = ""; arghl = ""; function updateel () \{ value = document.PrefForm.el.options[document.PrefForm.el.selectedIndex].value; if (value != "_cgiargelJssafe_") argel = "&el=" + value; else argel = ""; updatehrefs(); \} function updateil () \{ value = document.PrefForm.il.options[document.PrefForm.il.selectedIndex].value; if (value != "_cgiargilJssafe_") argil = "&il=" + value; else argil = ""; updatehrefs(); \} function updatefc(value) \{ if (value != "_cgiargfcJssafe_") argfc = "&fc=" + value + "&f=" + value; else argfc = ""; updatehrefs(); \} function updatehl(value) \{ if (value != "_cgiarghlJssafe_") arghl = "&hl=" + value; else arghl = ""; updatehrefs(); \} } _pagescriptextra_ { // preferences scripts generated from \_preferences:pagescriptextra\_ savedhrefs = new Object(); argk = ""; args = ""; argm = ""; argrd = ""; argo = ""; argb = ""; arghd = ""; argqb = ""; argfqn = ""; argqt= ""; argaf = ""; _If_(_collectionoption_,_ccsfunctions_,_standardfunctions_) _If_(_htmloptions_,_htmlfunctions_) _getargsfunction_ function updatehrefs () \{ for (i = 0; i < document.links.length; i++) document.links[i].href = savedhrefs[i] + getargs(); \} function replacesavedhrefs (from,to) \{ for (i = 0; i < document.links.length; i++) \{ var orighref = savedhrefs[i]; var newhref = orighref.replace(from,to); savedhrefs[i] = newhref; \} \} function updatek (value) \{ if (value != "_cgiargkJssafe_") argk = "&k=" + value; else argk = ""; updatehrefs(); \} function updates (value) \{ if (value != "_cgiargsJssafe_") args = "&s=" + value; else args = ""; updatehrefs(); \} function updateaf (value) \{ if (value != "_cgiargafJssafe_") argaf = "&af=" + value; else argaf = ""; updatehrefs(); \} function updatem () \{ value = document.PrefForm.m.options[document.PrefForm.m.selectedIndex].value; if (value != "_cgiargmJssafe_") argm = "&r=1&m=" + value; else argm = ""; updatehrefs(); \} function updaterd () \{ if (document.PrefForm.rd.checked) _If_("_cgiargrd_" eq "1",argrd="";,argrd="&rd=1";) else _If_("_cgiargrd_" ne "1",argrd="";,argrd="&rd=0";) updatehrefs(); \} function updateo () \{ value = document.PrefForm.o.options[document.PrefForm.o.selectedIndex].value; //if (value != cgiargo ) argo = "&r=1&o=" + value; if (value != "_cgiargoJssafe_") argo = "&r=1&o=" + value; else argo = ""; updatehrefs(); \} function updateqt (value) \{ if (value != "_cgiargqtJssafe_") argqt = "&qt=" + value; else argqt = ""; // value of 2 signifies SQL search if (value == 2) \{ replacesavedhrefs(/([?|&])a=q(&?)/,"$1a=sqlq$2"); \} updatehrefs(); \} function updatefqn () \{ value = document.PrefForm.fqn.options[document.PrefForm.fqn.selectedIndex].value; if (value != "_cgiargfqnJssafe_") argfqn = "&fqn=" + value; else argfqn = ""; updatehrefs(); \} function updateb (value) \{ if (value != "_cgiargbJssafe_") argb = "&b=" + value; else argb = ""; updatehrefs(); \} function updatehd() \{ arghd=""; if (document.PrefForm.hd[0].checked) \{ if ("_cgiarghdJssafe_" != "0") arghd = "&hd=0"; \} else \{ value = document.PrefForm.hdn[document.PrefForm.hdn.selectedIndex].value; if ("_cgiarghdJssafe_" != value) arghd = "&hd="+value; \} updatehrefs(); \} function updateqb() \{ value = document.PrefForm.qb.options[document.PrefForm.qb.selectedIndex].value; if (value != "_cgiargqbJssafe_") argqb = "&qb=" + value; else argqb = ""; updatehrefs(); \} function updatel () \{ value = document.PrefForm.l.options[document.PrefForm.l.selectedIndex].value; href = location.href; if (href.match(/&l=[\\w\\-]+/)) href = href.replace(/&l=[\\w\\-]+/, "&l=" + value); else href += "&l=" + value; if (!location.href.match(/&nl=1$/)) href += "&nl=1"; while (href.match(/&cc=[\\w]+/)) href = href.replace(/&cc=[\\w]+/, ""); location.href = href + getargs(); \} function updatev () \{ value = document.PrefForm.v.options[document.PrefForm.v.selectedIndex].value; href = location.href; if (href.match(/&v=\\d/)) href = href.replace(/&v=\\d/, "&v=" + value); else href += "&v=" + value; while (href.match(/&cc=[\\w]+/)) href = href.replace(/&cc=[\\w]+/, ""); location.href = href + getargs(); \} function updatew () \{ value = document.PrefForm.w.options[document.PrefForm.w.selectedIndex].value; href = location.href; if (href.match(/&nw=[^&]+/)) href = href.replace(/&nw=[^&]+/, "&nw=" + value); else href += "&nw=" + value; if (!location.href.match(/&nl=0$/)) href += "&nl=0"; while (href.match(/&cc=[\\w]+/)) href = href.replace(/&cc=[\\w]+/, ""); location.href = href + getargs(); \} function updatebook () \{ value = document.PrefForm.book.options[document.PrefForm.book.selectedIndex].value; href = location.href; if (href.match(/&book=[^&]+/)) href = href.replace(/&book=[^&]+/, "&book=" + value); else href += "&book=" + value; while (href.match(/&cc=[\\w]+/)) href = href.replace(/&cc=[\\w]+/, ""); location.href = href + getargs(); \} } ####################################################################### # headers # these are overridden so we can put an onLoad event handler # in the tag of this page ####################################################################### _header_ {_cgihead_ _htmlhead_(class="bgimage" onLoad="initialize();")_startspacer__pagebanner_ } # this declaration ends up being the same as style=restrict, never mind _header_[v=1] {_cgihead_ _htmlhead_(onLoad="initialize();")_pagebanner_ } ####################################################################### # page content ####################################################################### _pagetitle_ {_collectionname_: _textpreferences_} _imagethispage_ {_textpreferences_} _htmloptions_ {} _htmloptionson_ {

_fcoption_

_hloption_

_extlinkoption_ _If_(_PreferenceDocsFromWeb_,

_intlinkoption_) } _fcoption_ { _textdoclayout_ _textlayoutnavbar_
_textlayoutnonavbar_ } _hloption_ { _texttermhighlight_ _texttermhighlighton_
_texttermhighlightoff_ } #search pref options # search type option _searchtypeoptionplain_ { _textsearchtype_ _textplainsearchtype_ } _searchtypeoptionform_ { _textsearchtype_ _textformsearchtype_ } _searchtypeoptionboth_ { _textsearchtype_ _textplainsearchtype_
_textformsearchtype_ _If_("_cgiargsqlqto_" eq "1",
_searchtypeoptionplussql_) } _searchtypeoptionplussql_ { _textsqlformsearchtype_ } _boxsizeoption_{ } _formnumfieldoption_ { } _sqlformnumfieldoption_ { } _modeoption_ { _textquerymode_ _textsimplemode_
_textadvancedmode_ } _caseoption_ { _textcasediffs_ _textignorecase_
_textmatchcase_ } _caseoption_ [l=ar] {} _caseoption_ [l=zh] {} _stemoption_ { _textwordends_ _textstem_
_textnostem_ } _stemoption_ [l=zh] {} _accentoption_ { _textaccentdiffs_ _textignoreaccents_
_textmatchaccents_ } _searchhistoryop_ { _textsearchhistory_ _textnohistorydisplay_
_texthistorydisplay_ } _relateddocop_ { Display related documents } _historynumrecords_{} _maxdocoption_ { } _hitsperpageoption_ { } _extlinkoption_ { _textextlink_ } _intlinkoption_ { _textintlink_ } # set from within pageaction _languageoption_ {} _encodingoption_ {} _formatoption_ { _textformat_ } _bookoption_ { _textbookoption_ } _content_ { _optnavigationbar_ _If_(_prefschanged_,

_prefschanged_

 
)
_If_(_collectionoption_,_collectionprefs_) _presentationprefs_ _searchprefs_
} #search prefs _searchprefs_ {

_textsearchprefs_

_modeoption__querytypedependantoptions_ _If_("_cgiargks_" eq "1", _caseoption_ ) _If_("_cgiargss_" eq "1", _stemoption_ ) _If_("_cgiargafs_" eq "1", _accentoption_ ) _searchhistoryop_
_textprefop_
 
} _querytypedependantoptions_ { _If_("_cgiargct_" eq "0",_searchtypeoptionplain_,_mgppqueryoptions_) } _mgppqueryoptions_ { _If_("_cgiargqto_" eq "1", _searchtypeoptionplain_) _If_("_cgiargqto_" eq "2", _searchtypeoptionform_) _If_("_cgiargqto_" eq "3", _searchtypeoptionboth_) } # should this go somewhere?? # _collectionprefs_ {

_textcollectionprefs_

_collectionoption_
 
} _presentationprefs_ {

_textpresentationprefs_

_If_(_languageoption_,) _If_(_encodingoption_,) _formatoption_ _htmloptions_ _If_("_tidyoption_" ne "untidy",_bookoption_)
_textlanguage__languageoption_
_textencoding__encodingoption_
 
}