pvollenweider 2004/11/10 10:43:51 CET
Modified files:
src/view/jsp/include left_menu.inc
Log:
Bug fix on left menu. Now we can add subpages for level > 3!
Revision Changes Path
1.12 +17 -29
corporate_portal_templates/src/view/jsp/include/left_menu.inc
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/corporate_portal_templates/src/view/jsp/include/left_menu.inc.diff?r1=1.11&r2=1.12&f=h
Index: left_menu.inc
===================================================================
RCS file:
/home/cvs/repository/corporate_portal_templates/src/view/jsp/include/left_menu.inc,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- left_menu.inc 9 Nov 2004 19:21:23 -0000 1.11
+++ left_menu.inc 10 Nov 2004 09:43:51 -0000 1.12
@@ -2,7 +2,6 @@
public void getPageSubTree( JahiaData jData,
int rootPageID,
int currentPageID,
- Vector imageArray,
String theURL,
int currentLevel,
PageContext pageContext,
@@ -55,33 +54,21 @@
out.println("<tr><td> </td>");
out.println("<td class=\"left"+state+"\"");
- if (! jData.gui().isPageInPath(linkBean.getId()) ){
+ if (! jData.gui().isPageInPath(linkBean.getId()) &&
! "current".equals(state)){
out.println(" onmouseover=\"leftOn(this)\"
onmouseout=\"leftOff(this)\"");
}
- /*
- if (!editMode){
- out.println(" onclick=goTo('" +
linkBean.getUrl() + "')");
- }
- */
out.println(">");
- if (linkBean.getId() == rootPageID) {
- out.println("<span class=\"leftlevel" +
currentLevel);
- out.println("\">"+pageTitle+"</span>");
- } else {
- out.println("<a class=\"leftlevel" +
currentLevel);
- out.println("\" href=\"" + linkBean.getUrl() +
"\">"+pageTitle+"</a>");
- }
+ out.println("<a class=\"leftlevel" + currentLevel);
+ out.println("\" href=\"" + linkBean.getUrl() +
"\">"+pageTitle+"</a>");
+
// displays action buttons on container
jData.gui().html().drawBeginActionMenu(linksContainerBean, null, null, false,
"", "jahiatemplates.Corporate_portal_templates", null, out);
out.println("</td></tr>\n");
// displays sub links
- if (jData.gui().isPageInPath(linkBean.getId())) {
- Boolean theBoolean = new
Boolean(linksContainerEnum.hasMoreElements());
- Vector childImageArray = (Vector)
imageArray.clone();
- childImageArray.addElement(theBoolean);
- getPageSubTree(jData , rootPageID,
linkBean.getId(), childImageArray, theURL,currentLevel, pageContext,logger);
+ if (linkBean.isInCurrentPagePath()) {
+ getPageSubTree(jData , rootPageID,
linkBean.getId(), theURL,currentLevel, pageContext,logger);
}
}
} else {
@@ -93,22 +80,23 @@
out.println("</td></tr>");
}
}
- }
- }
- // displays action buttons on containerlist
- if (linksContainerList != null) {
- if ( (rootPageID == currentPageID) &&
(!jData.gui().html().drawAddContainerLauncher( linksContainerList ).equals(""))
) {
+ } // while (linksContainerEnum.hasMoreElements
+
+ // displays action buttons on containerlist
+ ContentPage currentPage = ContentPage.getPage(currentPageID);
+ ContainerListBean linksContainerListBean = new
ContainerListBean(linksContainerList,jData.params());
+ logger.info("linksContainerListBean.isActionURIsEmpty() for page
" + currentPageID + " -> " + linksContainerListBean.isActionURIsEmpty());
+ if (! linksContainerListBean.isActionURIsEmpty() ) {
out.println("<tr><td> </td><td class=\"left\">");
out.println("<span class=\"leftlevel" + currentLevel +"\">");
- ContainerListBean linksContainerListBean = new
ContainerListBean(linksContainerList,jData.params());
jData.gui().html().drawBeginActionMenu(linksContainerListBean , null, theURL +
"/images/add.gif", false, "", "jahiatemplates.Corporate_portal_templates",
"addPage", out);
out.println("</span></td></tr>\n");
}
}
} catch (IOException ioe) {
- //System.out.println("IO exception while trying to print left menu
for object ", ioe);
+ logger.debug("IO exception while trying to print left menu for
object ", ioe);
}
}
@@ -202,7 +190,7 @@
<bean:define id="state" value="on"/>
</logic:equal>
<logic:notEqual name="link" property="inCurrentPagePath"
value="true">
- <bean:define id="state" value=""/>
+ <bean:define id="state" value=""/>
</logic:notEqual>
</logic:notEqual>
@@ -237,7 +225,7 @@
}
%>
<logic:equal name="link"
property="inCurrentPagePath" value="true">
- <%getPageSubTree(jData,
jData.page().getID(), getPageIDAtLevel(jData,startLevel + 1 ,maxLevel), new
Vector(), theURL,1, pageContext,logger);%>
+ <%getPageSubTree(jData,
jData.page().getID(), getPageIDAtLevel(jData,startLevel + 1 ,maxLevel),
theURL,1, pageContext,logger);%>
</logic:equal>
</td>
</tr>
@@ -261,7 +249,7 @@
</td>
</tr>
<logic:equal name="link"
property="inCurrentPagePath" value="true">
- <%getPageSubTree(jData, jData.page().getID(),
getPageIDAtLevel(jData,startLevel + 1 ,maxLevel), new Vector(), theURL,1,
pageContext,logger);%>
+ <%getPageSubTree(jData, jData.page().getID(),
getPageIDAtLevel(jData,startLevel + 1 ,maxLevel), theURL,1,
pageContext,logger);%>
</logic:equal>
</logic:equal>
</logic:empty>