[opencms-dev] drop down menus
nickm at absa.co.za
nickm at absa.co.za
Thu Sep 21 13:14:51 CEST 2006
<!-- Why dont you look at this: -->
<!-- Template details Name : New_St_Nicholas_Template.jsp V4.2.2.7 date
2006-04-17--><%--
************************************************************************
****************
Copyright(c) 2004-2005, Nico Michael. All rights reserved. THIS
PROGRAM IS
AN UNPUBLISHED WORK AND TRADE SECRET OF THE COPYRIGHT HOLDER, AND
DISTRIBUTED
ONLY UNDER RESTRICTION.
No part of this program may be used, installed, displayed,
reproduced,
distributed or modified without the express written consent of the
copyright
holder.
EXCEPT AS EXPLICITLY STATED IN A WRITTEN AGREEMENT BETWEEN THE
PARTIES, THE
SOFTWARE IS PROVIDED AS-IS, WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED,
INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR
PURPOSE, NONINFRINGEMENT, PERFORMANCE, AND QUALITY.
************************************************************************
****************
This template uses an included jsp file PageData.jsp which is placed in
the project content folder
char CR=13;
char LF=10;
char SINGLE_QUOTE=39;
char DOUBLE_QUOTE=34;
char QU='"';
--%>
<%@ page import="java.util.*" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<%@ page buffer="none" import = "org.opencms.jsp.CmsJspActionElement,
org.opencms.file.CmsObject, org.opencms.file.CmsRequestContext"%>
<%//@ page pageEncoding="UTF-8" %>
<%
////////////////////////// DO NOT CHANGE THE VALUES OF THESE VARIABLES
HERE ////////////////////////
char CR=13;
char LF=10;
char SINGLE_QUOTE=39;
char DOUBLE_QUOTE=34;
String CRLF=""+CR+LF;
char QU='"';
String SPACE=" ";
String CRUMB_LEADER=">>";
// java declarations go here :
// Create a JSP action element for getting body content
org.opencms.jsp.CmsJspActionElement cmsAct= new
org.opencms.jsp.CmsJspActionElement(pageContext, request, response);
//Create a Navbuilder object for generating the Menu (at least this code
is working)
org.opencms.jsp.CmsJspNavBuilder nav=new
org.opencms.jsp.CmsJspNavBuilder();
%>
<%@ include
file="/sites/default/Special_Resources/st_nicholas/PageData.jsp" %>
<%
boolean isCurrentPage=false;
String thePageTitle = cmsAct.property("Title") ;
String pageTitle = thePageTitle ;
String description = cmsAct.property("Description") ;
String keywords = cmsAct.property("Keywords") ;
templateDataSa.setupData();
Hashtable titleHash=
templateDataSa.getTitleHash();
String result="";
templateDataSa.setForeign(pageTitle);
result=(String) titleHash.get(pageTitle);
if (result!=null && result.length()>0){
pageTitle=result;
}
String
organizationName=templateDataSa.getOrganizationName();
// Get a simple navigation of all pages /
subfolders in the current folder
List list4Nav =
cmsAct.getNavigation().getNavigationForFolder();
int startlevel=0;
int endlevel=1;
//List list =
cmsAct.getNavigation().getNavigationBreadCrumb( startlevel, endlevel);//
Build a "bread crump" path navigation to the current folder.
List list =
cmsAct.getNavigation().getNavigationTreeForFolder(startlevel, endlevel);
//Builds a tree navigation for the folders between the provided start
and end level.
//List list2 =
cmsAct.getNavigation().getSiteNavigation();// This method builds a
complete site navigation tree with entries of all branch
startlevel=3;
endlevel=8;
List list2 =
cmsAct.getNavigation().getNavigationTreeForFolder(startlevel, endlevel);
templateDataSa.clearMenu();
templateDataSa.clearLowerBreadcrumbs();
templateDataSa.addMenu(CRLF);
templateDataSa.addMenu(" <tr>");
templateDataSa.addMenu(CRLF);
templateDataSa.addMenu(" <td>" +
templateDataSa.getLowerBannerTags() + "</td>");
templateDataSa.addMenu(CRLF);
templateDataSa.addMenu(" </tr>");
templateDataSa.addMenu(CRLF);
Iterator iCrumb =list2.iterator();
String st="";
String st2="";
StringBuffer stbHCrumb=new StringBuffer();
StringBuffer stbLCrumb=new StringBuffer();
stbHCrumb.append(CRUMB_LEADER);
stbHCrumb.append(CRLF);
stbHCrumb.append(SPACE);
String result2="";
String pageUrl="";
boolean notMarkedUp=true;
while (iCrumb.hasNext()) {
org.opencms.jsp.CmsJspNavElement neCrumb =
(org.opencms.jsp.CmsJspNavElement)iCrumb.next();
st=(String) cmsAct.link(neCrumb.getResourceName());
st2=neCrumb.getTitle();
pageUrl=cmsAct.link(neCrumb.getResourceName() );
if (isCurrentPage==false){
if (st2.equals(thePageTitle) ){
isCurrentPage=true;
}
if ( st.length()>9 ){
if( st.substring(st.length()-10 ).equals("index.html") ){ //starts
with zero and ends one character before last index
result2=(String) titleHash.get(st2);
if (result2!=null && result2.length()>0){
st2=result2;
}
stbHCrumb.append("<!--- st=");
stbHCrumb.append(st.substring(st.length()-10) );
stbHCrumb.append(" --->");
stbHCrumb.append(CRLF);
stbHCrumb.append("<a href='");
stbHCrumb.append(cmsAct.link(neCrumb.getResourceName() ) );
stbHCrumb.append("'>");
stbHCrumb.append(st2);
stbHCrumb.append("</a>");
stbHCrumb.append(SPACE);
if (isCurrentPage==false){
stbHCrumb.append(CRUMB_LEADER);
stbHCrumb.append(SPACE);
}
stbHCrumb.append(CRLF);
notMarkedUp=false;
} else{
notMarkedUp=true;
}
} else{
notMarkedUp=true;
}
if (isCurrentPage==true && notMarkedUp==true){
stbHCrumb.append(st2);
}
}
}
stbHCrumb.append("<br><br>");
isCurrentPage=false;
stbLCrumb.append("<br><br>");
Iterator i = list4Nav.iterator();
while (i.hasNext()) {
org.opencms.jsp.CmsJspNavElement ne =
(org.opencms.jsp.CmsJspNavElement)i.next();
String menuTitle=ne.getTitle();
if (pageTitle.equals(menuTitle) ) {
isCurrentPage=true;
} else {
isCurrentPage=false;
}
result=(String) titleHash.get(menuTitle);
if (result!=null && result.length()>0){
menuTitle=result;
}
stbLCrumb.append( "[<a href= '" +
cmsAct.link(ne.getResourceName()) + "' >" + menuTitle + "</a>]
");
stbLCrumb.append(CRLF);
templateDataSa.addLowerBreadcrumbs("[<a href=
'" + cmsAct.link(ne.getResourceName()) + "' >" + menuTitle + "</a>]
");
templateDataSa.addMenu(" <tr>");
templateDataSa.addMenu(CRLF);
if (isCurrentPage==false){
templateDataSa.addMenu(" <td
class=" + QU + "buttonHeading" + QU + " onMouseOver=" + QU +
"this.className='buttonMouseOverHeading'" + QU + " onMouseOut=" + QU +
"this.className='buttonHeading'" + QU + " ><div align=" + QU + "center"
+ QU + ">");
} else{
templateDataSa.addMenu(" <td
class=" + QU + "buttonActiveHeading" + QU + " ><div align=" + QU +
"center" + QU + ">");
}
templateDataSa.addMenuUrl(cmsAct.link(ne.getResourceName()) ,
menuTitle,isCurrentPage);
templateDataSa.addMenu("</div></td>");
templateDataSa.addMenu(CRLF);
templateDataSa.addMenu(" </tr>");
templateDataSa.addMenu(CRLF);
templateDataSa.addMenu(CRLF);
}
%>
<script language="JavaScript"><!--
function JS_emailWebMaster()
{
user = "<%=templateDataSa.getEmailUser() %>";
site = "<%=templateDataSa.getEmailSite() %>";
document.write('<a href=\"mailto:' + user + '@' + site + '\">');
document.write(user + '@' + site + '</a>');
}
// -->
</script>
<html>
<head>
<title><%=pageTitle %></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%
if(description!=null && description.length()>1 ){
%>
<meta name="description" content="<%=description %>">
<%
}
if(keywords!=null && keywords.length()>1 ){
%>
<meta name="keywords" content="<%=keywords %>">
<%
}
%>
<link REL="STYLESHEET" TYPE="text/css"
HREF="<%=templateDataSa.getStyleSheetnName() %>">
<cms:editable />
</head>
<body>
<table class='main_border_table' height='500' width='755'
cellpadding='0' cellspacing='0'>
<tr>
<td valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" class="pageBanner"><table width="100%" border="0"
cellspacing="0" cellpadding="0">
<tr>
<td>
<div align="center"><font color="#ffffff" size="+1" face="Verdana,
Arial, Helvetica, sans-serif"><strong><%=organizationName
%></strong></font></div>
</td>
</tr>
<tr>
<td>
<div align="center"> <table width="760" height="111" border="0"
cellspacing="0" cellpadding="0"
background="<%=templateDataSa.getBannerTags() %>" >
<tr>
<td valign="top" align="right">
<font color="#FFFFFF" size="+1" face="Verdana,
Arial, Helvetica, sans-serif">
<strong><%=pageTitle %> </strong>
</font>
</td>
</tr>
</table></div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" ><table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td width="20%" valign="top" align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%=templateDataSa.getMenu() %>
</table>
</td>
<td width="80%" valign="top" align="justify">
<table width="100%" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td width="5%"> </td>
<td width="90%" valign="top"><font color="#000066">
<!-- Upper Breadcrumbs start here -->
<%=stbHCrumb.toString() %>
<!-- Upper Breadcrumbs ends here -->
<!-- Main page body starts here -->
<cms:template element="text1">
<!-- start content text -->
<div class="element">
<cms:include element="text1" editable="true"/>
<!-- cms:include element="body" editable="true"/ -->
</div>
</cms:template>
<!-- Main page body ends here -->
<!-- Breadcrumbs start here -->
<%=stbLCrumb.toString() %>
<!-- Breadcrumbs ends here -->
</td>
<td width="5%"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <br> <br>
<a href="<%=templateDataSa.getMainAdvertUrl() %>"><font
size="+1" face="Verdana, Arial, Helvetica,
sans-serif"><%=templateDataSa.getMainAdverttext() %></font></a><br>
<br>
<font face="Arial" size="3" color="#000080"><strong><br>
<%=templateDataSa.getWebMastersEmailText() %>:</strong> <strong>
<script language="JavaScript"><!--
JS_emailWebMaster();
//-->
</script>
._. </strong></font><br>
<br>
<br>
<br></td>
</tr>
<tr>
<td valign="top" class="pageFooter"><div align="center"><font
color="#ffffff" size="+1" face="Verdana, Arial, Helvetica,
sans-serif"><strong><%=organizationName %></strong></font><font
color="#000099" size="+1"></font></div></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p><a href="<%=templateDataSa.getWebDesignerURL()
%>"><%=templateDataSa.getWebDesignerText() %></a></p>
<p><font color="#800000" face="Times New Roman, Times, serif"><strong><a
href="<%=templateDataSa.getHostingCoURL()
%>"><%=templateDataSa.getHostingCoText() %></a></strong></font></p>
<br><br><br><br><br><br>
<p align="center"><%=templateDataSa.getTokens("copywrightMessage")
%></p>
</body>
</html>
___________________________________________________________
Important Notice:
Authorised Financial Services Provider
Important restrictions, qualifications and disclaimers
("the Disclaimer") apply to this email. To read this click on the
following address or copy into your Internet browser:
http://www.absa.co.za/disclaimer
The Disclaimer forms part of the content of this email in terms of
section 11 of the Electronic Communications and Transactions
Act, 25 of 2002.
If you are unable to access the Disclaimer, send a blank e-mail
to disclaimer at absa.co.za and we will send you a copy of the
Disclaimer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060921/bbdc84a4/attachment.htm>
More information about the opencms-dev
mailing list