Author: thomas.heute(a)jboss.com
Date: 2007-04-26 09:25:08 -0400 (Thu, 26 Apr 2007)
New Revision: 7076
Modified:
trunk/core/src/resources/portal-core-war/WEB-INF/jsp/header/tabs.jsp
Log:
Show the top pages in the tabs.
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/jsp/header/tabs.jsp
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/jsp/header/tabs.jsp 2007-04-26
13:15:14 UTC (rev 7075)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/jsp/header/tabs.jsp 2007-04-26
13:25:08 UTC (rev 7076)
@@ -6,6 +6,15 @@
<%
PortalNode root =
(PortalNode)request.getAttribute("org.jboss.portal.api.PORTAL_NODE");
+ PortalNode portal = root;
+ PortalNode mainPage = portal;
+
+ while (portal.getType() != PortalNode.TYPE_PORTAL)
+ {
+ mainPage = portal;
+ portal = portal.getParent();
+ }
+
PortalRuntimeContext context =
(PortalRuntimeContext)request.getAttribute("org.jboss.portal.api.PORTAL_RUNTIME_CONTEXT");
// Get a locale
@@ -19,23 +28,23 @@
<ul id="tabsHeader">
<%
ArrayList tmp = new ArrayList(10);
- Iterator siblingsIt = root.getParent().getChildren().iterator();
- while (siblingsIt.hasNext())
+ Iterator childrenIt = portal.getChildren().iterator();
+ while (childrenIt.hasNext())
{
- PortalNode sibling = (PortalNode)siblingsIt.next();
+ PortalNode child = (PortalNode)childrenIt.next();
// Get the list of child pages
tmp.clear();
- for (Iterator i = sibling.getChildren().iterator();i.hasNext();)
+ for (Iterator i = child.getChildren().iterator();i.hasNext();)
{
- PortalNode siblingChild = (PortalNode)i.next();
- if (siblingChild.getType() == PortalNode.TYPE_PAGE)
+ PortalNode childChild = (PortalNode)i.next();
+ if (childChild.getType() == PortalNode.TYPE_PAGE)
{
- tmp.add(siblingChild);
+ tmp.add(childChild);
}
}
%>
- <li <% if(sibling == root) out.println(" id=\"current\"");
%> onmouseover="this.className='hoverOn'"
onmouseout="this.className='hoverOff'"><a href="<%=
sibling.createURL(context) %>"><%= sibling.getDisplayName(locale) %>
+ <li <% if(child == mainPage) out.println(" id=\"current\"");
%> onmouseover="this.className='hoverOn'"
onmouseout="this.className='hoverOff'"><a href="<%=
child.createURL(context) %>"><%= child.getDisplayName(locale) %>
<%
if (tmp.size() == 0)
{
@@ -52,9 +61,9 @@
<%
for (Iterator j = tmp.iterator(); j.hasNext();)
{
- PortalNode siblingChild = (PortalNode)j.next();
+ PortalNode childChild = (PortalNode)j.next();
%>
- <li><a href='<%= siblingChild.createURL(context)
%>'><%= siblingChild.getDisplayName(locale) %></a></li>
+ <li><a href='<%= childChild.createURL(context)
%>'><%= childChild.getDisplayName(locale) %></a></li>
<%
}
%>