<%@ page language="java" contentType="text/html;charset=utf-8" %> <%@ page import="org.crosswire.xml.*" %> <%@ page import="org.crosswire.sword.orb.*" %> <%@ page import="java.net.URLEncoder" %> <%@ page import="java.net.URL" %> <% final int VERSEKEY_TESTAMENT = 0; final int VERSEKEY_BOOK = 1; final int VERSEKEY_CHAPTER = 2; final int VERSEKEY_VERSE = 3; final int VERSEKEY_CHAPTERMAX = 4; final int VERSEKEY_VERSEMAX = 5; final int VERSEKEY_BOOKNAME = 6; final int VERSEKEY_OSISREF = 7; final int VERSEKEY_SHORTTEXT = 8; final int VERSEKEY_BOOKABBREV = 9; String requestURI = request.getRequestURI(); int pe = requestURI.lastIndexOf('/', requestURI.length()-2); requestURI = (pe > 0) ? requestURI.substring(0, pe) : ""; URL baseURL = new URL(request.getScheme(), request.getServerName(), request.getServerPort(), requestURI); URL appBaseURL = new URL(request.getScheme(), request.getServerName(), request.getServerPort(), "/study/"); SWMgr mgr = SwordOrb.getSWMgrInstance(request); mgr.setJavascript(true); String activeModuleName = request.getParameter("mod"); if (activeModuleName == null) activeModuleName = "WHNU"; SWModule activeModule = mgr.getModuleByName(activeModuleName); SWModule eusVs = mgr.getModuleByName("Eusebian_vs"); SWModule eusNum = mgr.getModuleByName("Eusebian_num"); String promoLine = activeModule.getConfigEntry("ShortPromo"); if (promoLine.equalsIgnoreCase("")) { promoLine = ""; } String activeKey = request.getParameter("key"); if (activeKey == null) { activeKey = "jas 1:19"; } String buf = request.getParameter("strongs"); boolean strongs = "on".equalsIgnoreCase(buf); buf = request.getParameter("morph"); boolean morph = "on".equalsIgnoreCase(buf); activeModule.setKeyText("="+activeKey); activeKey = activeModule.getKeyText(); // be sure it is formatted nicely String book = activeModule.getKeyChildren()[VERSEKEY_BOOKNAME]; String bookAbbrev = activeModule.getKeyChildren()[VERSEKEY_BOOKABBREV]; int chapter = Integer.parseInt(activeModule.getKeyChildren()[VERSEKEY_CHAPTER]); int verse = Integer.parseInt(activeModule.getKeyChildren()[VERSEKEY_VERSE]); int verseMax = Integer.parseInt(activeModule.getKeyChildren()[VERSEKEY_VERSEMAX]); if (verse > verseMax) { activeKey = bookAbbrev + "." + chapter + "." + verseMax; verse = verseMax; activeModule.setKeyText("="+activeKey); activeKey = activeModule.getKeyText(); // be sure it is formatted nicely } String specialFont = activeModule.getConfigEntry("Font"); if (specialFont.equalsIgnoreCase("")) { specialFont = null; } String lang = activeModule.getConfigEntry("Lang"); boolean rtol = ("RtoL".equalsIgnoreCase(activeModule.getConfigEntry("Direction"))); %> <%= activeKey %>%%%
<% if ((activeModule.getCategory().equals("Cults / Unorthodox / Questionable Material")) || (activeModule.getCategory().equals(SwordOrb.BIBLES))) { int activeVerse = Integer.parseInt(activeKey.substring(activeKey.indexOf(":")+1)); int anchorVerse = (activeVerse > 2)?activeVerse - 2: -1; boolean first = true; String lastEusNum = ""; String myEusNum = ""; for (activeModule.setKeyText("="+book+"."+chapter+"."+"0"); (activeModule.error() == (char)0); activeModule.next()) { if (chapter == 0) chapter = 1; String keyText = activeModule.getKeyText(); String keyProps[] = activeModule.getKeyChildren(); // book and chapter intros boolean intro = (keyProps[VERSEKEY_CHAPTER].equals("0") || keyProps[VERSEKEY_VERSE].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(keyProps[VERSEKEY_VERSE]); int curChapter = Integer.parseInt(keyProps[VERSEKEY_CHAPTER]); if (!book.equals(keyProps[VERSEKEY_BOOKNAME]) || curChapter > chapter) { break; } 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 (!first) { %>
class="<%= (keyText.equals(activeKey)) ? "currentverse" : "verse" %>">

<%= heads[h] %>

> <% if (myEusNum.length() > 0) { %> "><%= myEusNum %> <% } %>
class="<%= (keyText.equals(activeKey)) ? "currentverse" : "verse" %>"> <% if (!intro) { %> href="#" onclick="lookup('<%= keyText%>');return false;"> <%= keyProps[VERSEKEY_VERSE] %> <% } %>
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="#" onclick="lookup('<%= keyText%>');return false;"> <%= keyProps[VERSEKEY_VERSE] %> <% } %>
> <% if (myEusNum.length() > 0) { %> "><%= myEusNum %> <% } %>
<% } } 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 %>