[sword-svn] r206 - trunk

scribe at crosswire.org scribe at crosswire.org
Mon Apr 11 03:25:59 MST 2005


Author: scribe
Date: 2005-04-11 03:25:58 -0700 (Mon, 11 Apr 2005)
New Revision: 206

Modified:
   trunk/bookdisplay.jsp
   trunk/parallelstudy.jsp
   trunk/passagestudy.jsp
   trunk/wordsearchresults.jsp
Log:
Added ability to search genbooks


Modified: trunk/bookdisplay.jsp
===================================================================
--- trunk/bookdisplay.jsp	2005-04-05 06:13:08 UTC (rev 205)
+++ trunk/bookdisplay.jsp	2005-04-11 10:25:58 UTC (rev 206)
@@ -7,9 +7,11 @@
 	Vector bookTreeOpen = (Vector)session.getAttribute("bookTreeOpen");
 
 
+	session.setAttribute("lastModType", "GBS");
 	String gbsBook = (String)request.getParameter("mod");
-	if (gbsBook != null)
+	if (gbsBook != null) {
 		session.setAttribute("gbsBook", gbsBook);
+	}
 	gbsBook = (String)session.getAttribute("gbsBook");
 	SWModule module = (gbsBook == null) ? null : mgr.getModuleByName(gbsBook);
 

Modified: trunk/parallelstudy.jsp
===================================================================
--- trunk/parallelstudy.jsp	2005-04-05 06:13:08 UTC (rev 205)
+++ trunk/parallelstudy.jsp	2005-04-11 10:25:58 UTC (rev 206)
@@ -1,6 +1,7 @@
 <%@ include file="init.jsp" %>
 
 <%
+	session.setAttribute("lastModType", "Bible");
 	String []addMods = request.getParameterValues("add");
 	if (addMods != null) {
 		for (int i = 0; i < addMods.length; i++) {

Modified: trunk/passagestudy.jsp
===================================================================
--- trunk/passagestudy.jsp	2005-04-05 06:13:08 UTC (rev 205)
+++ trunk/passagestudy.jsp	2005-04-11 10:25:58 UTC (rev 206)
@@ -1,6 +1,7 @@
 <%@ include file="init.jsp" %>
 
 <%
+	session.setAttribute("lastModType", "Bible");
 	Vector toolsTreeOpen = (Vector)session.getAttribute("toolsTreeOpen");
 	String resetModule = request.getParameter("mod");
 	if (resetModule != null)

Modified: trunk/wordsearchresults.jsp
===================================================================
--- trunk/wordsearchresults.jsp	2005-04-05 06:13:08 UTC (rev 205)
+++ trunk/wordsearchresults.jsp	2005-04-11 10:25:58 UTC (rev 206)
@@ -2,10 +2,20 @@
 
 <%
 	String resetModule = request.getParameter("mod");
-	if (resetModule != null)
-		session.setAttribute("ActiveModule", resetModule);
-	String activeModuleName = (String) session.getAttribute("ActiveModule");
+	String lastModType = (String) session.getAttribute("lastModType");
+	String activeModuleName = (resetModule != null)?resetModule : ((String) session.getAttribute(("GBS".equals(lastModType))?"gbsBook":"ActiveModule"));
 	SWModule activeModule = mgr.getModuleByName((activeModuleName == null) ? defaultBible : activeModuleName);
+	if ((resetModule != null) && (activeModule != null)) {
+		if ("Generic Books".equals(activeModule.getCategory())) {
+			session.setAttribute("gbsBook", resetModule);
+			session.setAttribute("lastModType", "GBS");
+		}
+		else {
+			session.setAttribute("ActiveModule", resetModule);
+			session.setAttribute("lastModType", "Bible");
+		}
+	}
+	lastModType = (String) session.getAttribute("lastModType");
 
 	String resetSearchTerm = request.getParameter("searchTerm");
 	if (resetSearchTerm != null)
@@ -91,7 +101,7 @@
 				activeModule.setKeyText(results[i].key);
 		%>
 				<dt>
-					<a href="passagestudy.jsp?key=<%= URLEncoder.encode(results[i].key)+"#cv" %>" title="<%= results[i].key %>"><%= results[i].key %></a>
+					<a href="<%= ("GBS".equals(lastModType))?"bookdisplay.jsp?gbsEntry=":"passagestudy.jsp?key=" %><%= URLEncoder.encode(results[i].key)+"#cv" %>" title="<%= results[i].key %>"><%= results[i].key %></a>
 					<span><%= (results[i].score > 0)?("score: " + results[i].score) : "" %></span>
 				</dt>
 				<% boolean rtol = ("RtoL".equalsIgnoreCase(activeModule.getConfigEntry("Direction"))); %>



More information about the sword-cvs mailing list