got rid of the login page in favor of the login popup box
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 6 Jul 2005 13:38:23 +0000 (13:38 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 6 Jul 2005 13:38:23 +0000 (13:38 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1070 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/javascript/opac/OPACStartPage.js
Open-ILS/src/javascript/opac/Page.js

index e910074..6efd9b2 100644 (file)
@@ -23,14 +23,13 @@ var globalOPACStartPage = null;
 function OPACStartPage() {
 
        debug("In OPACStartPage()");
-       //this.searchBar                        = new SearchBarChunk();
        this.searchBrFormChunk = new SearchBarFormChunk();
 
        if( globalOPACStartPage ) {
                return globalOPACStartPage; 
        }
 
-
+       this.init();
        globalOPACStartPage = this;
 }
 
@@ -42,15 +41,18 @@ OPACStartPage.prototype.instance = function() {
 }
 
 OPACStartPage.prototype.init = function() {
-       //this.searchBar.reset();
+
        globalSearchBarFormChunk.resetPage();
-       /*
-       var menu = globalMenuManager.buildMenu("record_result_row","record_result_row_1");
-       globalAppFrame.document.body.appendChild(menu.getNode());
-       getById('help').setAttribute("oncontextmenu",  
-               "logicNode.globalMenuManager.getMenu('record_result_row_1').toggle(); return false;");
-               */
+       var login = getById("login_link");
+
+       if(!UserSession.instance().verifySession()) {
+               login.setAttribute("href","javascript:void(0);");
+               var func = function(){url_redirect(["target","my_opac"])};
+               var diag = new LoginDialog(getDocument().body, func);
+               login.onclick = function(){diag.display(login);}
+       }
 }
 
+
 OPACStartPage.prototype.doSearch = function() {
 }
index 125749e..54e0995 100644 (file)
@@ -209,13 +209,26 @@ Page.prototype.buildNavBox = function(full) {
        var prefix = "http://" + globalRootURL + ":" + globalPort + globalRootPath;
 
        arr.push(elem("a", {href: prefix + '?target=advanced_search'}, null, "Advanced Search"));
-       arr.push(elem("a", {href: prefix + '?target=my_opac'}, null, "My OPAC"));
-       //arr.push(elem("a", {href: prefix + '?target=about'}, null, "About PINES"));
+
+
+       var mylink = elem("a", {href: "?target=my_opac"}, null, "My OPAC");
+       arr.push(mylink);
+
+       /* if user is not logged in, popup the login dialog when they
+               select the myopac link */
+       if(!UserSession.instance().verifySession()) {
+               mylink.setAttribute("href","javascript:void(0);");
+               var func = function(){url_redirect(["target","my_opac"])};
+               var diag = new LoginDialog(getDocument().body, func);
+               mylink.onclick = function(){diag.display(mylink);}
+       }
+
+
        if(loc) arr.push(this.buildDeepLink());
 
        if(UserSession.instance().verifySession()) {
-               //arr.push(elem("a", {href: prefix + "?target=logout"}, null, "Logout"));
-               var a = elem("a", {href:globalRootPath}, null, "Logout");
+               var a = elem("a", {href:"http://" + globalRootURL + ":" 
+                               + globalPort + "/" + globalRootPath}, null, "Logout");
                a.onclick = doLogout;
                arr.push(a);
        }