📄 tpledit.jsp
字号:
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c"%>
<jsp:include page="../cp_header.jsp" />
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="guide">
<tr><td><a href="#" onclick="parent.menu.location='admincp.jsp?action=menu'; parent.main.location='admincp.jsp?action=home';return false;">系统设置首页</a> » 编辑模板</td></tr>
</table>
<br />
<script language="JavaScript">
var n = 0;
function displayHTML(obj) {
win = window.open(" ", 'popup', 'toolbar = no, status = no, scrollbars=yes');
win.document.write("" + obj.value + "");
}
function HighlightAll(obj) {
obj.focus();
obj.select();
if(document.all) {
obj.createTextRange().execCommand("Copy");
window.status = "将模板内容复制到剪贴板";
setTimeout("window.status=''", 1800);
}
}
function findInPage(obj, str, noalert) {
var txt, i, found;
if(str == "") {
return false;
}
if(document.layers) {
if(!obj.find(str)) {
while(obj.find(str, false, true)) {
n++;
}
} else {
n++;
}
if(n == 0 && !noalert) {
alert("未找到指定字串。");
}
}
if(document.all) {
txt = obj.createTextRange();
for(i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
txt.moveStart('character', 1);
txt.moveEnd('textedit');
}
if(found) {
txt.moveStart('character', -1);
txt.findText(str);
txt.select();
txt.scrollIntoView();
n++;
return true;
} else {
if(n > 0) {
n = 0;
findInPage(obj, str, noalert);
} else if(!noalert) {
alert("未找到指定字串。");
}
}
}
return false;
}
</script>
<form method="post" action="admincp.jsp?action=modtpledit&templateid=${template.templateid}&fn=${fn}">
<input type="hidden" name="keyword" value="${keyword}">
<input type="hidden" name="isLang" value="${isLang}">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tableborder">
<tr class="header"><td>编辑模板 - ${template.name} ${fn} - 最后修改时间: ${filemtime}</td></tr>
<c:if test="${isLang}">
<tr>
<td class="altbg1" align="center">
<div align="center">
<div style="overflow-x: hidden;overflow-y: scroll; width:100%; height: 300px">
<table width="100%" border="0">
<c:forEach items="${langs}" var="lang">
<tr><td colspan="2"><b>${lang.key}</b></td></tr>
<c:forEach items="${lang.value}" var="prop">
<tr>
<td width="100" style="border:0">${prop.key}</td>
<td style="border:0"><textarea cols="100" rows="3" name="lang[${lang.key}][${prop.key}]" style="width: 95%;">${prop.value}</textarea></td>
</tr>
</c:forEach>
</c:forEach>
</table>
</div>
</div>
</td>
</tr>
</c:if>
<tr>
<td class="altbg1" align="center">
<div align="center">
<c:if test="${!isLang}"><textarea cols="100" rows="25" name="content" style="width: 95%;">${content}</textarea><br /></c:if>
<input name="search" type="text" accesskey="t" size="20" onChange="n=0;">
<input class="button" type="button" value="搜索" accesskey="f" onClick="findInPage(this.form.content, this.form.search.value)">
<input class="button" type="button" value="返回" accesskey="e" onClick="location.href='admincp.jsp?action=templates&edit=${template.templateid}&keyword=${keyword}'">
<input class="button" type="button" value="预览" accesskey="p" onClick="displayHTML(this.form.content)">
<input class="button" type="button" value="复制" accesskey="c" onClick="HighlightAll(this.form.content)">
<c:if test="${fsmap.admincp_tpledit>0}">
<c:if test="${template.templateid==1}"><input class="button" type="submit" name="editsubmit" onclick="return confirm('为了扩充其它模板的方便,强烈建议您不要对默认模板的内容进行修改,您确定要修改吗?')" value="提 交"></c:if>
<c:if test="${template.templateid!=1}"><input class="button" type="submit" name="editsubmit" value="提 交"></c:if><br />
文件复制到:
<select id="copyto" style="vertical-align: middle">
<c:forEach items="${templates}" var="temp"><option value="${temp.templateid}">${temp.directory}</option></c:forEach>
</select>
<input style="vertical-align: middle" class="button" type="button" value="开始复制" accesskey="r" onclick="if($('copyto').value == 1 && confirm('为了扩充其它模板的方便,强烈建议您不要对默认模板的内容进行修改,您确定要修改吗?') || $('copyto').value != 1) location.href='forumsedit.do?action=tpledit&templateid=${template.templateid}&keyword=${keyword}&fn=${fn}©toid='+$('copyto').value+'©to=yes'">
<c:if test="${nosame}">
<input class="button" style="vertical-align: middle" type="button" value="恢复默认" accesskey="r" onclick="location.href='admincp.jsp?action=tpledit&templateid=${template.templateid}&keyword=${keyword}&fn=${fn}&reset=yes'">
<input class="button" style="vertical-align: middle" type="button" value="模板检查" onclick="location.href='admincp.jsp?action=tpledit&templateid=${template.templateid}&fn=${fn}&keyword=${keyword}&checktpl=yes'">
</c:if>
</c:if>
</div>
</td>
</tr>
</table>
</form>
<jsp:include page="../cp_footer.jsp" />
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -