Changeset 23519 for main


Ignore:
Timestamp:
2010-12-21T23:19:21+13:00 (13 years ago)
Author:
davidb
Message:

Introduction of 'web-2.0' capabilities, triggered by setting the macro _activateweb20_ to 1. This in turn adds in a 'login' and 'logout' feature in the main navigation bar.

Location:
main/trunk/greenstone2/macros
Files:
5 edited

Legend:

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

    r22560 r23519  
    1111_content_ {
    1212<br><br><br><br>
    13 <form name="login" method="post" action="_gwcgi_">
     13_If_("_activateweb20_" eq "1",
     14  <form name="login" method="get" action="_gwcgi_">
     15,
     16  <form name="login" method="post" action="_gwcgi_">
     17)
    1418<input type=hidden name="e" value="_If_(_cgiarger_,_cgiarger_,_decodedcompressedoptions_)">
    1519_hiddenargs_
  • main/trunk/greenstone2/macros/english.dm

    r22051 r23519  
    7575_textdescrhelp_ {Help page}
    7676_textdescrpref_ {Preferences page}
     77_textdescrlogin_ {Login page}
     78_textdescrlogout_ {Logout as _cgiargun_}
     79
    7780_textdescrgreenstone_ {Greenstone Digital Library Software}
    7881_textdescrusab_ {What did you find hard to use?}
     
    211214_linktextHELP_ {HELP}
    212215_linktextPREFERENCES_ {PREFERENCES}
     216_linktextLOGIN_ {LOGIN}
     217_linktextLOGGEDIN_ {(logged in as _cgiargun_)}
     218_linktextLOGOUT_ {LOGOUT}
    213219
    214220
  • main/trunk/greenstone2/macros/nav_css.dm

    r20611 r23519  
    1414#######################################################################
    1515
    16 _globallinks_ {_If_("_cgiargu_" ne "1",_homelink_) _helplink_ _preflink_}
    17 _homelink_ {_navtaborig_(_httppagehome_,_linktextHOME_,_textdescrhome_)}
    18 _helplink_ {_navtaborig_(_httppagehelp_,_linktextHELP_,_textdescrhelp_)}
    19 _preflink_ {_navtaborig_(_httppagepref_,_linktextPREFERENCES_,_textdescrpref_)}
     16_globallinks_ {_If_("_cgiargu_" ne "1",_homelink_) _helplink_ _preflink__optloginlink_}
     17_homelink_  {_navtaborig_(_httppagehome_,_linktextHOME_,_textdescrhome_)}
     18_helplink_  {_navtaborig_(_httppagehelp_,_linktextHELP_,_textdescrhelp_)}
     19_preflink_  {_navtaborig_(_httppagepref_,_linktextPREFERENCES_,_textdescrpref_)}
     20
     21_optloginlink_ {
     22  _If_("_activateweb20_" >= "1",_If_("x_cgiargun__cgiarguan_" ne "x1",_loginlink_))
     23}
     24
     25_loginlink_ {
     26
     27    _If_(_cgiargun_,
     28      _navtablogoutorig_(_linktextLOGOUT_,_textdescrlogout_) _linktextLOGGEDIN_
     29      <script type="text/javascript">
     30        appendUsernameArgs("logout","uan=&un=")
     31      </script>
     32    ,
     33      _navtabloginorig_(_linktextLOGIN_,_textdescrlogin_)
     34      <script type="text/javascript">
     35        appendUsernameArgs("login","uan=1")
     36      </script>
     37    )
     38}
    2039
    2140
     
    4160# 4. optional "selected" or not if it is the current tab
    4261_navtaborig_ {<a _If_("_4_" eq "selected",class="navlink_sel">_2_,class="navlink" href="_1_" title="_3_">_2_)</a>}
     62
     63# same sa above, but without _1_ as there is no hyperlink to go to (want to say on the same page)
     64_navtabloginorig_ {<a _If_("_3_" eq "selected",class="navlink_sel postit">_1_,class="navlink postit" id="login" href="" title="_2_">_1_)</a>}
     65
     66# same sa above, but without _1_ as there is no hyperlink to go to (want to say on the same page)
     67_navtablogoutorig_ {<a _If_("_3_" eq "selected",class="navlink_sel postit">_1_,class="navlink postit" id="logout" href="" title="_2_">_1_)</a>}
    4368
    4469# parameters are
  • main/trunk/greenstone2/macros/seaweed.dm

    r23502 r23519  
    11package Global
    22
    3 _seaweed_ {
     3_seaweedscript_ {
    44
    55
     
    2727
    2828<script type="text/javascript" src="_httpscript_/seaweed.js"></script>
    29 <script type="text/javascript" src="_httpscript_/gsajaxapi.js"></script>
    3029
    3130
     
    126125
    127126  window.onload=function()\{
    128 //      try \{
     127      try \{
    129128      de.init();
    130129      if (window.addEventListener) \{
     
    141140       \});
    142141       
    143 /*      \}
     142      \}
    144143      catch(err) \{
    145144        alert("SeaWeed failed to initialise: " + err.message);
    146145      \}
    147 */
    148146  \}
    149147
     
    197195
    198196
     197   
     198  function seaweedReindexCollection() \{
     199    var arc = document.getElementById("seaweedRC");
     200    arc.innerHTML = "reindexing ...";
     201    gsapi.reindexCollection("incremental",seaweedReindexCallback);
     202  \}
     203
     204  function seaweedReindexCallback(xmlHttp) \{
     205    var arc = document.getElementById("seaweedRC");
     206    arc.innerHTML = "reindexing done.";
     207  \}           
     208   
     209
    199210</script>
    200211
    201 
    202212}
     213
     214_first-metadata-spanwrap_ {<span metapos="0" metaname="_1_" docoid="_2_" class="editable-metadata">}
     215_/first-metadata-spanwrap_ {</span>}
     216
     217_first-metadata-divwrap_ {<div metapos="0" metaname="_1_" docoid="_2_" class="editable-metadata">}
     218_/first-metadata-divwrap_ {</div>}
  • main/trunk/greenstone2/macros/style.dm

    r23501 r23519  
    151151<div class="bannerextra">_pagebannerextra_</div>
    152152<!-- end of page banner -->
    153 _If_("_cgiargtalkback_" eq "1",_talkback:uploadForm_)
     153_If_("_activateweb20_" eq "2",
     154  _If_("_activatetalkback_" eq "1",_talkback:uploadForm_)
     155)
    154156}
    155157
     
    162164<p>
    163165<!-- end of page banner -->
    164 _If_("_cgiargtalkback_" eq "1",_talkback:uploadForm_)
     166_If_("_activateweb20_" eq "2",
     167  _If_("_activatetalkback_" eq "1",_talkback:uploadForm_)
     168)
    165169}
    166170
     
    191195}
    192196
     197_loginscript_ {
     198   function appendUsernameArgs(id,addOn)
     199   \{
     200     var a=document.getElementById(id);
     201     var url = a.getAttribute("href");
     202     if (url == "") \{
     203       url = document.location.toString();
     204     \}
     205
     206     //alert("url before = " + url);
     207
     208     // clear out any earlier user name/authentication values
     209     url = url.replace(/(&|\\\\?)uan=\\d\{0,1\}/g,"");
     210     url = url.replace(/(&|\\\\?)un=[a-z0-9:\\-]*/g,"");
     211     url = url.replace(/(&|\\\\?)pw=[a-z0-9:\\-]*/g,"");
     212
     213     //alert("url after = " + url);
     214
     215     var gwcgi = "_gwcgi_";
     216
     217     var tailUrl = url.substr(url.length-gwcgi.length);
     218
     219     url += (tailUrl == "_gwcgi_") ? "?" : "&";
     220     url += addOn;
     221
     222     //alert("url with add on = " + url);
     223
     224     a.setAttribute("href",url);
     225   \}
     226}
     227
     228
    193229# imagescript only used in nav_ns4.dm
    194230_globalscripts_{
    195 
    196 _If_("_activateseaweed_" eq "1",_seaweed_)
     231_If_("_activateweb20_" eq "2",
     232  <script type="text/javascript" src="_httpscript_/gsajaxapi.js"></script>
     233  _If_("_activateseaweed_" eq "1",_seaweedscript_)
     234  _If_("_activatetalkback_" eq "1",_talkbackscript_)
     235)
    197236_If_(_pagescriptfileextra_,_pagescriptfileextra_)
    198237<script language="javascript" type="text/javascript">
     238_loginscript_
    199239_If_(_pagescriptextra_,_pagescriptextra_)
    200240_collectionspecificscript_
     
    205245
    206246_globalscripts_ [v=1] {
     247_If_("_activateweb20_" eq "2",
     248  <script type="text/javascript" src="_httpscript_/gsajaxapi.js"></script>
     249  _If_("_activateseaweed_" eq "1",_seaweedscript_)
     250  _If_("_activatetalkback_" eq "1",_talkbackscript_)
     251)
     252_If_(_pagescriptfileextra_,_pagescriptfileextra_)
    207253<script language="javascript" type="text/javascript">
    208254<!--
     255_loginscript_
    209256_If_(_cgiargx_,_scriptdetach_)
    210 _pagescriptextra_
     257_If_(_pagescriptextra_,_pagescriptextra_)
    211258_collectionspecificscript_
    212259// -->
Note: See TracChangeset for help on using the changeset viewer.