<%@ page contentType="text/html; charset=GBK" session="false"%>
<%@ taglib uri="/cmsTag" prefix="cms"%>
<%@ page contentType="text/html; charset=GBK"%>

<!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="X-UA-Compatible" content="IE=EmulateIE7" />
		<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
		<link href="../style/blue/css/main.css" type="text/css" rel="stylesheet" />
		<link href="../style/blue/css/reset-min.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="../javascript/commonUtil_src.js"></script>
		<script type="text/javascript" src="../javascript/editor/fckeditor.js"></script>
		<script language="javascript" type="text/javascript" src="../javascript/My97DatePicker/WdatePicker.js"></script>
		<script>  
	 		var api = frameElement.api, W = api.opener; 
			 
	         if("true"==="${param.fromFlow}")
	         {     	 	
	            api.close(); 
	            
	       		W.window.location.reload();
	         }
        </script>
	</head>
	<body>
	<cms:CurrentSite>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td align="left" valign="top">
					<!--main start-->
					<div class="addtit">
						<img src="../style/blue/icon/application-import.png" width="16" height="16" />
						消息模板
					</div>
					<cms:SystemList querySign="query_single_msg_template" objName="MGT" var="${param.id}">
						<form id="mgtForm" name="mgtForm" method="post">
							<table width="100%" border="0" cellpadding="0" cellspacing="0" class="form-table">
								<tr>
									<td width="16%" class="input-title">
										<strong>名称</strong>
									</td>
									<td class="td-input">
										<input type="text" size="33" id="templateName" name="templateName" class="form-input" value="${MGT.templateName}"></input>
										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
										<span class="input-title"><strong>标识</strong> </span>
										<input type="text" size="33" id="mtFlag" name="mtFlag" class="form-input" value="${MGT.mtFlag}"></input>
									</td>
								</tr>
								<tr>
									<td class="input-title">
										<strong>标题</strong>
									</td>
									<td class="td-input">
										<input type="text" size="83" id="templateTitle" name="templateTitle" class="form-input" value="${MGT.templateTitle}"></input>

									</td>
								</tr>

								<tr>
									<td class="input-title">
										<strong>模板内容</strong>
									</td>
									<td class="td-input">
										<textarea id="templateContent" name="templateContent" style="height:180px;width:400px" class="form-textarea">${MGT.templateContent}</textarea>

										<script type="text/javascript">
                                                   var editor1 = new FCKeditor('templateContent');
                                                   editor1.BasePath = "<cms:BasePath/>core/javascript/editor/";
                                                   
                                                   editor1.ToolbarSet = 'Mid'; 
                                                   editor1.Height = 300;
                                                   editor1.Width = 442;
                                                   editor1.Config["EnterMode"] = "p";
                                                   editor1.ReplaceTextarea();   
                                 		</script>
									</td>
								</tr>
								<tr>
									<td class="input-title">
										<strong>内容变量</strong>
									</td>
									<td class="td-input">
										<select class="form-select" onchange="javascript:selectParamForFCK(this,'templateContent')">
											<option value="">
												----- 备选参数 -----
											</option>

											<cms:SystemList querySign="query_mg_template_param" objName="MGTP" var="${CurrSite.siteId}">
												<option value="{${MGTP.paramFlag}}">
													${MGTP.paramName}
												</option>
											</cms:SystemList>
										</select>
									</td>
								</tr>



							</table>
							<!-- hidden -->
							<input type="hidden" id="mtId" name="mtId" value="${MGT.mtId}"></input>


						</form>
						<div style="height:15px"></div>
						<div class="breadnavTab"  >
							<table width="100%" border="0" cellspacing="0" cellpadding="0" >
								<tr class="btnbg100">
									<td width="77%" class="input-title"></td>
									<td class="td-input">
										<a href="javascript:submitMsgTemplate();"  class="btnwithico"><img src="../style/icons/tick.png" width="16" height="16" /><b>确认&nbsp;</b> </a>
										<a href="javascript:close();"  class="btnwithico" onclick=""><img src="../style/icon/close.png" width="16" height="16"><b>取消&nbsp;</b> </a>
									</td>
									<td valign="top">
										<br />
									</td>
								</tr>
							</table>
						</div>
				</td>
			</tr>

			<tr>
				<td height="10">
					&nbsp;
				</td>
			</tr>
		</table>
		<!--[if lt IE 7]>
        <script type="text/javascript" src="js/unitpngfix.js"></script>
<![endif]-->
	</body>
</html>
<script>  

function submitMsgTemplate()
{
	var form = document.getElementById("mgtForm");
	
	form.action = '<cms:BasePath/>member/editMT.cmd';
	
	form.submit();
}


function close()
{
	api.close();
}
  
</script>
</cms:SystemList>
</cms:CurrentSite>