📄 leftmenu_tree.jsp
字号:
<%@ page import="org.jahia.registries.*"%><%! public String getPageSubTree( JahiaData jData, int theAbsolutePageID, int thePageID, String theURL, Vector imageArray, boolean editMode )throws JahiaException{ // inits variables String html = ""; int counter = 0; JahiaPage menuPage = ServicesRegistry.getInstance().getJahiaPageService().lookupPage( thePageID, jData.params() ); JahiaContainerList jahiaLinks = jData.containers().getAbsoluteContainerList( "jahialinks", theAbsolutePageID ); JahiaContainerList theSubLinks = jData.containers().getAbsoluteContainerList( "jahialinks", thePageID ); // generates image string before page info String theI = ""; String theImageI = ""; for (int i=0; i < imageArray.size(); i++) { Boolean theBoolean = (Boolean) imageArray.elementAt(i); if (theBoolean.booleanValue()) { theImageI = "i"; } else { theImageI = "pix"; } theI += "<img align=\"top\" src=\"" + theURL + "/images/" + theImageI + ".gif\" width=\"16\" height=\"18\">"; } // parses all subpages if (theSubLinks != null) { Enumeration subLinksList = theSubLinks.getContainers(); while (subLinksList.hasMoreElements()) { counter++; JahiaContainer theLink = (JahiaContainer) subLinksList.nextElement(); JahiaPage linkPage = (JahiaPage) theLink.getField( "thelink" ).getObject(); if (linkPage != null) { // decides if image before page info will be a "t" or a "l" String theImage = ""; if (subLinksList.hasMoreElements()) { theImage = "t"; } else { if ((linkPage.getParentID() != theAbsolutePageID) || (!editMode)) { theImage = "l"; } else { theImage = "t"; } } // displays page info html += theI + "<img align=\"top\" src=\"" + theURL + "/images/" + theImage + ".gif\" width=\"16\" height=\"18\">"; if (linkPage.getID() == theAbsolutePageID) { html += "<span class=\"text4\"><b>" + jData.gui().glueTitle(linkPage.getTitle(),15) + "</b></span><br>"; } else { html += "<a class=\"text\" href=\"" + linkPage.getUrl() + "\">" + jData.gui().glueTitle(linkPage.getTitle(),15) + "</a><br>"; } // displays update / delete buttons if ((linkPage.getParentID() == theAbsolutePageID) && (editMode)) { html += theI + "<img align=\"top\" src=\"" + theURL + "/images/i.gif\" width=\"16\" height=\"18\">"; html += "<a href=\"javascript:" + jData.gui().html().drawUpdateContainerLauncher( theLink ) + "\">"; html += "<img src=\"" + theURL + "/images/update_off.gif\" border=\"0\" align=\"top\"></a>"; html += "<img src=\"" + theURL + "/images/pix.gif\" width=\"3\" height=\"18\" border=\"0\" align=\"top\">"; html += "<a href=\"javascript:" + jData.gui().html().drawDeleteContainerLauncher( theLink ) + "\">"; html += "<img src=\"" + theURL + "/images/delete_off.gif\" border=\"0\" align=\"top\"></a>"; html += "<br>"; } // displays sub pages info if (jData.gui().isPageInPath(linkPage.getID())) { Boolean theBoolean = new Boolean(subLinksList.hasMoreElements()); Vector childImageArray = (Vector) imageArray.clone(); childImageArray.addElement(theBoolean); html += getPageSubTree(jData , theAbsolutePageID, linkPage.getID(), theURL, childImageArray, editMode); } } } } // displays add subpage button if ((menuPage != null) && (jahiaLinks != null)) { if ((menuPage.getID() == theAbsolutePageID) && (editMode) && (!jData.gui().html().drawAddContainerLauncher( jahiaLinks ).equals(""))) { html += theI + "<img align=\"middle\" src=\"" + theURL + "/images/l.gif\" width=\"16\" height=\"18\">"; html += "<a href=\"javascript:" + jData.gui().html().drawAddContainerLauncher( jahiaLinks ) + "\">"; html += "<img src=\"" + theURL + "/images/add_page.gif\" border=\"0\" align=\"middle\"></a>"; if (!jData.gui().html().drawContainerListPropertiesLauncher( jahiaLinks ).equals("")) { html += "<img src=\"" + theURL + "/images/pix.gif\" width=\"3\" height=\"18\" border=\"0\" align=\"middle\">"; html += "<a href=\"javascript:" + jData.gui().html().drawContainerListPropertiesLauncher( jahiaLinks ) + "\">"; html += "<img src=\"" + theURL + "/images/properties.gif\" border=\"0\" align=\"middle\"></a>"; } html += "<br>"; } } // returns html string return html;}%><% if (editMode) { %> <table width="160"> <tr> <td valign="top"><img src="<%=theURL%>/images/info_b.gif" width="14" height="14" align="left"></td> <td class="edit"> To add pages in the main menu below, click on the Home button, and then click on the "Add Page" button. </td> </tr> </table> <br><br> <% }%> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="4" height="1"> <img align="left" src="<%=theURL%>/images/pix.gif" width="1" height="1"> </td> </tr> <tr> <td width="11" height="24"> <img align="top" src="<%=theURL%>/images/section_left_off.gif" width="11" height="24"> </td> <td width="10%" height="24" align="center" background="<%=theURL%>/images/section_bg_off.gif" > <a href="<%=jData.params().composePageUrl(jData.gui().getHomePage().getID())%>>"><img src="<%=theURL%>/images/small_home.gif" border="0"></a> </td> <td width="100%" height="24" background="<%=theURL%>/images/section_bg_off.gif" class="linkoff"> <a class="linkoff" href="<%=jData.params().composePageUrl(jData.gui().getHomePage().getID())%>"><%=glueTitle(jData.gui().getHomePage().getTitle())%></a> </td> <td width="3" height="24"> <img align="top" src="<%=theURL%>/images/section_right_off.gif" width="3" height="24"> </td> </tr> <% JahiaContainerList theRemoteLinks = jData.containers().getAbsoluteContainerList( "jahialinks", jData.gui().getHomePage().getID() ); if (theRemoteLinks != null) { Enumeration remotelinksList = theRemoteLinks.getContainers(); while (remotelinksList.hasMoreElements()) { JahiaContainer theLink = (JahiaContainer) remotelinksList.nextElement(); JahiaPage linkPage = (JahiaPage) theLink.getField( "thelink" ).getObject(); if (linkPage != null) { String imgUrl = chooseImage( linkPage, theURL ); if (isPageInPath(jData,linkPage.getID())) { %> <tr> <td colspan="4" height="1"> <img align="left" src="<%=theURL%>/images/pix.gif" width="1" height="1"> </td> </tr> <tr> <td width="11" height="24"> <img align="top" src="<%=theURL%>/images/section_left_on.gif" width="11" height="24"> </td> <td width="10%" height="24" align="center" background="<%=theURL%>/images/section_bg_on.gif"> <%if (!imgUrl.equals("")) { %><a href="<%=linkPage.getUrl()%>"><img src="<%=imgUrl%>" border="0"></a> <% } else { %><a href="<%=linkPage.getUrl()%>"><img src="<%=theURL%>/images/small_link.gif" border="0"></a><% } %> </td> <td width="100%" height="24" background="<%=theURL%>/images/section_bg_on.gif" class="linkon"> <a class="linkon" href="<%=linkPage.getUrl()%>"><%=glueTitle(linkPage.getTitle())%></a> </td> <td width="3" height="24"> <img align="top" src="<%=theURL%>/images/section_right_on.gif" width="3" height="24"> </td> </tr> <tr> <td width="11"> <img align="top" src="<%=theURL%>/images/pix.gif" width="11" height="1"> </td> <td colspan="3" class="text" valign="top"> <%=getPageSubTree(jData, jData.page().getID(), linkPage.getID(), theURL, new Vector(), jData.gui().isEditMode())%> <br> </td> </tr> <% } else { %> <tr> <td colspan="4" height="1"> <img align="left" src="<%=theURL%>/images/pix.gif" width="1" height="1"> </td> </tr> <tr> <td width="11" height="24"> <img align="top" src="<%=theURL%>/images/section_left_off.gif" width="11" height="24"> </td> <td width="10%" height="24" align="center" background="<%=theURL%>/images/section_bg_off.gif"> <%if (!imgUrl.equals("")) { %><a href="<%=linkPage.getUrl()%>"><img src="<%=imgUrl%>" border="0"></a> <% } else { %><a href="<%=linkPage.getUrl()%>"><img src="<%=theURL%>/images/small_link.gif" border="0"></a><% } %> </td> <td width="100%" height="24" background="<%=theURL%>/images/section_bg_off.gif" class="linkoff"> <a class="linkoff" href="<%=linkPage.getUrl()%>"><%=glueTitle(linkPage.getTitle())%></a> </td> <td width="3" height="24"> <img align="top" src="<%=theURL%>/images/section_right_off.gif" width="3" height="24"> </td> </tr> <% } } } } %> </table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -