📄 content_bak.jsp
字号:
<%@ page contentType="text/html; charset=gb2312"%>
<%@page buffer="50kb"%>
<%@ page import="java.util.Collection"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="com.cyberway.dynaform.form.web.FormForm"%>
<%@ page import="com.cyberway.cms.util.CMSCommonUtil"%>
<%@ page import="com.cyberway.dynaform.form.ejb.ValidateMessage"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="/smartweb" prefix="s" %>
<c:set var="type" value="${FormForm.valueObject.type}"/>
<%
String contextPath = request.getContextPath();
String type = request.getParameter("type");
pageContext.setAttribute("TEMPLATETYPE", CMSCommonUtil.getTemplateType());
pageContext.setAttribute("SITE", CMSCommonUtil.getSite());
Collection errors = (Collection)request.getAttribute("ERRORS");
%>
<html:html>
<head>
<title><s:Language key="resource_info_edit"/> </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="<%= contextPath %>/css/css.jsp" type="text/css">
<script src="<%= contextPath %>/js/billlist.js"></script>
<script src="<%= contextPath %>/js/billitem.js"></script>
<script src="<%= contextPath %>/js/check.js"></script>
<script src="<%= contextPath %>/js/util.js"></script>
<script src="<%= contextPath %>/js/category.js"></script>
<script src="<%= contextPath %>/js/info.js"></script>
<script src="<%= contextPath %>/cms/utility/select.js"></script>
<script language="JavaScript">
var contextPath = '<%= contextPath %>';
cmdReturn = '/dynaform/form/list.do';
cmdSave = '/dynaform/form/save.do';
cmdEdit = '/dynaform/form/edit.do';
cmdNew = '/dynaform/form/new.do';
cmdDelete = '/dynaform/form/delete.do';
cmdSetdefault = '/dynaform/form/setdefault.do';
function ev_checkval() {
addfield('name', '<s:Language key="name"/>', 'c', false, 100, 1);
var ok = checkval(window);
if(!ok){
return;
};
if(!/^[a-zA-Z0-9]+$/.test(formItem.name.value)){
alert("<s:Language key="template_name_only_char"/>");
ok = false;
return;
}
return ok;
}
function ev_return(){
if(formItem.type.selectedIndex == 0)
cmdReturn = '/dynaform/form/formlist.do';
else if(formItem.type.selectedIndex == 1)
cmdReturn = '/dynaform/form/listlist.do';
else if(formItem.type.selectedIndex == 2)
cmdReturn = '/dynaform/form/contentlist.do';
doReturn();
}
function ev_load() {
if (document.all['richedit']) {
var data = formItem.templateContextString.value;
richedit.setHTML(data);
}
}
function clearChannel(){
formItem.channelid.value='';
// formItem.name.value='';
}
function initializePageTitle(){
formItem.pagetitle.value = formItem.siteid[formItem.siteid.selectedIndex].text;
}
function ev_copy(){
templtype = formItem.type.options[formItem.type.selectedIndex].value;
selectFormEx(formItem._sourcetmplid,null,templtype, '0', '0');
if(formItem._sourcetmplid.value!=""){
if(formItem.id.value==""||formItem.id.value=="0"){
cmdNew = addParam(cmdNew, 'sfid',formItem._sourcetmplid.value);
//doNew();
url = addParam(contextPath + cmdNew, 'ISEDIT', 'TRUE');
url = addParam(url, 'COMMAND', 'new');
url = addParam(url, 'l_channelid', '0');
formItem.action = url;
formItem.submit();
}
else{
cmdEdit = addParam(cmdEdit, 'sfid',formItem._sourcetmplid.value);
doEdit();
}
}
}
function ev_setdefault(){
if(formItem.id.value==''||formItem.id.value=='0'){
alert('<s:Language key="plz_save_template_first"/>');
return false;
}
if(window.confirm('<s:Language key="set_as_default_template_ornot"/>?')){
cmdSetdefault = addParam(contextPath + cmdSetdefault, 'ISEDIT', 'TRUE');
enable();
formItem.action = cmdSetdefault;
formItem.submit();
}
}
function ev_returnEx(){
if(parent.isInFrame!=null&&parent.isInFrame)
window.close();
else
ev_return();
}
function ev_clearname(){
if(formItem.name.value.indexOf('<s:Language key="plz_sel"/>')>=0){
formItem.name.value = "";
}
}
function ev_updateAll(){
var url = "/dynaform/form/updateTemplate.do";
url = addParam(contextPath + url, 'ISEDIT', 'TRUE');
url = addParam(contextPath + url, 'UPDATETEMPLATE', 'TRUE');
enable();
formItem.action = url;
formItem.submit();
}
</script>
</head>
<body onload="ev_load();">
<html:form action="/dynaform/form/view.do" styleId="formItem" method="post">
<html:hidden property="channelid"/>
<html:hidden property="templateid"/>
<html:hidden property="ischange"/>
<!--<html:hidden property="siteid"/>-->
<html:hidden property="pagecss"/>
<html:hidden property="pagetitle"/>
<html:hidden property="owner"/>
<html:hidden property="creator"/>
<html:hidden property="createtime"/>
<html:hidden property="issubform"/>
<html:hidden property="ischange"/>
<input type="hidden" name="_sourcetmplid" value="">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="38" class="list-toolbar" align="right">
<c:choose>
<c:when test="${!empty param.ISEDIT and param.ISEDIT eq 'TRUE'}" >
<input type="button" name="btnSave" value="<s:Language key="save"/>" class="bt-save" onclick="doSave();">
<input type="button" name="btnCopy" value="<s:Language key="copy_from_other_template"/>" class="bt-copy" onclick="ev_copy();">
<c:if test="${empty param.COMMAND or param.COMMAND ne 'new'}" >
<input type="button" name="btnCopy" value="<s:Language key="update_all"/>" class="bt-updateall" onclick="ev_updateAll();">
</c:if>
</c:when>
<c:otherwise>
<input type="button" name="btnEdit" value="<s:Language key="edit"/>" class="bt-edit" onClick="doEdit()">
</c:otherwise>
</c:choose>
<input type="button" name="btnPrint" value="<s:Language key="print"/>" class="bt-print" onclick="doPrint()">
<input type="button" name="btnReturn" value="<s:Language key="return"/>" class="bt-exit" onclick="ev_returnEx()" >
</td>
</tr>
<tr>
<td>
<font color="red">
<%
if (errors != null && errors.size() > 0){
out.println("<s:Language key="errorinfo"/>:<br>");
Iterator iter = errors.iterator();
while(iter.hasNext()) {
ValidateMessage error = (ValidateMessage)iter.next();
out.println("*"+error.getErrmessage()+"<br>");
}
}
%>
</font>
</td>
</tr>
<html:errors/>
<tr>
<td class="list-datas" align="center"><table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#dddddd">
<tr>
<td width="13%" class="content-label"><div class="field-require"><s:Language key="template_code"/>:</div></td>
<td width="29%" class="content-info">
<html:text styleClass="input-text-disable" property="id" disabled="true"/>
</td>
<td width="13%" class="content-label"><div class="field-require"><s:Language key="templatename"/>:</div></td>
<td width="45%" class="content-info">
<c:choose>
<c:when test="${!empty param.ISEDIT and param.ISEDIT eq 'TRUE'}" >
<html:text styleClass="input-text" property="name"/>
</c:when>
<c:otherwise>
<html:text styleClass="input-text" property="name" disabled="true"/>
</c:otherwise>
</c:choose>
</td>
</tr>
<tr>
<td class="content-label"><div class="field-require"><s:Language key="template_type"/>:</div></td>
<td class="content-info">
<c:choose>
<c:when test="${!empty param.ISEDIT and param.ISEDIT eq 'TRUE'}" >
<html:select property="type"><html:options collection="TEMPLATETYPE" property="code" labelProperty="value" /></html:select>
</c:when>
<c:otherwise>
<html:select property="type" disabled="true"><html:options collection="TEMPLATETYPE" property="code" labelProperty="value"/></html:select>
</c:otherwise>
</c:choose>
</td>
<td class="content-label"><s:Language key="templatedesc"/>:</td>
<td class="content-info">
<c:choose>
<c:when test="${!empty param.ISEDIT and param.ISEDIT eq 'TRUE'}" >
<html:text styleClass="input-text" property="discript"/>
</c:when>
<c:otherwise>
<html:text styleClass="input-text" property="discript" disabled="true"/>
</c:otherwise>
</c:choose>
</td>
</tr>
<tr>
<td width="13%" class="content-label"><div class="field-require"><s:Language key="sitein"/>:</div></td>
<td width="45%" class="content-info" colspan="3">
<c:choose>
<c:when test="${!empty param.ISEDIT and param.ISEDIT eq 'TRUE'}" >
<html:select property="siteid" onchange="clearChannel();initializePageTitle();">
<html:option value=""><s:Language key="all"/></html:option>
<html:options collection="SITE" property="id" labelProperty="name" />
</html:select>
</c:when>
<c:otherwise>
<html:select property="siteid" disabled="true">
<html:options collection="SITE" property="id" labelProperty="name" />
</html:select>
</c:otherwise>
</c:choose>
</td>
</tr>
<tr>
<td width="100%" height="345px" valign="top" colspan='4' class="content-info">
<c:choose>
<c:when test="${!empty param.ISEDIT and param.ISEDIT eq 'TRUE'}" >
<html:textarea style="display: none;" property="ewebcontent" />
<IFRAME ID="eWebEditor1" src="formeditor/eWebEditor.jsp?id=ewebContent&style=standard" frameborder="0" scrolling="no" width="100%" height="100%"></IFRAME>
</c:when>
<c:otherwise>
<div><c:out value="${FormForm.valueObject.ewebcontent}" default="" escapeXml="{false}"/></div>
</c:otherwise>
</c:choose>
</td>
</tr>
</table>
</td>
<tr>
</table>
<s:KeepCondition form="formItem"/>
<c:if test="${!empty requestScope.UPDATETEMPLATE and requestScope.UPDATETEMPLATE eq '1'}">
<script>
alert('<s:Language key="updatesucceed"/>!');
</script>
</c:if>
</html:form>
</body>
</html:html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -