<%@ Page Language="C#" Inherits="IWMS.Admin.ClassAdd" MasterPageFile="admin.master"%>
<asp:Content ContentPlaceHolderId="cphHead" runat="server">
	<!--#include file="inc/tiny_mce.inc" -->
	<script type="text/javascript" src="inc/html_preview.js"></script>
	<script type="text/javascript" src="inc/PinYin.js"></script>
	<script type="text/javascript">
	function nameChange(o)
	{
		var o_dir = document.getElementById("<%=sDir.ClientID%>");
		if(o.value.length>0){
			o_dir.value = PinYin.getString(o.value).replace(/\W/ig,"-");
		}else{
			o_dir.value = "";
		}
	}
	
	$(function(){
		spin.add([
			<%if(tab1.Visible){%>
			{input:'<%=addMark.ClientID%>',min:0},
			{input:'<%=addVMoney.ClientID%>',min:0}
			<%}else if(tab2.Visible){%>
			{input:'<%=pageSize.ClientID%>',min:1,max:500,readonly:1},
			{input:'<%=cBindNum.ClientID%>',min:1,max:500,readonly:1}
			<%}%>
		]);
	});
	</script>
</asp:Content>

<asp:Content ContentPlaceHolderId="cphMain" runat="server">

	<form id="myForm" runat="server">
		<asp:ValidationSummary 
			 DisplayMode="BulletList" 
			 EnableClientScript="true"
			 ShowSummary="false"
			 ShowMessageBox="true"                        
			 HeaderText="请正确填写以下内容"
			 runat="server"/>
	
	
	<div class="mframe">
	<div style="float:right"><a href="http://www.iwms.net/help/" target="_blank"><img src="pic/admin_help.gif" alt="帮助" width="46" height="16"/></a></div>
	<div class="tabs" style="width:86%;">
		<asp:LinkButton CommandName="show" CommandArgument="1" OnCommand="tab_Command" CausesValidation="false" runat="server" id="link1" Text="内容分类"/>
		<asp:LinkButton CommandName="show" CommandArgument="2" OnCommand="tab_Command" CausesValidation="false" runat="server" id="link2" Text="显示信息"/>
		<asp:LinkButton CommandName="show" CommandArgument="3" OnCommand="tab_Command" CausesValidation="false" runat="server" id="link3" Text="广告信息"/>
	</div>
	<div class="wrapper">
	<div class="ml"></div>
	<div class="mr"></div>
	<div class="mm">
		<asp:Label id="myLabel" class="msgBar" EnableViewState="false" runat="server"/>
		<table cellpadding="3" cellspacing="0" width="100%" align="center">
		<asp:PlaceHolder id="tab1" runat="server">
		  <tr> 
		   <th width="150">
			分类名： 
		</th><td>
			<asp:DropDownList id="stype"
				AutoPostBack="true"
				OnSelectedIndexChanged="stype_changed"
				runat="server">
				<asp:ListItem value="0" Selected="true">文章</asp:ListItem>
				<asp:ListItem value="1">下载</asp:ListItem>
			</asp:DropDownList>&nbsp;
			<asp:TextBox Columns="20" MaxLength="50" id="className" runat="server"/>
			<asp:RequiredFieldValidator
				ControlToValidate="className"
				ErrorMessage="分类名必须填写"
				Display="None"
				runat="server"/>
			<asp:RegularExpressionValidator
				runat="server"
				ControlToValidate="ClassName"
				ValidationExpression="[^']+"
				ErrorMessage="分类名不能有'字符"
				Display="None" />
			<div class="gray"><span class="explain">下载类型须在"显示信息"里设置列表方式为"自定义列表",模板选择软件模板</span></div>
		</td></tr>
		<tr><th>
			父级分类：
		</th><td>
			<asp:DropDownList id="parentID" runat="server" />
		</td></tr>
		<tr><th>
			静态文件目录：
		</th><td>
			<asp:TextBox id="sDir" size="30" maxLength="50" runat="server" />
			<asp:RequiredFieldValidator
				ControlToValidate="sDir"
				ErrorMessage="静态目录必须填写"
				Display="None"
				runat="server"/>
			<asp:RegularExpressionValidator
				runat="server"
				ControlToValidate="sDir"
				ValidationExpression="(([a-z0-9A-Z][\w_\-]*[a-z0-9A-Z]|\w+)/?)+"
				ErrorMessage="静态文件目录只能由字母数字_-/构成"
				Display="None" />
			<span class="explain">建议采用英文或拼音</span>
		</td></tr>
		<tr><th>
			分类生成静态页数：
		</th><td>
			<asp:TextBox id="staticPages" size="5" Text="0" maxLength="5" runat="server"/>
			<asp:RequiredFieldValidator
				ControlToValidate="staticPages"
				ErrorMessage="分类生成静态页数必须填写"
				Display="None"
				runat="server"/>
			<asp:RegularExpressionValidator
				runat="server"
				ControlToValidate="staticPages"
				ValidationExpression="\d+"
				ErrorMessage="分类生成静态页数只能为数字"
				Display="None" />
			 <span class="explain">为0则所有分类页生成，分类页过多时可只生成最新部分</span>
		</td></tr>
		<tr><th>
			站外链接：
		</th><td>
			<asp:TextBox id="cUrl" size="30" maxLength="200" runat="server" /> <span class="explain">设置后访问分类将转到该地址</span>
		</td></tr>
		<tr><th>
			RssFeed地址：
		</th><td>
			<asp:TextBox id="rssFeed" size="30" maxLength="200" runat="server" /><br/>
			 <span class="explain">设置此项后将不能添加新闻，显示新闻为rss订阅内容</span>
		</td></tr>
		<tr><th>
			分类meta描述：
		</th><td>
			<asp:TextBox id="metaDescription" size="50" maxLength="255" runat="server" />
			<asp:CheckBox id="metaDescriptionHeredity" Text="传递给下级分类" runat="server"/>
		</td></tr>
		<tr><th>
			分类meta关键字：
		</th><td>
			<asp:TextBox id="metaKeyword" size="50" maxLength="255" runat="server" />
			<asp:CheckBox id="metaKeywordHeredity" Text="传递给下级分类" runat="server"/>
		</td></tr>
		<tr><th>
			会员添加新闻增加积分：
		</th><td>
			<asp:TextBox id="addMark"
				maxlength="3"
				size="3"
				Text="0"
				Style="text-align:right"
				runat="server"/>
			<asp:CheckBox id="addMarkHeredity" Text="传递给下级分类" runat="server"/>
			<asp:RequiredFieldValidator
				ControlToValidate="addMark"
				ErrorMessage="会员添加新闻增加积分必须指定"
				Display="None"
				runat="server"/>
			<asp:RegularExpressionValidator
				ControlToValidate="addMark"
				ValidationExpression="\d{1,3}"
				ErrorMessage="会员添加新闻增加积分只能为数字"
				Display="None"
				runat="server"/>
		</td></tr>
		<tr><th>
			会员添加新闻增加<%=lang["vMoney"]%>数：
		</th><td>
			<asp:TextBox id="addVMoney"
				maxlength="3"
				size="3"
				Text="0"
				Style="text-align:right"
				runat="server"/>
			<asp:CheckBox id="addVMoneyHeredity" Text="传递给下级分类" runat="server"/>
			<asp:RequiredFieldValidator
				ControlToValidate="addVMoney"
				ErrorMessage="会员添加新闻增加v币必须指定"
				Display="None"
				runat="server"/>
			<asp:RegularExpressionValidator
				ControlToValidate="addVMoney"
				ValidationExpression="\d{1,3}"
				ErrorMessage="会员添加新闻增加v币只能为数字"
				Display="None"
				runat="server"/>
		</td></tr>
		<tr><th>
			可查看新闻会员组：
		</th><td>
			<asp:CheckBoxList id="allowGroups"
				RepeatDirection="Horizontal"
				RepeatColumns="5"
				runat="server" />
		</td></tr>
		<tr><td colspan="2">
			<table width="100%">
			<tr class="trSplit"><td>
				<asp:CheckBox id="newWin" Text="新窗口打开" runat="server" />
			</td><td>
				<asp:CheckBox id="canAdd" Text="可以添加新闻" Checked="true" runat="server" />
			</td><td>
				<asp:CheckBox id="cInBar" Text="显示在顶部分类栏" Checked="true" runat="server" />
			</td></tr>
			<tr><td>
				<asp:CheckBox id="cInNav" Text="显示在底部导航栏" Checked="true" runat="server" />
			</td><td>
				<asp:CheckBox id="cInLeft" Text="显示在侧边导航" Checked="true" runat="server" />
			</td></tr>
			</table>
		</td></tr>
		<tr class="trSplit"><td colspan="2">
			&nbsp;
		</td></tr>
		<tr><th valign="top">
		<asp:DropDownList id="ipLimit" runat="server">
			<asp:ListItem>不可访问</asp:ListItem>
			<asp:ListItem>可以访问</asp:ListItem>
		</asp:DropDownList>
		网站IP：<br/><br/><span class="explain">不设置则所有ip可访问</span>
		</th>
		<td>
			<table width="90%"><tr valign="top"><td>
				<asp:TextBox id="ipLimited" TextMode="MultiLine" Columns="20" Rows="4" runat="server"/>
			</td><td>
				<asp:CheckBox id="ipLimitedHeredity" Text="传递给下级分类" runat="server"/><br/>
				<span class="explain">格式如：61.188.10.*或61.188.*，每行一条。生成静态页面将不限制。</span>
			</td></tr>
			</table>
		</td></tr>
		</asp:PlaceHolder>
		
		
		<asp:PlaceHolder id="tab2" runat="server">
		<tr><th width="180">
			链接颜色：
		</th><td>
			<asp:TextBox id="color" size="10" maxLength="10" runat="server" />
		</td></tr>
		<tr><th>
			每页显示新闻数：
		</th><td>
			<asp:TextBox id="pageSize"
				maxlength="3"
				size="3"
				Style="text-align:right"
				runat="server"/>
			<asp:CheckBox id="pageSizeHeredity" Text="传递给下级分类" runat="server"/>
			<asp:RequiredFieldValidator
				ControlToValidate="pageSize"
				ErrorMessage="每页新闻数必须指定"
				Display="None"
				runat="server"/>
			<asp:RegularExpressionValidator
				ControlToValidate="pageSize"
				ValidationExpression="\d{1,3}"
				ErrorMessage="每页新闻数只能为数字"
				Display="None"
				runat="server"/>
		</td></tr>
		<tr><th>
			网站风格样式：
		</th><td>
			<asp:DropDownList id="styleID" runat="server" />
			<a href="#" onclick="previewStyle()">预览</a>
			<asp:CheckBox id="styleIdHeredity" Text="传递给下级分类" runat="server"/>
			<script type="text/javascript">
				function previewStyle(){
					var sid=$("#<%=styleID.ClientID%>").val();
					window.open("default.aspx?styleid="+sid);
				}
			</script>
		</td></tr>
		<tr><th>
			分类模板：
		</th><td>
			<asp:DropDownList id="cTempID" runat="server" />
			<asp:CheckBox id="cTempIdHeredity" Text="传递给下级分类" runat="server"/>
		</td></tr>
		<tr><th>
			新闻模板：
		</th><td>
			<asp:DropDownList id="newsTempID" runat="server" />
			<asp:CheckBox id="newsTempIdHeredity" Text="传递给下级分类" runat="server"/>
		</td></tr>
		<tr class="trSplit"><th>
			顶部导航分类样式表class：
		</th><td>
			<asp:TextBox id="cssInBar" size="30" runat="server" />
		</td></tr>
		<tr><th>
			分类栏目名图片：
		</th><td>
			<asp:TextBox id="picFrame" size="30" runat="server" />
		</td></tr>
		<tr><th>
			分类栏目样式表class：
		</th><td>
			<asp:TextBox id="cssFrame" size="30" runat="server" />
		</td></tr>
		<tr class="trSplit"><th valign="top">
			网站logo：<br/>
			<asp:CheckBox id="logoHeredity" Text="传递给下级分类" runat="server"/>
		</th><td>
			<asp:TextBox id="logo" TextMode="multiline" CssClass="mceEditor" runat="server"/>
		</td></tr>
		<tr class="trSplit"><th valign="top">
			头条简介：<br/>
			<span class="explain">模板中有头条函数时有效</span>
		</th><td>
			<asp:TextBox id="headlineSummary" TextMode="multiline" CssClass="mceEditor" runat="server"/>
		</td></tr>
		<tr class="trSplit"><th>
			下级分类新闻显示数：
		</th><td>
			<asp:TextBox id="cBindNum"
				maxlength="2"
				size="3"
				Text="8"
				Style="text-align:right"
				runat="server"/>
			<asp:RequiredFieldValidator
				ControlToValidate="cBindNum"
				ErrorMessage="下级新闻数必须指定"
				Display="None"
				runat="server"/>
			<asp:RegularExpressionValidator
				ControlToValidate="cBindNum"
				ValidationExpression="\d{1,2}"
				ErrorMessage="下级新闻数只能为数字"
				Display="None"
				runat="server"/>
		</td></tr>
		<tr><th valign="top">
			显示分类栏目：<br/><br/><span class="explain">左侧为选中分类</span><br/><br/><span class="explain">使用显示下级分类栏目模板时有效</span>
		</th>
		<td>
			<input type="hidden" id="bindSorts" runat="server"/>
			<div>
				<div id="bCon1" style="width:200px;height:160px;overflow-y:scroll;float:left;background:#F7F7FF"></div>
				<div style="width:30px;float:left;height:160px;"></div>
				<div id="bCon2" style="margin-left:20px;width:200px;height:160px;overflow-y:scroll;background:#F7FFF7"></div>
			</div>
			<script type="text/javascript" src="inc/admin_sort.js"></script>
			<script type="text/javascript">
			var s_a=<asp:Literal id="ltBindSorts" runat="server"/>
			initBindSort("<%=bindSorts.ClientID%>");
			</script>
		</td></tr>
		</asp:PlaceHolder>
		
		<asp:PlaceHolder id="tab3" runat="server">
		<tr><th valign="top" width="150">
			新闻内广告：<br/>
			<asp:CheckBox id="newsAdHeredity" Text="传递给下级分类" runat="server"/>
		</th><td>
			<asp:TextBox id="newsAd" TextMode="multiline" CssClass="mceEditor" runat="server"/>
		</td></tr>
		<tr><th valign="top">
			网站顶部广告：<br/>
			<asp:CheckBox id="headAdHeredity" Text="传递给下级分类" runat="server"/>
		</th><td>
			<asp:TextBox id="headAd" TextMode="multiline" CssClass="mceEditor" runat="server"/>
		</td></tr>
		<tr><th valign="top">
			分类侧栏广告：<br/>
			<asp:CheckBox id="sideAdHeredity" Text="传递给下级分类" runat="server"/>
		</th><td>
			<asp:TextBox id="sideAd" TextMode="multiline" CssClass="mceEditor" runat="server"/>
		</td></tr>
		<tr><th valign="top">
			分类页新闻列表前广告：<br/>
			<asp:CheckBox id="topAdHeredity" Text="传递给下级分类" runat="server"/>
		</th><td>
			<asp:TextBox id="topAd" TextMode="multiline" CssClass="mceEditor" runat="server"/>
		</td></tr>
		<tr><th valign="top">
			分类页新闻列表后广告：<br/>
			<asp:CheckBox id="footAdHeredity" Text="传递给下级分类" runat="server"/>
		</th><td>
			<asp:TextBox id="footAd" TextMode="multiline" CssClass="mceEditor" runat="server"/>
		</td></tr>
		<tr><th valign="top">
			新闻页侧栏广告：<br/>
			<asp:CheckBox id="newsSideAdHeredity" Text="传递给下级分类" runat="server"/>
		</th><td>
			<asp:TextBox id="newsSideAd" TextMode="multiline" CssClass="mceEditor" runat="server"/>
		</td></tr>
		<tr><th valign="top">
			新闻页新闻内容前广告：<br/>
			<asp:CheckBox id="newsTopAdHeredity" Text="传递给下级分类" runat="server"/>
		</th><td>
			<asp:TextBox id="newsTopAd" TextMode="multiline" CssClass="mceEditor" runat="server"/>
		</td></tr>
		<tr><th valign="top">
			新闻页新闻内容后广告：<br/>
			<asp:CheckBox id="newsFootAdHeredity" Text="传递给下级分类" runat="server"/>
		</th><td>
			<asp:TextBox id="newsFootAd" TextMode="multiline" CssClass="mceEditor" runat="server"/>
		</td></tr>
		</asp:PlaceHolder>
		
		<tr><td colspan="2" align="center">	
		   <asp:Button id="Submit" text="添 加" onclick="Submit_OnClick" runat="server"/>
		   </td>
		  </tr>
		 </table>
		
	</div>
	</div>
	<div class="bl"></div>
	<div class="br"></div>
	<div class="bm"></div>
	</div>
	
	</form>

</asp:Content>