<%@ page language="C#" autoeventwireup="true" inherits="admin_manage_templetitem, localhost_deploy" %>
<%@ Register Src='../../common/formitem.ascx' TagName='formitem' TagPrefix='uc1' %>
<!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 runat='server'>
<title>模板编辑页</title>
<link href='/admin/common/client.css' rel='stylesheet' type='text/css' />
</head>
<body>
<br />
<%
	Formitem.Table="User_Template";
	Formitem.Head="模板信息";
	Formitem.Action="";
	Formitem.AddOther("@@Csharp.SetInputHidden('T_ID','##Table[\"User_Template\"].T_ID##')@@");//旧的地址
	Formitem.AddItem("@@Csharp.SetInputText('模板名称','T_Name','##Table[\"User_Template\"].T_Name##','40','true','')@@");
	Formitem.AddItem("@@Csharp.SetInputText('模板文件','T_Path','##Table[\"User_Template\"].T_Path##','40','true','<br />默认起始路径为：/template/html/')@@");
	Formitem.AddItem("@@Csharp.SetInputSelect('模板类型','T_Type','0,分类模板|1,内容模板|2,内容内部模板','##Table[\"User_Template\"].T_Type##','false','')@@");
	Formitem.AddItem("@@Csharp.SetInputMultiSelect('屏蔽字段','T_Disabled','"+GetField(Formitem["T_Disabled"])+"','5','##Table[\"User_Template\"].T_Disabled##','false','<br />##Const.Button(\"增加\",\"AddItem()\")## ##Const.Button(\"删除\",\"DelItem()\")##')@@"); 
	
%>	
<uc1:formitem ID='Formitem' runat='server' />
<!--#include file="../../common/popwindow.inc" -->
<script language="javascript">
$('T_Type').onchange=function()
{
	ShowDisabled();
}

ShowDisabled();

function checkOther()
{
	SetSelectValue('T_Disabled');
	
	top.o_pageTemplate=new Array();//页面模板清空
	return false;
}

function ShowDisabled()
{
	switch($('T_Type').value)
	{
		case "1":
		case "11":
		{
		
			$('T_Disabled').parentNode.parentNode.style.display="";
			break;
		}
		default:
		{
			$('T_Disabled').parentNode.parentNode.style.display="none";
			break;
		}
	}
	
}

//插入数据
function SetItem(o_con)
{
	for(var o in o_con)
  {
  	if(o_con[o]!=null)
    	$('T_Disabled').options[$('T_Disabled').length] = new Option(o_con[o].name, o);
  }
}

function AddItem()
{
	var s_tid="0";
	if($('T_Type').value=="1")
		s_tid="2";
	
	var s_idlst="0";
	for(i=0;i<$('T_Disabled').options.length;i++)
	{
		s_idlst+=","+$('T_Disabled').options[i].value;
	}
	
	popup_open("selectfield.aspx?tid="+s_tid+"&idlst="+escape(s_idlst),"选择需要屏蔽的字段",350,330);
	
}

function DelItem()
{
	DelSelectItem($('T_Disabled'));
}

function DoReturn()
{
	window.open('/admin/manage/templetlist.aspx?type='+$('T_Type').value,'_self');
	return 0;
}
</script>
</body>
</html>   
