<%@ page import="org.crosswire.xml.*" %> <%@ page import="org.crosswire.utils.HTTPUtils" %> <%@ page import="java.util.Arrays" %> <%@ page import="java.util.List" %> <%@ page import="java.util.ArrayList" %> <%@ include file="init.jsp" %> <% session.setAttribute("lastModType", "Bible"); Vector toolsTreeOpen = (Vector)session.getAttribute("toolsTreeOpen"); String resetModule = request.getParameter("mod"); if (resetModule != null) { session.setAttribute("ActiveModule", resetModule); } String activeModuleName = (String) session.getAttribute("ActiveModule"); SWModule activeModule = mgr.getModuleByName((activeModuleName == null) ? defaultBible : activeModuleName); System.out.println("ActiveModuleName: " + activeModuleName); System.out.println("ActiveModule: " + activeModule); SWModule eusVs = mgr.getModuleByName("Eusebian_vs"); SWModule eusNum = mgr.getModuleByName("Eusebian_num"); String promoLine = activeModule.getConfigEntry("ShortPromo"); if (promoLine.equalsIgnoreCase("")) { promoLine = ""; } String specialFont = activeModule.getConfigEntry("Font"); if (specialFont.equalsIgnoreCase("")) { specialFont = null; } boolean rtol = ("RtoL".equalsIgnoreCase(activeModule.getConfigEntry("Direction"))); String keyList[] = null; String resetKey = request.getParameter("key"); if (resetKey != null) { resetKey = new String(resetKey.getBytes("iso8859-1"), "UTF-8"); if (resetKey.indexOf("-") > -1 || resetKey.indexOf(";") > -1 || resetKey.indexOf(",") > -1) { keyList = SwordOrb.BIBLES.equals(activeModule.getCategory())?activeModule.parseKeyList(resetKey) : new String[] { resetKey }; resetKey = keyList[0]; } activeModule.setKeyText(resetKey); session.setAttribute("ActiveKey", activeModule.getKeyText()); } String activeKey = (String) session.getAttribute("ActiveKey"); if (activeKey == null) { activeKey = "jas 1:19"; session.setAttribute("ActiveKey", activeKey); } if (toolsTreeOpen == null) { toolsTreeOpen = new Vector(); session.setAttribute("toolsTreeOpen", toolsTreeOpen); } 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"); 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 = nodes[j]; if (node != null) { if (i > 0) { toolsTreeOpen.remove(node); } else { if (!toolsTreeOpen.contains(node)) { toolsTreeOpen.add(node); } } } } } } %>

Translations:

Preferred Translations

<% if (prefBibles.size() > 0) { %> <% } else { %>
  • Preferred Translations can be selected from the preferences tab
<% } %> <% boolean open = toolsTreeOpen.contains("allBibles"); %>

All Translations

<% if (open) { //already open %>

Hide All

<% } else { //closed %>

View All

<% } %> <% if ((open) && (modInfo.length > 0)) { %> <% } %>
<% activeModule.setKeyText(activeKey); %>
<%= promoLine %>

Commentaries:

Preferred Commentaries:

<% if (prefCommentaries.size() > 0) { %> <% } else { %>
  • Preferred commentaries can be selected from the preferences tab
<% } %> <% boolean open = toolsTreeOpen.contains("allComm"); %>

All Commentaries

<% if (open) { //already open %>

Hide All

<% } else { //closed %>

View All

<% } %> <% if ((open) && (modInfo.length > 0)) { %> <% } %>
<% activeModule.setKeyText(activeKey); activeKey = activeModule.getKeyText(); // be sure it is formatted nicely %> "/>

<%= activeKey %>

<%= activeModule.getDescription().replaceAll("&", "&") %>

<% //insert next and previous chapter links // activeKey contains the current key ATM // Split up into book, chapter and verse. // Then add and subtract 1 to the chapter to the next and previous one String bookname = activeKey.substring(0, activeKey.lastIndexOf(" ")); int chapter = Integer.parseInt( activeKey.substring(activeKey.lastIndexOf(" ")+1, activeKey.indexOf(":")) ); //int verse = Integer.parseInt(activeKey.substring(activeKey.indexOf(":")+1)); String prevChapterString = bookname + " " + String.valueOf(chapter-1) + ":1"; String nextChapterString = bookname + " " + String.valueOf(chapter+1) + ":1"; %> <% if ((activeModule.getCategory().equals("Cults / Unorthodox / Questionable Material")) || (activeModule.getCategory().equals(SwordOrb.BIBLES))) { String chapterPrefix = activeKey.substring(0, activeKey.indexOf(":")); int activeVerse = Integer.parseInt(activeKey.substring(activeKey.indexOf(":")+1)); int anchorVerse = (activeVerse > 2)?activeVerse - 2: -1; boolean first = true; String lang = activeModule.getConfigEntry("Lang"); String lastEusNum = ""; String myEusNum = ""; // if single verse, set to whole chapter. if (keyList == null) { List ls = new ArrayList(Arrays.asList(activeModule.parseKeyList(chapterPrefix))); ls.add(0, chapterPrefix+":0"); keyList = ls.toArray(new String[0]); } for (String activeKeyText : keyList) { if (activeKeyText.split("\\.").length < 3) activeKeyText += ".0"; System.out.println("ActiveKeyText: " + activeKeyText); activeModule.setKeyText("=" + activeKeyText); if (activeModule.error() != (char)0) break; String keyText = activeModule.getKeyText(); String keyProps[] = activeModule.getKeyChildren(); // book and chapter intros // TODO: change 'chapterPrefix' to use keyProps so we can support book intros (e.g. Jn.0.0) boolean intro = (keyProps[2].equals("0") || keyProps[3].equals("0")); if (eusVs != null) { myEusNum = ""; if (!intro) { eusVs.setKeyText(keyText); myEusNum = eusVs.getStripText().trim(); if (!lastEusNum.equals(myEusNum)) { lastEusNum = myEusNum; eusNum.setKeyText(myEusNum); XMLTag d = new XMLBlock(eusNum.getRawEntry()); myEusNum = myEusNum.substring(myEusNum.indexOf(".")+1) + "
" + d.getAttribute("table"); } else myEusNum = ""; } } if (first) { %> <% first = false; } int curVerse = Integer.parseInt(keyText.substring(keyText.indexOf(":")+1)); if (!chapterPrefix.equals(keyText.substring(0, keyText.indexOf(":")))) { String newChapter = keyText; if (newChapter.endsWith(":0")) newChapter = newChapter.substring(0, newChapter.lastIndexOf(":")); %> <% chapterPrefix = keyText.substring(0, keyText.indexOf(":")); } mgr.setGlobalOption("Strong's Numbers", ((strongs) && (curVerse >= activeVerse -1) && (curVerse <= activeVerse + 1)) ? "on" : "off"); mgr.setGlobalOption("Morphological Tags", ((morph) && (curVerse >= activeVerse -1) && (curVerse <= activeVerse + 1)) ? "on" : "off"); %> <% String[] heads = activeModule.getEntryAttribute("Heading", "Preverse", "", true); for (int h = 0; h < heads.length; ++h) { %> <% } %> <% if (!rtol) { %> <% } %> <% if (rtol) { %> <% } %> <% if (keyText.equals(activeKey)) { if (showStrong != null) { String [] keyInfo = activeModule.getKeyChildren(); SWModule lex = mgr.getModuleByName(("1".equals(keyInfo[0])) ? "StrongsHebrew":"StrongsGreek"); lex.setKeyText(showStrong); %> <% } %> <% if (showMorph != null) { String [] keyInfo = activeModule.getKeyChildren(); SWModule lex = mgr.getModuleByName(("1".equals(keyInfo[0])) ? "StrongHebrew":"Robinson"); lex.setKeyText(showMorph); %> <% } } } if (!first) { %>
class="<%= (keyText.equals(activeKey)) ? "currentverse" : "verse" %>">

<%= newChapter %>

class="<%= (keyText.equals(activeKey)) ? "currentverse" : "verse" %>">

<%= heads[h] %>

> <% if (myEusNum.length() > 0) { %> "><%= myEusNum %> <% } %>
class="<%= (keyText.equals(activeKey)) ? "currentverse" : "verse" %>"> <% if (!intro) { %> href="passagestudy.jsp?key=<%= URLEncoder.encode(keyText)+"#cv" %>"> <%= keyProps[3] %> <% } %>
style="<%= specialFont != null ? "font-family:"+specialFont : "" %>" class="<%= (keyText.equals(activeKey)) ? "currentverse" : (intro) ? "intro" : "verse" %>"> <% //
<%= activeModule.getRenderText() %> <% //
%>
class="<%= (keyText.equals(activeKey)) ? "currentverse" : "verse" %>"> <% if (!intro) { %> href="passagestudy.jsp?key=<%= URLEncoder.encode(keyText)+"#cv" %>"> <%= keyText.substring(keyText.indexOf(":")+1) %> <% } %>
> <% if (myEusNum.length() > 0) { %> "><%= myEusNum %> <% } %>
class="<%= (keyText.equals(activeKey)) ? "currentverse" : "verse" %>">

<%= lex.getRenderText() %>

class="<%= (keyText.equals(activeKey)) ? "currentverse" : "verse" %>">

<%= lex.getRenderText() %>

<% } } else { %>
style="<%= specialFont != null ? "font-family:"+specialFont : "" %>" class="verse"> <%= activeKey %> <%= activeModule.getRenderText() %>
<% } String copyLine = activeModule.getConfigEntry("ShortCopyright"); if (copyLine.equalsIgnoreCase("")) { copyLine = ""; } if (activeModule.getCategory().equals("Cults / Unorthodox / Questionable Material")) { copyLine = "WARNING: This text is considered unorthodox by most of Christendom. " + copyLine; } %>
<%= copyLine %>
<%= promoLine %>