⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 menu.jsp

📁 HomePlayer is an extention of the FreePlayer software provided by the french internet provider Free
💻 JSP
字号:
<%@page import="org.homeplayer.web.*"%>
<%@page import="org.homeplayer.util.StringUtil" %>
<%@page import="java.util.*" %>
<jsp:useBean id="hppc" class="org.homeplayer.web.HPPageContext" scope="request"/>
<%
// find thre previous link
HPMenuPrevious previousLink = null;
for (Iterator it = hppc.getMenuItems().iterator(); it.hasNext();) {
	HPMenuItem item = (HPMenuItem) it.next();
	if (item.getType() == HPMenuItem.PREVIOUS) {
		previousLink = (HPMenuPrevious) item;
	}
}
// if no focus set on page and no meuitem is focused, set the focus to the first link of the list
if (! hppc.isFocusSetOnPage()) {
	boolean focusOnLink = false;
	for (Iterator it = hppc.getMenuItems().iterator(); it.hasNext();) {
		HPMenuItem item = (HPMenuItem) it.next();
		if (item.getType() == HPMenuItem.LINK) {
			if (((HPMenuLink) item).isFocused()) {
				focusOnLink = true;
				break;
			}
		}
	}
	if (! focusOnLink) {
		for (Iterator it = hppc.getMenuItems().iterator(); it.hasNext();) {
			HPMenuItem item = (HPMenuItem) it.next();
			if (item.getType() == HPMenuItem.LINK) {
				((HPMenuLink) item).setFocused(true);
				break;
			}
		}
	}
}
%>
<table border=0 cellspacing="0" cellpadding="0" width="208">
	<tr>
		<td bgcolor="<%= hppc.color(hppc.getSkin().getProp("bodyColor")) %>" width="5"></td>
		<td bgcolor="<%= hppc.color(hppc.getSkin().getProp("bodyColor")) %>" height="<%=hppc.getSkin().getProp( "imageMenu" ).equals("")?"408":hppc.getSkin().getProp( "imageMenu" ).equals("/images/blanck.gif") ? "260" : "288" %>" valign="top">
		<table border=0 cellspacing="0" cellpadding="0" width="203">
			<tr><td height=2><img width="1" height="2" src="/images/blanck.gif"></td></tr>
	<% 
	for (Iterator it = hppc.getMenuItems().iterator(); it.hasNext();) {
		HPMenuItem item = (HPMenuItem) it.next();
%>
			<tr><td>	
<%	
		if (item.getType() == HPMenuItem.SEPARATOR) {
	%>
					<table border="0" cellpadding="0" cellspacing="0" width="203">
						<tr><td height=5><img width="1" height="1" src="/images/blanck.gif"></td></tr>
						<tr><td height=2 bgcolor="<%= hppc.color(hppc.getSkin().getProp("headerColor")) %>" ><img width="1" height="1" src="/images/blanck.gif"></td></tr>
						<tr><td height=5><img width="1" height="1" src="/images/blanck.gif"></td></tr>
					</table>
	<%
	   
		} else if (item.getType() == HPMenuItem.TITLE) {
			HPMenuTitle title = (HPMenuTitle) item;
	%>
					<table width="100%" cellpadding="0" cellspacing="0">
						<tr><td height=2><img width="1" height="1" src="/images/blanck.gif"></td></tr>
						<tr><td valign=MIDDLE align=center><%= title.getName() %></td></tr>
						<tr><td height=5><img width="1" height="1" src="/images/blanck.gif"></td></tr>
					</table>
	<%
		} else {
			HPMenuLink link = (HPMenuLink) item;
			if (link.getType() == HPMenuItem.NEXT) {
	%>
					<table bgcolor="<%= hppc.color(hppc.getSkin().getProp("headerColor")) %>" border="0" cellpadding="0" cellspacing="0" width="100%">
						<tr><td height=2><img width="1" height="1" src="/images/blanck.gif"></td></tr>
					</table>
                  <a href="<%= link.getUrl() %>" onfocus="<%= link.getUrl() %>">
					<% if (link.getIcone() != null) { %>
						<%= link.getIcone() %>
					<% } else { %>
                   		<font family="Symbol" size="+2">U</font>
					<% } %>
                  </a><br>
      <%  } else if (link.getType() == HPMenuItem.PREVIOUS) { %>
    	<a 	href="<%= link.getUrl() %>" onfocus="<%= link.getUrl() %>">
                <% if (link.getIcone() != null) { %>
                	<%= link.getIcone() %>
                <% } else { %>
                	<font family="Symbol" size="+2">V</font>
                <% } %>
            </a>
            <table bgcolor="<%= hppc.color(hppc.getSkin().getProp("headerColor")) %>" border="0" cellpadding="0" cellspacing="0" width="100%">
						<tr><td height=2><img width="1" height="1" src="/images/blanck.gif"></td></tr>
					</table>
    <% 	} else { /* link */ 
  	   			String titleItem = link.getName();
				//String titleWithoutHtml = StringUtil.removeHTMLCode(titleItem);
				//String labelWithoutHtml =  titleWithoutHtml.length()>50 ? (titleWithoutHtml.substring(0,50)+"...") : titleWithoutHtml; 
				//String label = titleItem.substring(0, titleItem.indexOf(titleWithoutHtml)) + labelWithoutHtml + titleItem.substring(titleItem.indexOf(titleWithoutHtml) + titleWithoutHtml.length());
				String label = titleItem ;
     %>
					<table width="100%" cellpadding="0" cellspacing="0">
						<tr><td ><%=hppc.getTableLink( link.getIcone(), label, link.getUrl(), hppc.getSkin().getProp("bodyColor"), 18, link.isFocused()&&hppc.isFocusSetOnPage()==false) %></td></tr>
					</table>
	<%		}
		}
	%></td></tr><%
	} 
	%>
	</table>
	<% if (hppc.getMenuInfo() != null) { %>
		<hr size=1>
		<%= hppc.getMenuInfo() %>
	<% } %>
		<img width="1" height="1" src="/images/blanck.gif">
		</td>
		<td bgcolor="<%= hppc.color(hppc.getSkin().getProp("bodyColor")) %>" width="5"></td>
	</tr>
</table>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -