?? catalogupdate.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 + -