# 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 = "_cgiargcc_"; 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 != "_cgiargel_") argel = "&el=" + value; else argel = ""; updatehrefs(); \} function updateil () \{ value = document.PrefForm.il.options[document.PrefForm.il.selectedIndex].value; if (value != "_cgiargil_") argil = "&il=" + value; else argil = ""; updatehrefs(); \} function updatefc(value) \{ if (value != _cgiargfc_) argfc = "&fc=" + value + "&f=" + value; else argfc = ""; updatehrefs(); \} function updatehl(value) \{ if (value != _cgiarghl_) 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 != _cgiargk_) argk = "&k=" + value; else argk = ""; updatehrefs(); \} function updates (value) \{ if (value != _cgiargs_) args = "&s=" + value; else args = ""; updatehrefs(); \} function updateaf (value) \{ if (value != _cgiargaf_) argaf = "&af=" + value; else argaf = ""; updatehrefs(); \} function updatem () \{ value = document.PrefForm.m.options[document.PrefForm.m.selectedIndex].value; if (value != _cgiargm_) 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; else argo = ""; updatehrefs(); \} function updateqt (value) \{ if (value != _cgiargqt_) 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 != _cgiargfqn_) argfqn = "&fqn=" + value; else argfqn = ""; updatehrefs(); \} function updateb (value) \{ if (value != _cgiargb_) argb = "&b=" + value; else argb = ""; updatehrefs(); \} function updatehd() \{ arghd=""; if (document.PrefForm.hd[0].checked) \{ if ("_cgiarghd_" != "0") arghd = "&hd=0"; \} else \{ value = document.PrefForm.hdn[document.PrefForm.hdn.selectedIndex].value; if (_cgiarghd_ != value) arghd = "&hd="+value; \} updatehrefs(); \} function updateqb() \{ value = document.PrefForm.qb.options[document.PrefForm.qb.selectedIndex].value; if (value != _cgiargqb_) 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_ {
_prefschanged_
_textsearchprefs_ |
} _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_ {
_modeoption_ _querytypedependantoptions_ _If_("_cgiargks_" eq "1",_caseoption_ ) _If_("_cgiargss_" eq "1",_stemoption_ ) _If_("_cgiargafs_" eq "1",_accentoption_ )_searchhistoryop_ _textprefop_
_collectionoption_} _presentationprefs_ {
}_If_(_languageoption_,
) _If_(_encodingoption_, _textlanguage_ _languageoption_ ) _textencoding_ _encodingoption_ _formatoption_ _htmloptions_ _If_("_tidyoption_" ne "untidy",_bookoption_ )