edittemplate.jsp

来自「一个完整的网络订餐系统」· JSP 代码 · 共 246 行

JSP
246
字号
<%--
 - $Header: /cvsroot/mvnforum/mvnforum/srcweb/mvnplugin/mvnforum/admin/edittemplate.jsp,v 1.5 2005/01/18 11:01:37 minhnn Exp $
 - $Author: minhnn $
 - $Revision: 1.5 $
 - $Date: 2005/01/18 11:01:37 $
 -
 - ====================================================================
 -
 - Copyright (C) 2002-2005 by MyVietnam.net
 -
 - This program is free software; you can redistribute it and/or
 - modify it under the terms of the GNU General Public License
 - as published by the Free Software Foundation; either version 2
 - of the License, or any later version.
 -
 - All copyright notices regarding mvnForum MUST remain intact
 - in the scripts and in the outputted HTML.
 - The "powered by" text/logo with a link back to
 - http://www.mvnForum.com and http://www.MyVietnam.net in the
 - footer of the pages MUST remain visible when the pages
 - are viewed on the internet or intranet.
 -
 - This program is distributed in the hope that it will be useful,
 - but WITHOUT ANY WARRANTY; without even the implied warranty of
 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 - GNU General Public License for more details.
 -
 - You should have received a copy of the GNU General Public License
 - along with this program; if not, write to the Free Software
 - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 -
 - Support can be obtained from support forums at:
 - http://www.mvnForum.com/mvnforum/index
 -
 - Correspondence and Marketing Questions can be sent to:
 - info@MyVietnam.net
 -
 - @author: Phong, Ta Quoc  phongtq@MyVietnam.net
 --%>
<%@ page contentType="text/html;charset=utf-8" %>
<%@ page errorPage="fatalerror.jsp"%>
<%@ page import="com.mvnforum.db.*" %>
<%@ page import="com.mvnforum.MVNForumGlobal" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ include file="inc_common.jsp"%>
<fmt:bundle basename="mvnForum_i18n">
<html>
<head>
  <title><fmt:message key="mvnforum.common.forum.title_name"/> - Edit Email Templates</title>
<%@ include file="/mvnplugin/mvnforum/meta.jsp"%>
<link href="<%=onlineUser.getCssPath()%>" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<%@ include file="inc_js_checkvalid_myvietnamlib.jsp"%>
<script type="text/javascript">
function SubmitForm() {
  if (ValidateForm() == true ) {
    document.submitform.submitbutton.disabled=true;
    document.submitform.submit();
  }
}

function ValidateForm() {
  if (isBlank(document.submitform.subject, "Subject")) return false;
  if (isBlank(document.submitform.body, "Body")) return false;
  return true;
}
</script>

<%@ include file="header.jsp"%>
<%
  String subject = ParamUtil.getAttribute(request, "TemplateSubject");
  String body = ParamUtil.getAttribute(request, "TemplateBody");
  String template = ParamUtil.getParameter(request, "template");
  boolean success = (! ParamUtil.getAttribute(request, "Successful").equals(""));
  request.removeAttribute("Successful");
  if (template.equals("")) {
    template = MVNForumGlobal.TEMPLATE_SENDACTIVATECODE_PREFIX;
  }
  // note that we already check the template input in the Java Handler
%>
<br/>
<table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center">
  <tr class="pagedesc">
    <td>
    You can customize the content of template files, which used to send email for a certain purpose 
      (recovery his password, activate his account, or inform the new watch.)
    <br/>Note: You can using the predefined items which starts with "&#36;{" and ends with "}".
    <br/>You could use the template items below:
    </td>
  </tr>
</table>
</br>
<table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center">
  <tr class="theader">
    <td>Items</td>
    <td>Description and Usage</td>
  </tr>
<% if (template.equals(MVNForumGlobal.TEMPLATE_SENDACTIVATECODE_PREFIX)) {%>
  <tr class="trow1">
    <td>&#36;{memberName}</td><td>Member Login Name</td>
  </tr>
  <tr class="trow2">
    <td>&#36;{serverName}</td><td>Server Name</td>
  </tr>
  <tr class="trow1">
    <td>&#36;{MVNForumInfo}</td><td>Forum Information</td>
  </tr>
  <tr class="trow2">
    <td>&#36;{activationUrl}</td><td>Activation URL </td>
  </tr>
  <tr class="trow1">
    <td>&#36;{activateCode}</td><td>Activation Code</td>
  </tr>
<%} else if (template.equals(MVNForumGlobal.TEMPLATE_WATCHMAIL_PREFIX)) {%>
  <tr class="trow1">
    <td>&#36;{lastSent}</td>
    <td>The last watch mail sent date</td>
  </tr>
  <tr class="trow2">
    <td>&#36;{now}</td>
    <td>Now/Present</td>
  </tr>
  <tr class="trow1" valign='top'>
    <td>&#36;{forumBase}</td>
    <td>The forum Link</td>
  </tr>
  <tr class="trow2" valign='top'>
    <td>threadWatchList</td>
    <td>The thread watch list. Iterator over a list of thread watch list.
      <br/>Usage: <#list threadWatchList as mailbeans > ...&lt;/#list></td>
  </tr>
  <tr class="trow1" valign='top'>
    <td>forumName</td>
    <td>Above is the properties of the thread watch list :
      <br/>Usage:
<pre>
&lt;#list threadWatchList as mailbeans >
&lt;#if mailbeans.leader >
[Category: &#36;{mailbeans.categoryName}]
  [Forum: &#36;{mailbeans.forumName}]
&lt;/#if>
    Thread [&#36;{mailbeans.threadTopic}] given to us by &#36;{mailbeans.memberName}
      last posted by &#36;{mailbeans.lastPostMemberName} on &#36;{mailbeans.threadLastPostDate}
      &#36;{mailbeans.threadUrl}

&lt;/#list>
</pre>
    </td>
  </tr>
  <tr class="trow2">
    <td>threadTopic</td>
    <td>Thread Topic. Usage: &#36;{mailbeans.threadTopic}</td>
  </tr>
  <tr class="trow1">
    <td>memberName</td>
    <td>Thread Owner. Usage: &#36;{mailbeans.memberName}</td>
  </tr>
  <tr class="trow2">
    <td>lastPostMemberName</td>
    <td>The last post member in the thread. Usage: &#36;{mailbeans.lastPostMemberName}</td>
  </tr>
  <tr class="trow1">
    <td>threadLastPostDate</td>
    <td>The last post date in the thread. Usage: &#36;{mailbeans.threadLastPostDate}</td>
  </tr>
  <tr class="trow2">
    <td>threadUrl</td>
    <td>Thread URL. Usage: &#36;{mailbeans.threadUrl}</td>
  </tr>
<%} else if (template.equals(MVNForumGlobal.TEMPLATE_FORGOTPASSWORD_PREFIX)) {%>
  <tr class="trow1">
    <td>&#36;{memberName}</td>
    <td>Member Login Name</td>
  </tr>
  <tr class="trow2">
    <td>&#36;{serverName}</td>
    <td>Server Name</td>
  </tr>
  <tr class="trow1">
    <td>&#36;{MVNForumInfo}</td>
    <td>Forum Information</td>
  </tr>
  <tr class="trow2">
    <td>&#36;{passwordResetUrl}</td>
    <td>Resetting URL</td>
  </tr>
  <tr class="trow1">
    <td>&#36;{currentTempPassword}</td>
    <td>Current temporary Password</td>
  </tr>
<%}%>
  <tr class="trowfinal">
    <td colspan='2'>
      Please see template help at <a href="http://www.freemarker.org">FreeMarker</a>
    </td>
  </tr>
</table>
<br/>

<table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center">
  <tr class="theader">
    <td colspan="2">Edit Mail Template:</td>
  </tr>
  <% if (success) {%>
  <tr class="tcat">
    <td colspan="2" align="center" class="warning">The template has been saved successfully.</td>
  </tr>
  <% } %>
  <tr class="trow1">
    <td><span class="requiredfield">*</span> Template for</td>
    <td>
      <form name="changetemplate" method="get" action="edittemplate">
        <select name="template" onchange='document.changetemplate.submit();'>
          <option value="forgotpasswordtemplate" <%if (template.equals("forgotpasswordtemplate")) {%> selected <%}%>>Recovery Passwords</option>
          <option value="watchmailtemplate" <%if (template.equals("watchmailtemplate")) {%> selected <%}%>>Watch Mail</option>
          <option value="sendactivemailtemplate" <%if (template.equals("sendactivemailtemplate")) {%> selected <%}%> >Active Members</option>
        </select>
      </form>
    </td>
  </tr>
  <form action="updatetemplate" method="post" name="submitform">
  <input name="template" type="hidden" value="<%=template%>"/>
  <tr class="trow1">
    <td><span class="requiredfield">*</span> Subject:</td>
    <td nowrap><input type="text" name="subject" value="<%=subject%>" size="80"></td>
  </tr>
  <tr class="trow2">
    <td><span class="requiredfield">*</span> Body:</td>
    <td nowrap><textarea cols="80" rows="18" name="body" tabindex="2"><%=body%></textarea></td>
  </tr>
  <tr class="trowfinal">
    <td colspan="2" align="center">
      <input type="button" name="submitbutton" value="Save Template" onclick='SubmitForm();' class="mainoption"/>
      <input type="reset" value="Reset" class="liteoption">
    </td>
  </tr>
  </form>
</table>

<br/>
</fmt:bundle>
<%@ include file="footer.jsp"%>
</body>
</html>

⌨️ 快捷键说明

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