Ignore:
Timestamp:
2000-01-27T09:33:49+13:00 (24 years ago)
Author:
sjboddie
Message:

lots of changes - including separating out all language strings
into separate files.

File:
1 edited

Legend:

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

    r735 r876  
    11package preferences
     2
     3# set within server
     4
     5# collectionoption is only set when cross-collection searching is turned on
     6_collectionoption_ {}
     7
     8# this macro will be set to "1" when the "source docs retrived from dl/web
     9# button is required - i.e. whenever PreferenceDocsFromWeb isn't set to false
     10# in collect.cfg
     11_PreferenceDocsFromWeb_ {}
    212
    313
     
    2434#######################################################################
    2535
     36_ccsfunctions_ {argcc = "";
     37savedccs = new Object();
     38
     39function initialize () \{
     40  for (i = 0; i < document.links.length; i++)
     41    savedhrefs[i] = document.links[i].href;
     42
     43  s = "_cgiargcc_";
     44  a = s.split (",");
     45  for (i = 0; i < a.length ;i++) \{
     46    for (j = 0; j < document.PrefForm.cc.length; j++) \{
     47      if (a[i] == document.PrefForm.elements["cc"][j].value) \{
     48        document.PrefForm.elements["cc"][j].checked = true;
     49        savedccs[a[i]] = 1;
     50        argcc = argcc + "&cc=" + a[i];
     51        break;
     52      \} else \{
     53        savedccs[a[i]] = 0;
     54      \}
     55    \}
     56  \}
     57  updatehrefs();
     58\}
     59
     60function updatecc (collection) \{
     61  if (savedccs[collection] == 1) savedccs[collection] = 0;
     62  else savedccs[collection] = 1;
     63       
     64  var i;
     65  argcc = "";
     66  for (i in savedccs)
     67    if (savedccs[i] == 1) argcc += "&cc=" + i;
     68  updatehrefs();
     69\}
     70}
     71
     72_standardfunctions_ {
     73function initialize () \{
     74  for (i = 0; i < document.links.length; i++)
     75    savedhrefs[i] = document.links[i].href;
     76\}
     77}
     78
     79_getargsfunction_ {
     80function getargs () \{
     81  return argk + args + argm + argo + argb_If_('_cgiargccs_ == 1',_ccsargs_)_If_(_htmloptions_,_htmlargs_);
     82\}
     83}
     84
     85_ccsargs_ {+ argcc}
     86_htmlargs_ {+ argel + argil + argfc + arghl}
     87
     88_htmlfunctions_ {argel = "";
     89argil = "";
     90argfc = "";
     91arghl = "";
     92
     93function updateel () \{
     94  value = document.PrefForm.el.options[document.PrefForm.el.selectedIndex].value;
     95  if (value != "_cgiargel_") argel = "&el=" + value;
     96  else argel = "";
     97  updatehrefs();
     98\}
     99
     100function updateil () \{
     101  value = document.PrefForm.il.options[document.PrefForm.il.selectedIndex].value;
     102  if (value != "_cgiargil_") argil = "&il=" + value;
     103  else argil = "";
     104  updatehrefs();
     105\}
     106
     107function updatefc () \{
     108  if (document.PrefForm.fc.checked)
     109    _If_("_cgiargfc_" eq "1",_argfcblank_,_argfcon_)
     110  else
     111    _If_("_cgiargfc_" ne "1",_argfcblank_,_argfcoff_)
     112  updatehrefs();
     113\}
     114
     115function updatehl () \{
     116  if (document.PrefForm.hl.checked)
     117    _If_("_cgiarghl_" eq "1",_arghlblank_,_arghlon_)
     118  else
     119    _If_("_cgiarghl_" ne "1",_arghlblank_,_arghloff_)
     120  updatehrefs();
     121\}
     122}
     123
     124_argfcblank_ {argfc = "";}
     125_argfcon_ {argfc = "&fc=1&f=1";}
     126_argfcoff_ {argfc = "&fc=0&f=0";}
     127
     128_arghlblank_ {arghl = "";}
     129_arghlon_ {arghl = "&hl=1";}
     130_arghloff_ {arghl = "&hl=0";}
     131
    26132_pagescriptextra_ {
    27133// preferences scripts generated from \_preferences:pagescriptextra\_
    28134
    29     savedhrefs = new Object();
    30 
    31     argk = "";
    32     args = "";     
    33     argm = "";
    34     argo = "";
    35     argb = "";
    36         argel = "";
    37         argil = "";
    38 
    39     function initialize () \{
    40         for (i = 0; i < document.links.length; i++)
    41             savedhrefs[i] = document.links[i].href;
    42     \}
    43 
    44     function updatehrefs () \{
    45         for (i = 0; i < document.links.length; i++)
    46             document.links[i].href = savedhrefs[i] + argk + args + argm + argo + argb + argel + argil;
    47     \}
    48 
    49     function updatek (value) \{
    50         if (value != _cgiargk_) argk = "&k=" + value;
    51         else argk = "";
    52         updatehrefs();
    53     \}
    54 
    55     function updates (value) \{
    56         if (value != _cgiargs_) args = "&s=" + value;
    57         else args = "";
    58         updatehrefs();
    59     \}
    60 
    61     function updatem () \{
    62         value = document.PrefForm.m.options[document.PrefForm.m.selectedIndex].value;
    63         if (value != _cgiargm_) argm = "&r=1&m=" + value;
    64         else argm = "";
    65         updatehrefs();
    66     \}
    67 
    68     function updateo () \{
    69         value = document.PrefForm.o.options[document.PrefForm.o.selectedIndex].value;
    70         if (value != _cgiargo_) argo = "&r=1&o=" + value;
    71         else argo = "";
    72         updatehrefs();
    73     \}
    74 
    75     function updateb (value) \{
    76         if (value != _cgiargb_) argb = "&b=" + value;
    77         else argb = "";
    78         updatehrefs();
    79     \}
    80 
    81     function updateel () \{
    82         value = document.PrefForm.el.options[document.PrefForm.el.selectedIndex].value;
    83         if (value != "_cgiargel_") argel = "&el=" + value;
    84         else argel = "";
    85         updatehrefs();
    86     \}
    87 
    88     function updateil () \{
    89         value = document.PrefForm.il.options[document.PrefForm.il.selectedIndex].value;
    90         if (value != "_cgiargil_") argil = "&il=" + value;
    91         else argil = "";
    92         updatehrefs();
    93     \}
    94 
    95     function updatel () \{
    96         value = document.PrefForm.l.options[document.PrefForm.l.selectedIndex].value;
    97         location.href = location.href + argk + args + argm + argo + argb + argel + argil + "&l=" + value;
    98     \}
    99 
    100     function updatev () \{
    101         value = document.PrefForm.v.options[document.PrefForm.v.selectedIndex].value;
    102         location.href = location.href + argk + args + argm + argo + argb + argel + argil + "&v=" + value;
    103     \}
    104 
    105     function updatew () \{
    106         value = document.PrefForm.w.options[document.PrefForm.w.selectedIndex].value;
    107         location.href = location.href + argk + args + argm + argo + argb + argel + argil + "&nw=" + value;
    108     \}
    109 
     135savedhrefs = new Object();
     136
     137argk = "";
     138args = "";     
     139argm = "";
     140argo = "";
     141argb = "";
     142_If_('_cgiargccs_ == 1',_ccsfunctions_,_standardfunctions_)
     143_If_(_htmloptions_,_htmlfunctions_)
     144_getargsfunction_
     145function updatehrefs () \{
     146  for (i = 0; i < document.links.length; i++)
     147    document.links[i].href = savedhrefs[i] + getargs();
     148\}
     149
     150function updatek (value) \{
     151  if (value != _cgiargk_) argk = "&k=" + value;
     152  else argk = "";
     153  updatehrefs();
     154\}
     155
     156function updates (value) \{
     157  if (value != _cgiargs_) args = "&s=" + value;
     158  else args = "";
     159  updatehrefs();
     160\}
     161
     162function updatem () \{
     163  value = document.PrefForm.m.options[document.PrefForm.m.selectedIndex].value;
     164  if (value != _cgiargm_) argm = "&r=1&m=" + value;
     165  else argm = "";
     166  updatehrefs();
     167\}
     168
     169function updateo () \{
     170  value = document.PrefForm.o.options[document.PrefForm.o.selectedIndex].value;
     171  if (value != _cgiargo_) argo = "&r=1&o=" + value;
     172  else argo = "";
     173  updatehrefs();
     174\}
     175
     176function updateb (value) \{
     177  if (value != _cgiargb_) argb = "&b=" + value;
     178  else argb = "";
     179  updatehrefs();
     180\}
     181
     182function updatel () \{
     183  value = document.PrefForm.l.options[document.PrefForm.l.selectedIndex].value;
     184  location.href = location.href + "&l=" + value + getargs();
     185\}
     186
     187function updatev () \{
     188  value = document.PrefForm.v.options[document.PrefForm.v.selectedIndex].value;
     189  location.href = location.href + "&v=" + value + getargs();
     190\}
     191
     192function updatew () \{
     193  value = document.PrefForm.w.options[document.PrefForm.w.selectedIndex].value;
     194  location.href = location.href + "&nw=" + value + getargs();
     195\}
    110196}
    111197
     
    133219_pagetitle_ {_collectionname_: _textpreferences_}
    134220_imagethispage_ {_iconthispage_}
     221
     222_htmloptions_ {}
     223
     224_htmloptionson_ {
     225<p>
     226_fcoption_
     227<p>
     228_hloption_
     229<p>
     230_extlinkoption_
     231_If_(_PreferenceDocsFromWeb_,<p>
     232_intlinkoption_)
     233}
    135234
    136235_caseoption_ {
     
    141240}
    142241
     242_fcoption_ {
     243<input type=checkbox name=fc onClick="updatefc();"_If_("_cgiargfc_" eq "1", checked)>
     244_textfcoption_
     245}
     246
     247_hloption_ {
     248<input type=checkbox name=hl onClick="updatehl();"_If_("_cgiarghl_" eq "1", checked)>
     249_texthloption_
     250}
     251
    143252_caseoption_ [l=zh] {}
    144253
    145254_stemoption_ {
    146255<input type=radio name=s value=1 onClick="updates(1);"
    147         _If_(_cgiargs_, checked)>_textstem_<br>
     256  _If_(_cgiargs_, checked)>_textstem_<br>
    148257<input type=radio name=s value=0 onClick="updates(0);"
    149         _If_(_cgiargs_,, checked)>_textnostem_
     258  _If_(_cgiargs_,, checked)>_textnostem_
    150259}
    151260
     
    165274  <option value="20"_If_("_cgiargo_" eq "20", selected)>20
    166275  <option value="50"_If_("_cgiargo_" eq "50", selected)>50
    167   <option value="100")_If_("_cgiargo_" eq "100", selected)>all
     276  <option value="100")_If_("_cgiargo_" eq "100", selected)>_textall_
    168277</select>
    169278}
     
    180289<select name="el" onChange="updateel();">
    181290  <option value="prompt"_If_("_cgiargel_" eq "prompt", selected)>
    182      through intermediate page
     291     _textlinkinterm_
    183292  <option value="direct"_If_("_cgiargel_" eq "direct", selected)>
    184      go directly there
     293     _textlinkdirect_
    185294</select>
    186295}
     
    190299<select name="il" onChange="updateil();">
    191300  <option value="l"_If_("_cgiargil_" eq "l", selected)>
    192      the digital library
     301     _textdigitlib_
    193302  <option value="w"_If_("_cgiargil_" eq "w", selected)>
    194      the Web
    195 </select>
    196 }
    197 
    198 
    199 _languageoption_ {
    200 _textlanguage_
    201 <select name="l" onChange="updatel();">
    202   <option value="en"_If_("_cgiargl_",, selected)_If_("_cgiargl_" eq "en", selected)>English
    203   <option value="mi"_If_("_cgiargl_" eq "mi", selected)>M&auml;ori
    204   <option value="zh"_If_("_cgiargl_" eq "zh", selected)>Chinese
    205 </select>
    206 }
     303     _textweb_
     304</select>
     305}
     306
     307_languageoption_ {}
     308
     309_enlanguageoption_ {<option value="en"_If_("_cgiargl_",, selected)_If_("_cgiargl_" eq "en", selected)>_textlangeng_}
     310_milanguageoption_ {<option value="mi"_If_("_cgiargl_" eq "mi", selected)>_textlangmaori_}
     311_zhlanguageoption_ {<option value="zh"_If_("_cgiargl_" eq "zh", selected)>_textlangchinese_}
    207312
    208313_encodingoption_ {
     
    231336<form name=PrefForm method=get action="_gwcgi_">
    232337
    233 <input type="hidden" name="e" value="_compressedoptions_">
    234 
    235 <p>
    236 _caseoption_
    237 
    238 <p>
    239 _stemoption_
    240 
    241 <p>
    242 _textprefop_
    243 
    244 <p>
    245 _modeoption_
    246 
    247 <p>
    248 _extlinkoption_
    249 
    250 <p>
    251 _intlinkoption_
    252 
    253 <p>
    254 _languageoption_
    255 
    256 <p>
    257 _encodingoption_
    258 
    259 <p>
    260 _formatoption_
     338<input type="hidden" name="e" value="_decodedcompressedoptions_">
     339
     340_If_(_collectionoption_,_collectionprefs_)
     341_presentationprefs_
     342_searchprefs_
    261343
    262344</blockquote>
     
    264346}
    265347
     348_searchprefs_ {
     349<h3>_textsearchprefs_</h3>
     350<p>
     351_caseoption_
     352
     353<p>
     354_stemoption_
     355
     356<p>
     357_modeoption_
     358
     359<p>
     360_textprefop_
     361<br>_iconblankbar_
     362}
     363
     364_collectionprefs_ {
     365<h3>_textcollectionprefs_</h3>
     366_collectionoption_
     367<br>_iconblankbar_
     368}
     369
     370_presentationprefs_ {
     371<h3>_textpresentationprefs_</h3>
     372_htmloptions_
     373
     374<p>
     375_languageoption_
     376
     377<p>
     378_encodingoption_
     379
     380<p>
     381_formatoption_
     382<br>_iconblankbar_
     383}
    266384
    267385#######################################################################
     
    284402
    285403
    286 #######################################################################
    287 # english macros
    288 #######################################################################
    289 
    290 _textpreferences_ {Preferences}
    291 _textignorecase_ { ignore case differences}
    292 _textmatchcase_ { upper/lower case must match}
    293 _textstem_ { ignore word endings}
    294 _textnostem_ { whole word must match}
    295 _textprefop_ {Return up to _maxdocoption_ hits with _hitsperpageoption_ hits per page.}
    296 _textextlink_ {Access to external Web pages: }
    297 _textintlink_ {Source documents retrieved from:}
    298 _textlanguage_ {Interface language: }
    299 _textencoding_ {Encoding: }
    300 _textformat_ {Interface format: }
    301 _textsimplemode_ {simple query mode}
    302 _textadvancedmode_ {advanced query mode (allows boolean searching using !, &, |, and parenthesis)}
    303 _textgraphical_ {Graphical}
    304 _texttextual_ {Textual}
    305 
    306 
    307 #######################################################################
    308 # chinese macros
    309 #######################################################################
    310 _textintlink_ [l=zh] {}
    311 _textextlink_ [l=zh] {}
    312 
    313 _textprefop_ [l=zh] {查询最倚返回 
    314 ã€€ _maxdocoption_ 记圕每页返回
    315 _hitsperpageoption_ 记圕}
    316 _textlanguage_ [l=zh] {界面语蚀}
    317 _textsimplemode_ [l=zh] {简单查询方匏}
    318 _textadvancedmode_ [l=zh] {高级查询方匏(可以䜿甚 !、&、| 和括号来进行垃尔查询)}
    319 _textencoding_ [l=zh] {猖码方匏}
    320 _textformat_ [l=zh] {界面栌匏}
    321 
    322 #######################################################################
    323 # maori macros
    324 #######################################################################
    325 
    326 _textpreferences_ [l=mi] {Whiriwhiringa}
    327 _textignorecase_ [l=mi] { hei aha te p&uuml; matua me te p&uuml; iti}
    328 _textmatchcase_ [l=mi] { me tika te p&uuml; matua me te p&uuml; iti}
    329 _textstem_ [l=mi] { hei aha te k&uuml;muri}
    330 _textnostem_ [l=mi] { me tika te k&uuml;muri}
    331 _textprefop_ [l=mi] {Whakahokia mai te _maxdocoption_ kupu, &auml;, kia _hitsperpageoption_ kupu ki ia wh&auml;rangi.}
    332 _textlanguage_ [l=mi] {Reo: }
    333 _textencoding_ [l=mi] {Whakatakotoranga p&uuml;: }
    334 _textformat_ [l=mi] {Whakatakotoranga wh&auml;rangi: }
    335 _textsimplemode_ [l=mi] {te rapu wh&auml;iti}
    336 _textadvancedmode_ [l=mi] {te rapu wh&auml;nui (ka taea te whakamahia ng&auml; p&uuml; boolean,
    337 p&euml;r&auml; i te !, &, |, me te "()" hoki)}
    338 _textgraphical_ [l=mi] {Whakaahua}
    339 _texttextual_ [l=mi] {K&auml;ore he whakaahua}
    340 
    341 
    342 
    343 
     404
     405
     406
     407
     408
     409
Note: See TracChangeset for help on using the changeset viewer.