<%@ page language="C#" autoeventwireup="true" inherits="Agent_AgentAdmin_AgentNews_Operate, GroupTGWeb_deploy" %>

<%@ Register Src="UserControl/MessageShow.ascx" TagName="MessageShow" TagPrefix="uc1" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<!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 id="Head1" runat="server">
    <title>【文章添加】</title>
    <link rel="stylesheet" type="text/css" href="style/index.css" />
    <link href="style/index.css" rel="stylesheet" type="text/css" />
    <link type="text/css" rel="Stylesheet" href="css/index.css" />
    <meta http-equiv="x-ua-compatible" content="ie=7" />

    <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>

    <script type="text/javascript" language="javascript" src="../js/CommonJS.js"></script>

    <script type="text/javascript">
    //选择单图
    function openSingleChild()
    { 
        var k = window.showModalDialog("Image_List_Select.aspx",window,"dialogWidth:820px;status:no;dialogHeight:650px"); 
           if(k != null) 
        {
          var strLen=k.length;
          var lastIndex=k.lastIndexOf('/');
           var editor = FCKeditorAPI.GetInstance('FCKeditorContent'); 
           {
             editor.InsertHtml("<img src='/" + k + "'>");
           }
        }      
   
    }    
     //选择标题图
    function openTitelImage()
    { 
        var k = window.showModalDialog("Image_List_Select.aspx",window,"dialogWidth:820px;status:no;dialogHeight:650px"); 
        if(k != null) 
        {       
                var imgvalue = new Array();
                imgvalue = k.split(",");
                document.getElementById("TextBoxTitleImage").value = imgvalue[0]; 
                document.getElementById("ImageOriginalImge").src = imgvalue[1]; 
        }
    }    
    //附件
    function openSingleAttachMent()
    {
        var k = window.showModalDialog("AttachMent_List_Select.aspx",window,"dialogWidth:820px;status:no;dialogHeight:650px"); 
        if(k != null) 
        {
            var oEditor = FCKeditorAPI.GetInstance("FCKeditorContent"); 
            var content = oEditor.GetXHTML(true);
            var strs = new Array();
            strs = k.split(",");
            oEditor.SetHTML(content + "<a href='"+ strs[0] +"'>"+ strs[1] +"</a>");
        }
    }
    </script>

</head>
<body style="padding: 0; background-image: url(images/Bg_right.gif); background-repeat: repeat;
    font-size: 12px">
    <form id="form1" runat="server">
    <div class="main">
        <div class="table1">
            <div class="navigator">
                <asp:Label ID="LabelTitle" runat="server" Text="【文章添加】"></asp:Label>
            </div>
            <div class="content">
                <table width="100%" cellpadding="0" cellspacing="1">
                    <tr>
                        <td style="text-align: right; width: 120px;">
                            <asp:Localize ID="LocalizeTitle" runat="server" Text="文章标题："></asp:Localize>
                        </td>
                        <td>
                            <asp:TextBox ID="TextBoxTitle" runat="server" Width="150"></asp:TextBox>
                            <asp:Label ID="Label1" runat="server" Text="*" ForeColor="red"></asp:Label>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidatorTitle" runat="server" ControlToValidate="TextBoxTitle"
                                Display="Dynamic" ErrorMessage="该值不能为空"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidatorTitle" runat="server"
                                ControlToValidate="TextBoxTitle" Display="Dynamic" ErrorMessage="最多50个字符" ValidationExpression="^[\s\S]{0,50}$"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <%--<td style="text-align: right">
                            <asp:Localize ID="Localize2" runat="server" Text="标题图片："></asp:Localize>
                        </td>
                        <td>
                            <asp:TextBox ID="TextBoxTitleImage" runat="server" CssClass="allinput1"></asp:TextBox>
                            <input id="Button1" onclick="openTitelImage()"
                                class="bnt1" type="button" value="选择图片" />
                            <img id="ImageOriginalImge" runat="server" alt="" src="" width="100" height="100" />
                        </td>--%>
                    </tr>
                    <tr>
                        <td style="text-align: right">
                            <asp:Localize ID="LocalizeArticleCategory" runat="server" Text="所属分类："></asp:Localize>
                        </td>
                        <td>
                            <asp:DropDownList ID="DropDownListType" runat="server" Width="154">
                            </asp:DropDownList>
                            <asp:CompareValidator ID="CompareType" runat="server" ControlToValidate="DropDownListType"
                                Display="Dynamic" ErrorMessage="该值必需选择" Operator="NotEqual" ValueToCompare="-1"></asp:CompareValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">
                            <asp:Localize ID="LocalizeCityCode" runat="server" Text="城市："></asp:Localize>
                        </td>
                        <td>
                            <asp:DropDownList ID="DropDownListCityCode" runat="server" Width="154">
                            </asp:DropDownList>
                             <asp:CompareValidator ID="CompareDropDownListCityCode" runat="server" ControlToValidate="DropDownListCityCode"
                                                Display="Dynamic" ErrorMessage="该值必需选择" Operator="NotEqual" ValueToCompare="-1"></asp:CompareValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">
                            <asp:Localize ID="LocalizePublisher" runat="server" Text="作者/发布人："></asp:Localize>
                        </td>
                        <td>
                            <asp:TextBox ID="TextBoxPublisher" runat="server" Width="150"></asp:TextBox>
                            <asp:Label ID="Label2" runat="server" Text="*" ForeColor="red"></asp:Label>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidatorPublisher" runat="server" ControlToValidate="TextBoxPublisher"
                                Display="Dynamic" ErrorMessage="该值不能为空"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidatorPublisher" runat="server"
                                ControlToValidate="TextBoxPublisher" Display="Dynamic" ErrorMessage="最多50个字符"
                                ValidationExpression="^[\s\S]{0,50}$"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">
                            <asp:Localize ID="LocalizeSource" runat="server" Text="文章来源："></asp:Localize>
                        </td>
                        <td>
                            <asp:TextBox ID="TextBoxSource" runat="server" Width="150"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidatorSource" runat="server"
                                ControlToValidate="TextBoxSource" Display="Dynamic" ErrorMessage="最多150个字符" ValidationExpression="^[\s\S]{0,200}$"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">
                            <asp:Localize ID="LocalizeKeywords" runat="server" Text="关键字："></asp:Localize>
                        </td>
                        <td>
                            <asp:TextBox ID="TextBoxKeywords" runat="server" Width="150"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidatorKeywords" runat="server"
                                ControlToValidate="TextBoxKeywords" Display="Dynamic" ErrorMessage="最多200个字符"
                                ValidationExpression="^[\s\S]{0,200}$"></asp:RegularExpressionValidator>
                            多个关键字用空格隔开
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">
                            <asp:Localize ID="Localize6" runat="server" Text="文章描述："></asp:Localize>
                        </td>
                        <td>
                            <asp:TextBox ID="TextBoxDescription" runat="server" Width="150"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidatorDescription" runat="server"
                                ControlToValidate="TextBoxDescription" Display="Dynamic" ErrorMessage="分类关键字最多150个字符"
                                ValidationExpression="^[\s\S]{0,150}$"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">
                            <asp:Localize ID="LocalizeIsAllowComment" runat="server" Text="是否允许评论："></asp:Localize>
                        </td>
                        <td>
                            <asp:DropDownList ID="DropDownListIsAllowComment" runat="server" Width="154">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">
                            <asp:Localize ID="LocalizeOrderID" runat="server" Text="排序号："></asp:Localize>
                        </td>
                        <td>
                            <asp:TextBox ID="TextBoxOrderID" runat="server" Width="150"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidatorRepertoryOrderID" runat="server"
                                ControlToValidate="TextBoxOrderID" ErrorMessage="只能输入数字" ValidationExpression="^[0-9]*$"
                                Display="Dynamic"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">
                            <asp:Localize ID="Localize1" runat="server" Text="文章属性："></asp:Localize>
                        </td>
                        <td>
                            <asp:CheckBox ID="CheckBoxIsHot" runat="server" Text="热点" />
                            <asp:CheckBox ID="CheckBoxIsRecommend" runat="server" Text="推荐" />
                            <asp:CheckBox ID="CheckBoxIsHead" runat="server" Text="头条" />
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right; vertical-align: top;">
                            <asp:Localize ID="LocalizeSingleImage" runat="server" Text="文章内容："></asp:Localize>
                        </td>
                        <td>
                            <input id="ButtonSelectSingleImage" onclick="openSingleChild()" class="bt3" type="button"
                                value="插入图片" />
                            <!-- <input id="ButtonSelectAttachMent" onclick="openSingleAttachMent()" class="bnt1"
                                type="button" value="导入附件" />-->
                            <br />
                            <FCKeditorV2:FCKeditor ID="FCKeditorContent" runat="server" Height="300" Width="800">
                            </FCKeditorV2:FCKeditor>
                            <asp:Label ID="Label3" runat="server" Text="*" ForeColor="red"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;">
                            <asp:Localize ID="Localize5" runat="server" Text="是否前台显示："></asp:Localize>
                        </td>
                        <td>
                            <asp:CheckBox ID="CheckBoxIsShow" runat="server" Checked="True" Text="是" />
                        </td>
                    </tr>
                </table>
            </div>
            <div style="margin-left: 125px;">
                <asp:Button ID="ButtonConfirm" runat="server" Text="确定" CssClass="bt2" OnClick="ButtonConfirm_Click"
                    ToolTip="Submit" />
                <input id="Reset1" type="reset" value="重置" class="bt2" />
                <asp:Button ID="btnConfirm" runat="server" Text="返回列表" CssClass="bt3" PostBackUrl="Article_List.aspx"
                    CausesValidation="False" />
                <uc1:MessageShow ID="MessageShow" Visible="false" runat="server" />
                <br />
                <asp:HiddenField ID="hiddenFieldGuid" runat="server" Value="0" />
                <asp:HiddenField ID="HiddenFieldAgentLoginID" runat="server" />
            </div>
        </div>
    </div>
    </form>
</body>
</html>
