<%@ include file="init.jsp" %> <%@ page import="java.util.Enumeration,java.util.Vector" %> <%@ page import="gnu.regexp.RE" %> <% Vector bookTreeOpen = (Vector)session.getAttribute("bookTreeOpen"); String currentJumpNode = null; boolean forceOpen = false; boolean strongs = "on".equals((String) session.getAttribute("strongs")); String buf = request.getParameter("strongs"); strongs = (buf != null) ? "on".equalsIgnoreCase(buf) : strongs; session.setAttribute("strongs", (strongs)?"on":"off"); boolean morph = "on".equals((String) session.getAttribute("morph")); buf = request.getParameter("morph"); morph = (buf != null) ? "on".equalsIgnoreCase(buf) : morph; session.setAttribute("morph", (morph)?"on":"off"); String showStrong = request.getParameter("showStrong"); String showMorph = request.getParameter("showMorph"); session.setAttribute("lastModType", "GBS"); String gbsBook = (String)request.getParameter("mod"); if (gbsBook != null) { session.setAttribute("gbsBook", gbsBook); session.setAttribute("gbsEntry", null); } gbsBook = (String)session.getAttribute("gbsBook"); SWModule module = (gbsBook == null) ? null : mgr.getModuleByName(gbsBook); String gbsEntry = (String)request.getParameter("gbsEntry"); if (gbsEntry != null) { session.setAttribute("gbsEntry", gbsEntry); bookTreeOpen = null; forceOpen = true; } gbsEntry = (String)session.getAttribute("gbsEntry"); if (gbsEntry == null) { gbsEntry = "/"; } String action = (String)request.getParameter("action"); if ((action != null) && (action.equalsIgnoreCase("closeAll"))) { bookTreeOpen = null; } if (bookTreeOpen == null) { bookTreeOpen = new Vector(); session.setAttribute("bookTreeOpen", bookTreeOpen); } // open our current entry in tree if ((module != null) && (forceOpen)) { module.setKeyText(gbsEntry); String tmp = module.getKeyText(); while (tmp.length() > 0) { bookTreeOpen.add(tmp); tmp = module.getKeyParent(); } } for (int i = 0; i < 2; i++) { String []nodes = request.getParameterValues((i>0)?"close":"open"); if (nodes != null) { for (int j = 0; j < nodes.length; j++) { String node = new String(nodes[j].getBytes("iso8859-1"), "UTF-8"); if (node != null) { if (i>0) { bookTreeOpen.remove(node); } else { if (!bookTreeOpen.contains(node)) { bookTreeOpen.add(node); } } } } if (nodes.length > 0) { currentJumpNode = nodes[0]; } } } %> <%-- override lookup URL, so this script is used to display the keys --%> <%=module.getDescription()%>
<% if (module != null) { %>
    <% printTree(bookTreeOpen, out, module, "/", gbsEntry, currentJumpNode); %>
<% } else { %> no book selected <% } %>
<% if (module != null) { %>

<%= new String(gbsEntry.getBytes("iso8859-1"), "UTF-8") %>

<%= module.getDescription().replaceAll("&", "&") + " (" + module.getName() + ")" %>

<% module.setKeyText(gbsEntry); gbsEntry = module.getKeyText(); boolean printed = false; boolean rtol = ("RtoL".equalsIgnoreCase(module.getConfigEntry("Direction"))); if ("2".equals(module.getConfigEntry("DisplayLevel"))) { // be sure we're at the bottom leaf before we enforce display level if (!module.hasKeyChildren()) { module.setKeyText(gbsEntry); String parent = module.getKeyParent(); String heading = null; if (parent != null) { module.setKeyText(parent); heading = module.getRenderText(); String[] children = module.getKeyChildren(); // we better have children. We should have been one of them if ((children != null) && (children.length > 0)) { %>
class="verse"><%= heading %>
<% for (int i = 0; i < children.length; i++) { String k = parent + "/" + children[i]; module.setKeyText(k); k = module.getKeyText(); boolean curVerse = (k.equals(new String(gbsEntry.getBytes("iso8859-1"), "UTF-8"))); String[] heads = module.getEntryAttribute("Heading", "Preverse", "0", true); if (heads.length > 0) { %> <% } %> <% if (!rtol) { %> <% } %> <% if (rtol) { %> <% } %> <% } %>
class="<%= curVerse ? "currentverse" : "verse" %>">

<%= heads[0] %>

class="<%= curVerse ? "currentverse" : "verse" %>"> <% String lang = module.getConfigEntry("Lang"); //
<%= module.getRenderText() %> <% //
%>
<% printed = true; } } } } if (!printed) { %>
class="verse"> <%= module.getRenderText() %>
<% } String copyLine = module.getConfigEntry("ShortCopyright"); if (copyLine.equalsIgnoreCase("")) copyLine = ""; if (module.getCategory().equals("Cults / Unorthodox / Questionable Material")) { copyLine = "WARNING: This text is considered unorthodox by most of Christendom. " + copyLine; } %>
<%= copyLine %>
<% } %>
<%! private synchronized static void printTree(Vector bookTreeOpen, JspWriter out, SWModule module, String rootTreeKey, String target, String currentJumpNode) { if ((module == null) || ("".equals(module.getName()))) return; try { int max = 400; module.setKeyText(rootTreeKey); rootTreeKey = module.getKeyText(); String currentKey = target; if ("2".equals(module.getConfigEntry("DisplayLevel"))) { int offset = currentKey.lastIndexOf("/"); if (offset > 0) currentKey = currentKey.substring(0, offset); } int offset = rootTreeKey.lastIndexOf("/"); String[] children = module.getKeyChildren(); boolean open = bookTreeOpen.contains(rootTreeKey); boolean dig = (children.length > 0); if (dig) { if ("2".equals(module.getConfigEntry("DisplayLevel"))) { dig = false; for (int i = 0; ((i < children.length) && (i < max)); i++) { module.setKeyText(rootTreeKey+"/"+children[i]); if (module.hasKeyChildren()) { dig = true; break; } } } } if (rootTreeKey.length()>0) { String localName = rootTreeKey.substring(offset+1); String linkRef = rootTreeKey; if (currentKey.equals(rootTreeKey)) out.print("
  • "); //the current entry in the navigation tree else out.print("
  • "); if (dig) { out.print("\"action\"/"); } else if (children.length > 0) { linkRef = rootTreeKey + "/" + children[0]; } out.print(" " + localName + ""); out.print("
  • \n"); } else open = true; if (open) { if (dig) { out.print("
  • \n"); } } } catch (Exception e) {e.printStackTrace();} } %>