From: <jo...@us...> - 2003-10-31 02:19:30
|
Update of /cvsroot/jaffa/JaffaCore/source/html/jaffa/jsp/tiles In directory sc8-pr-cvs1:/tmp/cvs-serv12112/source/html/jaffa/jsp/tiles Modified Files: globalNav.jsp Log Message: new version of the jaffa menu Index: globalNav.jsp =================================================================== RCS file: /cvsroot/jaffa/JaffaCore/source/html/jaffa/jsp/tiles/globalNav.jsp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** globalNav.jsp 21 Oct 2003 22:24:21 -0000 1.2 --- globalNav.jsp 31 Oct 2003 02:19:27 -0000 1.3 *************** *** 1,4 **** --- 1,81 ---- <%-- The contents of this JSP will appear in the 'globalNav' of MainLayout.jsp --%> + <%@ page import='org.jaffa.util.MessageHelper' %> + <%@ page import='org.jaffa.components.navigation.NavAccessor' %> + <%@ page import='org.jaffa.components.navigation.NavOption' %> + <%@ page import='java.util.Iterator' %> + + <%@ page import='java.util.List' %> + <%@ page import='java.util.Iterator' %> + <%@ page import='java.util.Map' %> + <%@ page import='java.util.ArrayList' %> + <SCRIPT type='text/javascript' src='jaffa/js/tiles/globalMenu.js'></SCRIPT> + <%! + + String menuData = new String(); + private void printSubMenu(List menuNodes , String id) { + String innerData = new String(); + boolean hasChildren = false; + innerData += "<div id=\"" + id + "\" class=\"menu\" onMouseOver=\"menuMouseover(event)\">"; + for(Iterator it = menuNodes.iterator(); it.hasNext(); ) { + NavOption nOption = (NavOption) it.next(); + if(nOption.isSubMenu()) { + hasChildren = true; + List m = nOption.getChildren(); + if (m != null) + printSubMenu(m , nOption.getLabel()); + } + if (hasChildren) { + innerData += "<a class=\"menuItem\" onClick=\"return false;\" onMouseOver=\"menuItemMouseover(event, '" + nOption.getLabel() + "');\"> <span class=\"menuItemText\">" + nOption.getLabel() + "</span><span class=\"menuItemArrow\">▶</span></a>"; + } else { + if (nOption.isDesktop()) { + innerData += "<a class=\"menuItem\" href=\"Desktop.jsp?desktopId=" + nOption.getDesktopId() + "\">" + nOption.getLabel() + "</a>"; + } else { + innerData += "<a class=\"menuItem\" href=\"" + (nOption.isURL()? nOption.getURL() : "startComponent.do?component=" + nOption.getComponent() + (nOption.getParameters() != null ? "&" + nOption.getParameters() : ""))+ "\">" + nOption.getLabel() + "</a>"; + } + } + + } + innerData += "</div>"; + menuData += innerData; + } + + + %> <!-- Start of '/jaffa/jsp/tiles/globalNav.jsp' --> + + + <div class="menuBar" style="width:100%;"> + <div align="left" > + <% + menuData = ""; + + NavAccessor nA = new NavAccessor(); + List l = nA.getGlobalNavOptions(); + for(Iterator it = l.iterator(); it.hasNext(); ) { + NavOption nOption = (NavOption) it.next(); + if(nOption.isSubMenu()) {%> + + <a class="menuButton" onMouseOver="buttonClick(event, '<%=nOption.getLabel()%>')"><%=nOption.getLabel()%></a> + <% } else if (nOption.isDesktop()) { %> + <a class="menuButton" href="Desktop.jsp?desktopId=<%=nOption.getDesktopId()%>"><%=nOption.getLabel()%></a> + <% + } + + } + %> </div></div> + <% + for(Iterator it = l.iterator(); it.hasNext(); ) { + NavOption nOption = (NavOption) it.next(); + if (nOption.getChildren() != null) { + printSubMenu(nOption.getChildren(),nOption.getLabel()); + } + } + %> + + <%=menuData%> + + <!-- End of '/jaffa/jsp/tiles/globalNav.jsp' --> + + |