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

📄 catalogupdate.jsp

📁 一个免费wap站
💻 JSP
字号:
<?xml version="1.0" encoding="gb2312" ?>
<%@ page language="java" contentType="text/html; charset=gb2312"
	pageEncoding="gb2312"%>
<%@ page import="com.eline.wap.common.util.*,
	com.eline.wap.catalog.util.*,
	com.eline.wap.catalog.client.*,
	com.eline.wap.catalog.model.*"%>
<%
int indexId = StringUtils.getInt(request.getParameter("catalogId"), -1);
System.out.println("catalogUpdate.jsp.catalogId=" + indexId);

CatalogHelper ch = new CatalogHelper();
Item baseItem = ch.getItem(indexId);
if (baseItem == null || !(baseItem instanceof ListItem)) {	// 如果该对象不是是目录列表,则跳转到出错页面
	String jumpToURL = null;
	if (baseItem != null) {
		System.out.println("baseItem.getType()=" + baseItem.getType());
		if (baseItem.getType() == Item.TYPE_SINGLE) {
			jumpToURL = SiteUrls.getInstance().getProperty(SiteUrls.CATALOG_RESOURCE_UPDATE) + "?catalogId=" + indexId;
		} else if (baseItem.getType() == Item.TYPE_EFFECT)
			jumpToURL = SiteUrls.getInstance().getProperty(SiteUrls.CATALOG_EFFECT_UPDATE) + "?catalogId=" + indexId;
		else
			jumpToURL = SiteUrls.getInstance().getProperty(SiteUrls.CATALOG_FAILURE);
	}
	System.out.println("jumpToURL=" + jumpToURL);
	response.sendRedirect(jumpToURL);
	return;
}
ListItem item = (ListItem) baseItem;
String uploadPath = request.getContextPath()
	+ AppSettings.getInstance().getProperty(AppKeys.UPLOAD_ROOT)
	+ "/images/icons";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>catalogUpdate</title>
<link href="../../style/default.css" type="text/css" rel="stylesheet" />
<script language="javascript">
<!--

function fileBox_onchange() {
	var element = event.srcElement;
	var image = null;

	if (element == null)
		return;

	if (element.name == "fileIcon")
		image = document.all["ImageIcon"];
	else if (element.name == "fileBanner")
		image = document.all["ImageBanner"];

	if (image != null)
		image.src = element.value;

	return true;
}

function listNodeType_onchange() {
	var element = event.srcElement;
	
	var actionUrl = "<%=request.getRequestURI()%>?nodeType=" + element.value;
	window.alert(actionUrl);
	document.forms["Form1"].action = actionUrl;
	
	return false;
}

function buttonSubmit_onclick() {
	document.forms["Form1"].action = "../catalog.do?webAction=1";	// webAction = 1 : update
	
	if (document.all["name"].value.length < 1) {
		window.alert("您必须正确填写目录名称");
		return false;
	}

	return true;
}

function buttonCancel_onclick() {
	var dlgWnd = window;

	if (window.parent != null)
		dlgWnd = window.parent;
	dlgWnd.close();

	return true;
}

-->
</script>
</head>
<body bgcolor="#f0f0f0" bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0">
<form name="Form1" method="post" action="<%=SiteUrls.getInstance().getProperty(SiteUrls.CATALOG)%>?webAction=1" enctype="multipart/form-data">
<table cellspacing="1" align="center" border="0">
	<tr>
		<td height="22">节点属性: <select name="type" onchange="return listNodeType_onchange()" disabled>
				<option selected value="0">目录列表</option>
				<option value="1">目录项</option>
		</select></td>
	</tr>
	<tr>
		<td>
			<table class="tableBorder" cellspacing="1" width="100%" border="0">
				<tr>
					<td class="tableHeader" colspan="2" height="22">编辑目录信息</td>
				</tr>
				<tr>
					<td class="tableRow" width="100">目录名:</td>
					<td class="tableRow">
						<input name="name" type="text" maxlength="50" size="35" value="<%=item.getName()%>" />
						<input type="checkbox" id="searchable" name="searchable" <%=item.isSearchable() ? "checked" : "" %> /><label for="searchable">能否被搜索</label></td>
				</tr>
				<tr>
					<td class="tableRow" width="100">目录类型:</td>
					<td class="tableRow">
						<select name="listType" disabled>
							<option <%=item.getListAttribute() == 0 ? "selected" : ""%> value="0">普通目录</option>
							<option <%=item.getListAttribute() == 1 ? "selected" : ""%> value="1">书籍目录</option>
							<option <%=item.getListAttribute() == 2 ? "selected" : ""%> value="2">资讯目录</option>
							<option <%=item.getListAttribute() == 4 ? "selected" : ""%> value="3">铃声目录</option>
							<option <%=item.getListAttribute() == 3 ? "selected" : ""%> value="4">图片目录</option>
							<option <%=item.getListAttribute() == 5 ? "selected" : ""%> value="5">游戏目录</option>
							<option <%=item.getListAttribute() == 6 ? "selected" : ""%> value="6">动画目录</option>
						</select></td>
				</tr>
				<tr>
					<td class="tableRow">索引图标:</td>
					<td class="tableRow"><input name="fileIcon" type="file" size="35" onchange="return fileBox_onchange()" />
					</td>
				</tr>
				<tr>
					<td class="tableRow">Banner图片:</td>
					<td class="tableRow"><input name="fileBanner" type="file" size="35" onchange="return fileBox_onchange()" />
					</td>
				</tr>
				<tr>
					<td class="tableRow">状态:</td>
					<td class="tableRow">
						<select name="active">
							<option <%=item.isActive() ? "selected" : ""%> value="1">有效</option>
							<option <%=!item.isActive() ? "selected" : ""%> value="0">无效</option>
						</select></td>
				</tr>
				<tr>
					<td class="tableRow">描述</td>
					<td class="tableRow">
						<textarea name="description" rows="4" cols="35"><%=item.getDescription()%></textarea></td>
				</tr>
				<tr>
					<td class="tableRow" colspan="2">
						<hr width="100%" size="1" />
					</td>
				</tr>
				<tr>
					<td class="tableRow" height="40" bgcolor="#94b2de"><input type="hidden" name="indexId" value="<%=indexId%>" /></td>
					<td class="tableRow" valign="top" height="40" bgcolor="#94b2de">
						<input type="submit" name="ButtonSubmit" value="提交" id="ButtonSubmit" onclick="return buttonSubmit_onclick()" class="button2w" /><input type="button" name="ButtonCancel" value="取消" onclick="return buttonCancel_onclick()" class="button2w" /></td>
				</tr>
			</table>
			<br/>
			<div style="overflow: auto; width: 490px; height: 160px">
				<table class="tableBorder" cellspacing="1" width="100%" border="0">
					<tr>
						<td class="tableHeader" colspan="2" height="22">
							图片预览</td>
					</tr>
					<tr>
						<td class="tableRow">索引图标:</td>
						<td class="tableRow">Banner图片</td>
					</tr>
					<tr>
						<td class="tableRow">
						<%
						String iconPath = item.getIconFile();
						if (iconPath != null && iconPath.length() > 0) {
							iconPath = uploadPath + iconPath;
						} else
							iconPath = null;
						%>
							<img id="ImageIcon" <%=iconPath != null ? ("src=\"" + iconPath + "\"") : ""%> alt="" border="0" /></td>
						<td class="tableRow">
						<%
						String bannerPath = item.getBannerFile();
						if (bannerPath != null && bannerPath.length() > 0) {
							bannerPath = uploadPath + bannerPath;
						} else
							bannerPath = null;
						%>
							<img id="ImageBanner" <%=bannerPath != null ? ("src=\"" + bannerPath + "\"") : ""%> alt="" border="0" /></td>
					</tr>
				</table>
			</div>
		</td>
	</tr>
</table>
</form>
</body>
</html>

⌨️ 快捷键说明

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