<%@ include file="init.jsp" %> <%@ page import="org.crosswire.swordweb.*" %> <% 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); String promoLine = activeModule.getConfigEntry("ShortPromo"); if (promoLine.equalsIgnoreCase("")) promoLine = ""; String resetKey = request.getParameter("key"); if (resetKey != null) session.setAttribute("ActiveKey", resetKey); String activeKey = (String) session.getAttribute("ActiveKey"); if (activeKey == null) activeKey = "jas 1:19"; 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); } } } } } } //the sidebar rendering object is shared in the left (Bibles) and right (Commentaries) sidebar SidebarModuleView sidebarView = new SimpleModuleView(mgr); SidebarItemRenderer displayModRenderer = new SidebarItemRenderer() { //an anonymous class which renders a list of modules with links to read each of them public String renderModuleItem(SWModule module) { StringBuffer ret = new StringBuffer(); ret.append("
  • ") .append(module.getDescription().replaceAll("&", "&")) .append("
  • "); return ret.toString(); } }; %>

    Translations:

    Preferred Translations

    <% if (prefBibles.size() > 0) { out.print( sidebarView.renderView(prefBibles, displayModRenderer) ); //render the preferred Bibles section } else { //no preferred Bibles %>
    • 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)) { Vector modules = new Vector(); for (int i = 0; i < modInfo.length; i++) { if (modInfo[i].category.equals(SwordOrb.BIBLES)) { modules.add(modInfo[i].name); } } modules.removeAll( prefBibles ); //don't include the prefered bibles in the long module list out.print( sidebarView.renderView(modules, displayModRenderer) ); //render the complete Bible modules list } %>
    <%= promoLine %>

    Comentaries:

    Preferred Comentaries:

    <% if (prefCommentaries.size() > 0) { out.print( sidebarView.renderView(prefCommentaries, displayModRenderer) ); //render the preferred Commentaries list } 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)) { Vector modules = new Vector(); for (int i = 0; i < modInfo.length; i++) { if (modInfo[i].category.equals(SwordOrb.COMMENTARIES)) { modules.add(modInfo[i].name); } } modules.removeAll( prefCommentaries ); //no preferred commentaries in the long list out.print( sidebarView.renderView(modules, displayModRenderer) ); //render the complete Commentary module list } %>
    <% activeModule.setKeyText(activeKey); activeKey = activeModule.getKeyText(); // be sure it is formatted nicely %>
    <%--

    <%= activeKey %>

    --%> <% //insert next and previous chapter links String prevChapterString = RangeInformation.getPreviousChapter(activeKey, activeModule); String nextChapterString = RangeInformation.getNextChapter(activeKey, activeModule); %> <% Vector moduleList = new Vector(); moduleList.add( activeModule ); Vector entryList = null; if ((activeModule.getCategory().equals("Cults / Unorthodox / Questionable Material")) || (activeModule.getCategory().equals(SwordOrb.BIBLES))) { entryList = RangeInformation.getChapterEntryList(activeKey, activeModule); } else { //a simple commentary entry, not multiple ones entryList = new Vector(); entryList.add(activeKey); } ModuleTextRendering rendering = new HorizontallyParallelTextRendering(); //passagestudy is a parallel view with just one module at the same time ModuleEntryRenderer entryRenderer = new StandardEntryRenderer( new String("passagestudy.jsp"), activeKey, mgr ); if (strongs) { entryRenderer.enableFilterOption("Strong's Numbers"); } if (morph) { entryRenderer.enableFilterOption("Morphological Tags"); } //Do the actual rendering out.print( rendering.render(moduleList, entryList, entryRenderer) ); 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 %>