<%@ 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="../common/js/jquery-1.7.gzjs"></script>
			<script type="text/javascript" src="../javascript/commonUtil_src.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}")
         {
           
      		 	W.$.dialog(
			    { 
			   					title :'提示',
			    				width: '190px', 
			    				height: '60px', 
			                    lock: true, 
			                    parent:api,
			    				icon: '32X32/succ.png', 
			    				
			                    content: '编辑发布点成功!',
	
			    				ok: function()
			    				{
			    					W.location.reload();
			    				}
			   });
         }
            
      	</script>

	</head>
	<body>

		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td align="left" valign="top">
					<!--main start-->
					<div class="addtit">
						<img src="../style/icons/folder-network.png" width="16" height="16" />分发点
					</div>
					
					<cms:SystemGateway id="${param.id}">
					<form id="gatewayForm" name="gatewayForm" method="post">
						<table width="100%" border="0" cellpadding="0" cellspacing="0" class="form-table">


							<tr>
								<td width="26%" class="input-title">
									<strong>名称</strong>
								</td>
								<td  class="td-input">
									<input id="name" name="name" type="text" class="form-input" size="50" value="${Gateway.name}"/>
									<span class="red">*</span><span class="ps"></span>
								</td>
							</tr>


							<tr>
								<td class="input-title">
									<strong>FTP服务器</strong>
								</td>
								<td class="td-input">
									<select id="targetServerId" name="targetServerId">
										<option value="-1">
											----------------- 请选择分发服务器 -----------------
										</option>
										
										<cms:DispenseServer>
											<option value="${Server.serverId}">
												${Server.serverName}
											</option>
										</cms:DispenseServer>
										
									</select>
								</td>
							</tr>
							<tr>
								<td class="input-title">
									<strong>分发类型</strong>
								</td>
								<td class="td-input">
									<input type="radio" name="transfeType" value="1"  class="form-radio"  />
									html
									<input type="radio" name="transfeType" value="2"  class="form-radio" />
									图片
									<input type="radio" name="transfeType" value="3"  class="form-radio" />
									媒体
									<input type="radio" name="transfeType" value="4"  class="form-radio" />
									文件
									<input type="radio" name="transfeType" value="0" class="form-radio" />
									资源

								</td>
							</tr>


							<%--<tr id="pubSourceFolderTr" style="display:none">
								<td class="input-title">
									<strong>源内容目录</strong>
								</td>
								<td class="td-input">
									<input name="sourcePath" id="sourcePath" type="text" class="form-input" size="52" />
									<input type="button" value="浏览..." onclick="javascript:openSiteFileInfoList();" class="btn-1" />
								</td>
							</tr>

							--%>
							<tr>
								<td class="input-title">
									<strong>FTP存储根目录</strong>
								</td>
								<td class="td-input">
									<input name="targetServerRoot" id="targetServerRoot" type="text" class="form-input" size="50" value="${Gateway.targetServerRoot}"/>

								</td>
							</tr>

							<%--<tr id="trSeg">
								<td class="input-title">
									<strong>同步文件频率</strong>
								</td>
								<td class="td-input">
									每隔
									<input type="text" id="transferPeriod" name="transferPeriod" size=3 value="1" class="form-input" />
									<select id="transferPeriodType" name="transferPeriodType" class="form-select">
										<option value="1">
											秒 &nbsp;&nbsp;&nbsp;
										</option>
										<option value="2" selected>
											分钟 &nbsp;&nbsp;&nbsp;
										</option>
										<option value="3">
											小时&nbsp;&nbsp;&nbsp;
										</option>
										<option value="4">
											天&nbsp;&nbsp;&nbsp;
										</option>
									</select>
									传输到服务器
								</td>
							</tr>


							--%>
							<tr>
								<td class="input-title">
									<strong>工作状态</strong>
								</td>
								<td class="td-input">
									<input type="radio" name="useState" value="1"  />
									启用
									<input type="radio" name="useState" value="0" />
									停用
								</td>
							</tr>
						</table>
						
						<!-- hidden -->
						<input type="hidden" id="gatewayId" name="gatewayId" value="${Gateway.gatewayId}" />
						

					</form>
					<div style="height:15px"></div>
					<div class="breadnavTab"  >
						<table width="100%" border="0" cellspacing="0" cellpadding="0" >
							<tr class="btnbg100">
								<td width="74%" class="input-title"></td>
								<td  class="td-input">
									<a href="javascript:submitPublishGateway();"  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>
								 
							</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>  

initSelect('targetServerId','${Gateway.targetServerId}');
initRadio('transfeType','${Gateway.transfeType}');
initRadio('useState','${Gateway.useState}');

var api = frameElement.api, W = api.opener;

function submitPublishGateway(id)
{
	var form = document.getElementById("gatewayForm");
	
	form.action = '<cms:BasePath/>site/editPublishGateway.cmd';
	
	form.submit();
}


function close()
{
	api.close();
}
  
  
function displaySourceTr(flag)
{
	if('true' == flag)
	{
		document.getElementById('pubSourceFolderTr').style.display='';
	}
	else
	{
		document.getElementById('pubSourceFolderTr').style.display='none';
	}
}

function openSiteFileInfoList()
{
	W.$.dialog({ 
    	title :'选择站点目录',
    	width: '700px', 
    	height: '500px',
    	parent:api, 
    	lock: true, 
        max: false, 
        resize: false,
        
        
        content: 'url:<cms:Domain/>/core/deploy/ListSiteFileInfo.jsp'
	});
}
</script>
</cms:SystemGateway>
