<%@Page Language="C#" Inherits="IWMS.Admin.ArticleEdit" MasterPageFile="admin.master"%>
<%@Register TagPrefix="WbControls" Namespace="IWMS.Controls" Assembly="IWMS_Controls" %>
<asp:Content ContentPlaceHolderId="cphHead" runat="server">
	<!--#include file="inc/admin_articleadd.inc" -->
	<!--#include file="inc/tiny_mce.inc" -->
	<script type="text/javascript" src="inc/html_preview.js"></script>
	<script type="text/javascript">
		iwms.fixNews="<%=fixNews.ClientID%>";
	</script>
	<script type="text/javascript" src="inc/gb_big5.js"></script>
	<%RegisterOnSubmitStatement("dopost","dopost.show();");%>
</asp:Content>

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

	<form id="myForm" runat="server">
	
	<div class="mframe">
	<div class="tl"></div>
	<div class="rt"></div>
	<div class="tm">
		<span class="tt">修改新闻</span>
	</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"/>
		<asp:ValidationSummary 
			 DisplayMode="BulletList" 
			 EnableClientScript="true"
			 ShowSummary="false"
			 ShowMessageBox="true"                        
			 HeaderText="请正确填写以下内容"
			 runat="server"/>
		<asp:Panel id="mainPanel" runat="server">
		 <table cellpadding="0" cellspacing="0" width="100%">
		  <tr> 
		   <td class="tdbg">
			<table align="center" width="95%" >
			<tr><th width="70">
				新闻分类：
			</th><td>
				<input type="hidden" id="ClassID"
					runat="server"/>
				<a href="###" onclick="icmenu.pop(this,'<%=ClassID.ClientID%>',0)" class="clink"><asp:Literal id="ClassName" Text="请选择分类" runat="server"/></a>
			</td></tr>
			<tr><th>
				新闻标题：
			</th><td>
				<asp:TextBox id="nTitle"
					MaxLength="100"
					size="75"
					runat="server"/>
				<asp:RequiredFieldValidator
					ControlToValidate="nTitle"
					ErrorMessage="新闻标题必须填写"
					Display="None"
					runat="server"/>
				<asp:CheckBox id="remarkLink" Text="评论链接" runat="server"/>
			</td></tr>
			<tr><th>
				新闻属性：
			</th><td>
				<asp:CheckBox id="HighLight" Text="标题醒目" runat="server"/>&nbsp;
				<asp:CheckBox id="allowRemark" Text="可以评论" runat="server"/>&nbsp;
	
				<%if (CurUser.HavePower("setTop")){%>
				<a href="javascript:OpenFix();" class="fLink">头条与固顶</a>
				<%}%>
				<input type="hidden" id="fixNews" runat="server"/>
	
				<a href="javascript:OpenPoll();" class="fLink">选择调查</a>
				<input type="hidden" id="pollIds" value="" runat="server"/>
			</td></tr>
			<tr><th>
				标题图片：
			</th><td>
				<asp:TextBox id="TitleImg"
					MaxLength="200"
					size="30"
					runat="server"/>
				<span onmouseover="DispTitleImg(true);" onmouseout="DispTitleImg(false);" style="background:#eee;color:ddd;padding:0 5px">预览</span>
				<a href="javascript:OpenUpload(true);" style="text-decoration:underline">上传</a>
				<span class="explain">填写此项成为图片新闻，可以为图片或flash</span><br/>
				<span id="ylTitleImg" style="position:absolute;background:#eed;padding:3px;border:1px solid #993;overflow:auto;display:none"></span>
				<input type="hidden" id="Upload" runat="server"/>
			</td></tr>
			<tr><th>
				所属专题：
			</th><td>
				<asp:TextBox id="Topic" size="25" runat="server"/>
				<input type="hidden" id="TopicID" value="0" runat="server"/>
				<a href="javascript:OpenTopic();" class="fLink">选择专题</a>
				&nbsp; <a href="###" onclick="document.getElementById('<%=Topic.ClientID%>').value='';document.getElementById('<%=TopicID.ClientID%>').value=0" class="fLink">无专题</a>
				&nbsp; <a href="admin_topicAdd.aspx" class="fLink">添加专题</a>
			</td></tr>
			<tr><th>
				外部链接：
			</th><td>
				<asp:TextBox id="Url"
					MaxLength="200"
					size=30
					runat="server"/>
				<a href="javascript:LinkOut(document.getElementById('<%=Url.ClientID%>').value)">访问</a>&nbsp;
			</td></tr>
			<tr><th>
				分页标题：
			</th><td>
				<asp:TextBox id="pageTitle" size="25" runat="server"/>
				第<asp:Literal id="pageIndex" text="1" runat="server"/>页
				<asp:Button id="pagePrev" text="上一页" onClick="pagePrev_OnClick" runat="server"/>
				<asp:DropDownList id="pageJump" OnSelectedIndexChanged="pageJump_OnChange" AutoPostBack="True" runat="server"/>
				<asp:Button id="pageNext" text="下一页" onClick="pageNext_OnClick" runat="server"/>
				<asp:Button id="pageInsert" text="插入页" onClick="pageInsert_OnClick" runat="server"/>
				<asp:Button id="pageRemove" text="删除页" onClick="pageRemove_OnClick" runat="server"/>
				<asp:Button id="pageClear" text="清除" onClick="pageClear_OnClick" runat="server"/>
			</td></tr>
			<tr><th valign="top">
				新闻内容：
				
				<div class="vTxt">
				<ul><li>
				<asp:CheckBox id="imgWithMark" Text="图片加水印" title="自动下载的图片是否加水印" runat="server"/>
				</li>
				<li>
				<asp:CheckBox id="downImg" Text="下载站外图片" title="是否程序自动下载其它网站图片" runat="server"/>
				</li>
				<li>
				<asp:CheckBox id="autoTitleImg" Text="生成标题图片" Checked="true" title="自动取新闻内图片生成标题图片" runat="server"/>
				</li></ul>
				</div>
			</th><td>
				<asp:TextBox id="Body" TextMode="multiline" CssClass="mceContent" runat="server" />
			</td></tr>
			<tr><th valign="top">
				新闻简介：
			</th><td>
				&nbsp; <a href="###" onclick="iwms.setSummary()">↓↓从内容中截取简介↓↓</a><span style="margin-left:240px"></span><a href="###" onclick="OpenUpload()">↑↑上传附件及加强图片上传</a>
			</td></tr>
			<tr>
			<td></td>
			<td>
				<asp:TextBox id="Summary" TextMode="multiline" CssClass="mceSummary" runat="server"/>
				<asp:CustomValidator
					ControlToValidate="Summary"
					ClientValidationFunction="ClientValidate"
					OnServerValidate="Summary_validation"
					ErrorMessage="简介最多2000字"
					Display="None"
					runat="server" />
				<script type="text/javascript">
				<!--
				function ClientValidate(source, arguments)
				{
					if (arguments.Value.length>2000)
						arguments.IsValid=false;
					else
						arguments.IsValid=true;
				}
				-->
				</script>
			</td></tr>
			<tr><th>
				相关标签：
			</th><td>
				<asp:TextBox id="Key"
					MaxLength="50"
					size="30"
					runat="server"/>
				<a href="javascript:OpenKey();" class="fLink">选择标签</a>
				<span class="explain">多个标签用“,”分隔</span>
			</td></tr>
			<tr><th>
				　　作者：
			</th><td>
				<div style="width:320px;float:left">
				<asp:TextBox id="Author"
					MaxLength="50"
					size="30"
					runat="server"/>
				<script type="text/javascript">
				function setAuthor(str)
				{
					var obj=document.<%=myForm.ClientID%>.<%=Author.ClientID%>;
					obj.value=str;
				}
				</script>
				<select onchange="javascript:setAuthor(this.value);">
				<option value="">&larr;</option>
				<option value="<%=CurUser.Name%>"><%=CurUser.Name%></option>
				<option value="未知">未知</option>
				<option value="佚名">佚名</option>
				</select>
				</div>
				信箱：
				<asp:TextBox id="AuthorEmail"
					MaxLength="100"
					size="30"
					runat="server"/>
			</td></tr>
			<tr><th>
				　　来源：
			</th><td>
				<div style="width:320px;float:left">
				<asp:TextBox id="Source"
					MaxLength="50"
					size="30"
					runat="server"/>
				</div>
				网址：
				<asp:TextBox id="SourceUrl"
					MaxLength="255"
					size="30"
					runat="server"/>
			</td></tr>
			<tr><th>
				新闻日期：
			</th><td>
				<div style="width:320px;float:left">
				<asp:TextBox id="addDate"
					MaxLength="19"
					size="19"
					runat="server"/>
				<asp:RequiredFieldValidator
					ControlToValidate="addDate"
					ErrorMessage="新闻日期必须填写"
					Display="None"
					runat="server"/>
				<asp:RegularExpressionValidator
					ControlToValidate="addDate"
					ValidationExpression="\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}"
					ErrorMessage="新闻日期格式错误"
					Display="None"
					runat="server"/>
				<a href="javascript:SetDate(new Date());">现在</a>
				<script type="text/javascript">
				function SetDate(d)
				{
					var o = document.getElementById("<%=addDate.ClientID%>");
					o.value = ""+ (d.getYear().toString().length==4 ? d.getYear() : (d.getYear()<74 ? 2000+d.getYear() : 1900+d.getYear()) ) +"-"+ GetNum(d.getMonth()+1) +"-"+ GetNum(d.getDate()) +" "+ GetNum(d.getHours()) +":"+ GetNum(d.getMinutes()) +":"+ GetNum(d.getSeconds());
					function GetNum(n)
					{
						// 一位转两位
						if (n<10){
							return "0"+n;
						}else{
							return n.toString();
						}
					}
				}
				</script>
				
				<asp:CheckBox id="passed"
					Text="审核通过"
					Visible="false"
					runat="server"/>
				</div>
				责编：
				<asp:TextBox id="editor"
					MaxLength="100"
					size="30"
					runat="server"/>
			</td></tr>
			<%if (config.MakeStatic){%>
			<tr><th>
				静态页面：
			</th><td>
				<% if (config.HomeStatic) {%>
				<asp:CheckBox id="staticDefault" checked="false" Text="重新生成首页" runat="server"/>
				<%}%>
				<asp:CheckBox id="staticSort" checked="false" Text="重新生成分类页" runat="server"/>
				<asp:CheckBox id="staticTopic" checked="false" Text="重新生成专题页" runat="server"/>
			</td></tr>
			<%}%>
	
			<tr><td colspan="2" class="tdbg-dark" height="5"></td></tr>
			<tr><th>
				阅读限制：
			</th><td>
				会员需消费
				<asp:TextBox id="price"
					MaxLength="20"
					size="5"
					Style="text-align:right"
					runat="server"/>
				<asp:RequiredFieldValidator
					ControlToValidate="price"
					ErrorMessage="阅读消费数必填"
					Display="None"
					runat="server"/>
				<asp:RegularExpressionValidator
					ControlToValidate="price"
					ValidationExpression="\d+"
					ErrorMessage="阅读消费数只能是数字"
					Display="None"
					runat="server"/>
				<%=lang["vMoney"]%>
				或 积分大于
				<asp:TextBox id="markLimit"
					MaxLength="20"
					size="5"
					Style="text-align:right"
					runat="server"/>
				<asp:RequiredFieldValidator
					ControlToValidate="markLimit"
					ErrorMessage="阅读积分限制必填"
					Display="None"
					runat="server"/>
				<asp:RegularExpressionValidator
					ControlToValidate="markLimit"
					ValidationExpression="\d+"
					ErrorMessage="阅读积分限制只能是数字"
					Display="None"
					runat="server"/>
				 才能阅读
			</td></tr>
			<%if (IWMS.Model.ConfigInfo.Enterprise){%>
			<tr><th>
				签收会员：
			</th><td>
				<asp:TextBox id="signIn"
					size="60"
					title="iwms企业版功能"
					runat="server"/>
				<asp:RegularExpressionValidator
					ControlToValidate="signIn"
					ValidationExpression="[^,]+(,[^,]+)*"
					ErrorMessage="签收会员格式错误"
					Display="None"
					runat="server"/>
					<span class="explain">多个会员名请用“,”分隔</span>
			</td></tr>
			<%}%>
			<tr><td colspan="2">
				有阅读权限的会员组：
				<input type="checkbox" id="check_groups" onclick="checkAll(document.getElementById('<%=PermitGroups.ClientID%>'),this.checked);"/><label for="check_groups">全选</label> <span class="explain">一个都不选择则所有人可阅读</span>
				<asp:CheckBoxList ID="PermitGroups" runat="server"
				   	Width="90%"
				   	RepeatDirection="Horizontal"
				   	RepeatColumns="5"
				   	CellPadding="1"
				   	RepeatLayout="Table"
				   	CssClass="bg2"
				   	/>
			</td></tr>
			<tr><td>
				　添加者：
			</td><td>
				<asp:Label ID="Username" runat="server" />
			</td></tr>
			<tr><td colspan="2" class="tdbg-dark" height="5"></td></tr>
			<tr><td colspan="2">
				<asp:Button id="Submit" text=" 修 改 " onclick="Submit_OnClick" runat="server"/>
				&nbsp; <a href="javascript:s2t();">简&rarr;繁</a>&nbsp; <a href="javascript:t2s();">繁&rarr;简</a>
			</td></tr>
			</table>
		   </td>
		  </tr>
		 </table>
		 
		</asp:Panel>
	
	</div>
	</div>
	<div class="bl"></div>
	<div class="br"></div>
	<div class="bm"></div>
	</div>
	</form>

</asp:Content>