<%@ Page Language="c#" Inherits="TopWinCMS.WebUI.Admin.Admin_Article_Add" ValidateRequest="false"
    CodeBehind="Article_Add.aspx.cs" %>
<%@ Register TagPrefix="ce" Namespace="CuteEditor" Assembly="CuteEditor" %>
<%@ Register TagPrefix="cc1" Namespace="TopWinCMS.WebControls" Assembly="TopWinCMS.WebControls" %>
<%@ Register Src="../UC_AjaxLoading.ascx" TagName="UC_AjaxLoading" 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>
        <%= AutoTitle() %></title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <meta content="no-cache" http-equiv="Pragma" />

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

    <link href="../Style.css" rel="stylesheet" type="text/css" />

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

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

    <style type="text/css">
        .RowStyle
        {
            width: 100px;
            font-weight: bold;
            text-align: right;
        }
        #B, #C, #D, #E, #F
        {
            display: none;
        }
    </style>

    <script language="javascript" type="text/javascript"> 
     function GetTag()
     {
        var str = window.showModalDialog("../window/GetTag.aspx?ModelID=<%=Request["ModelID"] %>", "up","dialogWidth=460px;dialogHeight=440px;status=0;scroll=no");
         
        if(typeof(str)!="undefined")
        {
            if($('TB_Key').value =="")
                $('TB_Key').value = str + "|";
            else
                $('TB_Key').value = $('TB_Key').value + str + "|";
        }
     }
    function killerrors() 
    { 
        return true; 
    } 
    window.onerror = killerrors; 
   
    </script>

</head>
<body>
    <form id="Form1" method="post" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div id="tabs">
        <ul>
            <li id="current" onclick="return HideAndDisplay(0,this);"><a href="#"><span>常规属性</span></a></li>
            <% 
                if (tr_PicUrl.Visible == true)
                {
            %>
            <li onclick="return HideAndDisplay(1,this);"><a href="#"><span>高级属性</span></a></li>
            <% 
                }
                if (this.TB_Brief.Visible == true)
                {
            %>
            <li onclick="return HideAndDisplay(2,this);"><a href="#"><span>摘要</span></a></li>
            <%
                }
            %>
            <li onclick="return HideAndDisplay(3,this);"><a href="#"><span>附件</span></a></li>
            <%
                if (DDL_Rank.Visible == true)
                {
            %>
            <li onclick="return HideAndDisplay(4,this);"><a href="#"><span>权限设置</span></a></li>
            <% 
                }
                if (ExtendField)
                {
            %>
            <li onclick="return HideAndDisplay(5,this);"><a href="#"><span>自定义</span></a></li>
             <% 
                }
             %>
        </ul>
    </div>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div>
                <div id="A">
                    <table width="100%" border="0" cellpadding="2" cellspacing="1">
                        <tr>
                            <td class="RowStyle">
                                <font color="#ff0000">*</font>标题：
                            </td>
                            <td>
                                <asp:TextBox ID="TB_Title" runat="server" Width="250px"></asp:TextBox>
                                
                                <asp:DropDownList ID="DDL_FontStyle" runat="server">
                                    <asp:ListItem Value="" Selected="True">常规</asp:ListItem>
                                    <asp:ListItem Value="font-weight:bold;">粗体</asp:ListItem>
                                    <asp:ListItem Value="font-style:italic;">斜体</asp:ListItem>
                                    <asp:ListItem Value="text-decoration: underline;">下划线</asp:ListItem>
                                    <asp:ListItem Value="font-weight:bold;font-style:italic;">粗体+斜体</asp:ListItem>
                                    <asp:ListItem Value="font-weight:bold;text-decoration: underline;">粗体+下划线</asp:ListItem>
                                    <asp:ListItem Value="font-style:italic;text-decoration: underline;">斜体+下划线</asp:ListItem>
                                </asp:DropDownList>
                                <span style="display: none">
                                    <asp:TextBox ID="TB_ColorStyle" runat="server" Width="80px"></asp:TextBox></span>
                                <img id="imgColorStyle" title="选取颜色" style="cursor: pointer; background-color: #000000;
                                    width: 18px; height: 17px; border: 0px;" onclick="ColorPalette();" src="../Images/拾色器.gif"
                                    alt="" runat="server" />
                                <asp:Button ID="BT_CheckTitle" runat="server" CssClass="btn" 
                                    onclick="BT_CheckTitle_Click" Text="检查重名" />
                            </td>
                        </tr>
                        <tr>
                            <td class="RowStyle">
                                 <font color="#ff0000">*</font>所属栏目：
                            </td>
                            <td>
                                <asp:DropDownList ID="DDL_ClassID" runat="server">
                                </asp:DropDownList>
                               
                            </td>
                        </tr>
                        <tr runat="server" id="tr_Key">
                            <td class="RowStyle">
                                关 键 字：
                            </td>
                            <td>
                                <asp:TextBox ID="TB_Key" runat="server" BackColor="#FFFFC0" ToolTip="该控件可根据输入自动列出相似项"
                                    Width="250px"></asp:TextBox>
                                <img src="../../Images/help.gif" alt="" width="16" height="16" title="如果要输入多关键字请用“|”分割" />
                                &nbsp;
                                <input id="BT_GetTag" type="button" onclick="GetTag()" class="btn" value="现有Tags" /><ajaxToolkit:AutoCompleteExtender
                                    runat="server" ID="AutoCompleteExtender2" TargetControlID="TB_Key" ServicePath="WS_FindHistTory.asmx"
                                    ServiceMethod="GetKeyList" MinimumPrefixLength="2" CompletionInterval="1000"
                                    EnableCaching="true" CompletionSetCount="20" DelimiterCharacters=";, :">
                                </ajaxToolkit:AutoCompleteExtender>
                   
                            </td>
                        </tr>
                        <tr runat="server" id="tr_SpecialID">
                            <td class="RowStyle">
                                专题栏目：
                            </td>
                            <td>
                                <asp:DropDownList ID="DDL_SpecialID" runat="server">
                                    <asp:ListItem Value="0">不属于任何专题</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr runat="server" id="tr_Author">
                            <td class="RowStyle">
                                作 者：
                            </td>
                            <td>
                                <asp:TextBox ID="TB_Author" runat="server" BackColor="#FFFFC0" ToolTip="该控件可根据输入自动列出相似项"
                                    Width="250px"></asp:TextBox>
                                <asp:DropDownList ID="DDL_Author" runat="server">
                                </asp:DropDownList>
                                <input id="btAuthor" type="button" value="添加作者" class="btn" onclick="NewAuthor();"
                                    ondblclick="return btAuthor_ondblclick()" />

                                <script language="javascript" type="text/javascript">
                                    function GetAuthor() {

                                        if ($("DDL_Author").selectedIndex != 0) {
                                            var str = $("DDL_Author").options[$("DDL_Author").selectedIndex].text;

                                            $("TB_Author").value = str;
                                        }
                                        else {
                                            $("TB_Author").value = "";
                                        }
                                    }
                                    function NewAuthor() {
                                        NewTabPage('添加作者', '添加作者', 'Common/TopWinCMS_ContentPropertyManage.aspx?ModelID=' + Request.QueryString("ModelID") + '&Type=1'); ;
                                    }
                                </script>

                                <ajaxToolkit:AutoCompleteExtender ID="autoComplete1" runat="server" CompletionInterval="1000"
                                    CompletionSetCount="12" EnableCaching="true" MinimumPrefixLength="2" ServiceMethod="GetAuthorList"
                                    ServicePath="WS_FindHistTory.asmx" TargetControlID="TB_Author">
                                </ajaxToolkit:AutoCompleteExtender>
                            </td>
                        </tr>
                        <tr runat="server" id="tr_From">
                            <td class="RowStyle">
                                来源：
                            </td>
                            <td>
                                <asp:TextBox ID="TB_From" Width="250px" runat="server" BackColor="#FFFFC0" ToolTip="该控件可根据输入自动列出相似项"></asp:TextBox>
                                <asp:DropDownList ID="DDL_From" runat="server">
                                </asp:DropDownList>
                                <input id="Button3" type="button" value="添加来源" class="btn" onclick="NewFrom();" />
                                <ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" CompletionInterval="1000"
                                    CompletionSetCount="12" EnableCaching="true" MinimumPrefixLength="2" ServiceMethod="GetFromList"
                                    ServicePath="WS_FindHistTory.asmx" TargetControlID="TB_From">
                                </ajaxToolkit:AutoCompleteExtender>

                                <script language="javascript" type="text/javascript">
                                    function GetFrom() {
                                        if ($("DDL_From").selectedIndex != 0) {
                                            var str = $("DDL_From").options[$("DDL_From").selectedIndex].text;
                                            $("TB_From").value = str;
                                        }
                                        else {
                                            $("TB_From").value = "";
                                        }
                                    }
                                    function NewFrom() {
                                        NewTabPage('添加来源', '添加来源', 'Common/TopWinCMS_ContentPropertyManage.aspx?ModelID=' + Request.QueryString("ModelID") + '&Type=2'); ;
                                    }
 

                                </script>

                            </td>
                        </tr>
                        <tr runat="server" id="tr_Stars">
                            <td class="RowStyle">
                                评级：
                            </td>
                            <td>
                                <asp:DropDownList ID="DDL_Stars" runat="server">
                                    <asp:ListItem Value="1">★</asp:ListItem>
                                    <asp:ListItem Value="2">★★</asp:ListItem>
                                    <asp:ListItem Value="3" Selected="True">★★★</asp:ListItem>
                                    <asp:ListItem Value="4">★★★★</asp:ListItem>
                                    <asp:ListItem Value="5">★★★★★</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td class="RowStyle">
                                设置：
                            </td>
                            <td>
                                <asp:CheckBox ID="CB_IncludePic" runat="server" Text='含图' Width="80px" />
                                <asp:CheckBox ID="CB_OnTop" runat="server" Text='置顶' Width="80px" />
                                <asp:CheckBox ID="CB_Elite" runat="server" Text='推荐' Width="80px" />
                                <asp:CheckBox ID="CB_IsSlide" runat="server" Text="幻灯片" Width="80px" />
                                <asp:CheckBox ID="CB_AllowComment" runat="server" Text='允许评论' Width="80px" />
                                <asp:CheckBox ID="CB_Pass" runat="server" Text='审核摘要' Width="80px" />
                                <asp:CheckBox ID="CB_ContentPass" runat="server" Text="审核内容" Width="80px" />
                                <asp:CheckBox ID="CB_IsDraft" runat="server" Text="稿件" Width="80px" />
                            </td>
                        </tr>
                    </table>
                </div>
                <div id="B">
                    <table width="100%" border="0" cellpadding="2" cellspacing="1">
                        <tr runat="server" id="tr_Title1">
                            <td class="RowStyle">
                                小 标 题：
                            </td>
                            <td>
                                <asp:TextBox ID="TB_Title1" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr runat="server" id="tr_Hits">
                            <td class="RowStyle">
                                初始点击数：
                            </td>
                            <td>
                                <cc1:NumericTextBox ID="NTB_Hits" runat="server" Width="85px">0</cc1:NumericTextBox>
                             
                            </td>
                        </tr>
                        <tr runat="server" id="tr_UpDateTime">
                            <td class="RowStyle">
                                更新时间：
                            </td>
                            <td>
                                <asp:TextBox ID="TB_UpDateTime" runat="server" Width="141px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr runat="server" id="tr_TemplateFileName">
                            <td class="RowStyle">
                                网页模板：
                            </td>
                            <td>
                                <asp:TextBox ID="TB_TemplateFileName" runat="server" Width="250px"></asp:TextBox>
                                <input id="Button1" type="button" value="网页模板" onclick='GetTemplate();' class="btn" />
                            </td>
                        </tr>
                        <tr runat="server" id="tr_PicUrl">
                            <td class="RowStyle">
                                缩略图地址：
                            </td>
                            <td>
                                <asp:TextBox ID="TB_PicUrl" runat="server" Width="250px"></asp:TextBox>
                                <input id="现有图片" type="button" value="现有图片" onclick='GetImage();' class="btn" /><asp:Button
                                    ID="BT_UpLoad" runat="server" CssClass="btn" Text="上传" />&nbsp; &nbsp;
                                <ce:Uploader ID="FileUploader1" OnFileUploaded="FileUploader1_FileUploaded" runat="server"
                                    TempDirectory="~/UpLoadFolder" CancelText="取消" InsertText="上传" FileTypeNotSupportMsg="不允许上传该格式文件"
                                    InsertButtonID="BT_UpLoad" ProgressTextTemplate="%F%.. %P% %SEND%/%SIZE%">
                                    <ProgressPanelStyle Direction="NotSet" HorizontalAlign="NotSet" ScrollBars="None"
                                        Wrap="True"></ProgressPanelStyle>
                                    <CancelButtonStyle CssClass="btn" />
                                    <InsertButtonStyle CssClass="btn" />
                                </ce:Uploader>
                                <br />
                                缩略图大小：
                                <asp:TextBox ID="TB_PicW" runat="server" Width="60px" Text="240"></asp:TextBox>
                                *
                                <asp:TextBox ID="TB_PicH" runat="server" Width="60px" Text="180"></asp:TextBox>
                                <asp:CheckBox ID="CB_BiLi" runat="server" Checked="True" Text="按比例缩小" />
                            </td>
                        </tr>
                    </table>
                </div>
                <div id="C">
                    <table width="100%" border="0" cellpadding="2" cellspacing="1">
                        <tr>
                            <td class="RowStyle">
                                摘要：
                                <div style="text-align: left; line-height: 180%; font-weight: normal;">
                                    摘要将用于栏目页的简介里面。如留空系统将自动取内容里面的若干长度的文字。</div>
                            </td>
                            <td style="vertical-align: top;">
                                <asp:TextBox ID="TB_Brief" runat="server" Height="150px" TextMode="MultiLine" Width="98%"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </div>
                <div id="D">      <asp:GridView ID="GV_AnnexList" runat="server" AutoGenerateColumns="False" 
                                    CssClass="GridView" DataKeyNames="ID,DownURL" EmptyDataText="暂无附件" 
                                    OnRowCommand="GV_AnnexList_RowCommand" Width="650px">
                                    <Columns>
                                        <asp:BoundField DataField="FileName" HeaderText="附件名称" />
                                        <asp:HyperLinkField DataNavigateUrlFields="DownURL" DataTextField="DownURL" 
                                            HeaderText="下载地址" Target="_blank" />
                                        <asp:ButtonField CommandName="DeleteAnnex" Text="删除">
                                            <ItemStyle HorizontalAlign="Center" Width="40px" />
                                        </asp:ButtonField>
                                    </Columns>
                                    <HeaderStyle CssClass="HeaderStyle" />
                                </asp:GridView>
                    <table width="100%" border="0" cellpadding="2" cellspacing="1">
                        <tr>
                            <td class="RowStyle">
                                已有附件：
                            </td>
                            <td>
                                <ce:Uploader ID="Uploader2" runat="server" CancelText="取消" InsertText="上传" ProgressTextTemplate="%F%.. %P% %SEND%/%SIZE%"
                                    TempDirectory="~/UpLoadFolder/Annex/" OnFileUploaded="Uploader2_FileUploaded">
                                    <ProgressPanelStyle Direction="NotSet" HorizontalAlign="NotSet" ScrollBars="None"
                                        Wrap="True" />
                                    <CancelButtonStyle CssClass="btn" />
                                    <InsertButtonStyle CssClass="btn" />
                                </ce:Uploader>
                            </td>
                        </tr>
                        <tr>
                            <td class="RowStyle">
                                说明：
                            </td>
                            <td>
                                <asp:Label ID="LB_AnnexRemark" runat="server"></asp:Label>
                            </td>
                        </tr>
                    </table>
                </div>
                <div id="E">
                    <table width="100%" border="0" cellpadding="2" cellspacing="1">
                        <tr runat="server" id="tr_Rank">
                            <td class="RowStyle">
                                浏览等级：
                            </td>
                            <td>
                                <asp:DropDownList ID="DDL_Rank" runat="server">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr runat="server" id="tr_PointNum">
                            <td class="RowStyle">
                                所需点数：
                            </td>
                            <td>
                                <cc1:NumericTextBox ID="NTB_PointNum" runat="server" Width="85px">0</cc1:NumericTextBox>
                                <img src="../../Images/help.gif" alt="" width="16" height="16" title="对于“游客”浏览等级的无效。" />
                            </td>
                        </tr>
                    </table>
                </div>
                <div id="F">
                    <asp:Table ID="T_DefinedFile" BorderWidth="0" CellPadding="2" CellSpacing="1" runat="server"
                        EnableViewState="true">
                    </asp:Table>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <table width="100%" border="0" cellpadding="2" cellspacing="1" id="t_Content">
        <tr>
            <td class="RowStyle" style="vertical-align: text-top">
               <font color="#ff0000">*</font> 内容：<br />
                <div style="font-weight: normal; text-align: left">
                    <asp:CheckBox ID="CB_DownPic" runat="server" Text="下载站外图片"></asp:CheckBox>
                    <br />
                    <asp:CheckBox ID="CB_DrawWatherMark" runat="server" Text='图片加水印' /></div>
            </td>
            <td>
                <ce:Editor ID="CE_Content" runat="server" ThemeType="Office2003" Height="500px" Width="100%">
                    <FrameStyle Height="100%" BorderWidth="1px" BorderStyle="Solid" BorderColor="#DDDDDD"
                        Width="100%" BackColor="White"></FrameStyle>
                </ce:Editor>
            </td>
        </tr>
    </table>
    <table border="0" cellpadding="2" cellspacing="1">
        <tr>
            <td style="width: 180px">
                &nbsp;
            </td>
            <td>
                <asp:Button ID="BT_ArticleAdd" runat="server" Text=" 添加 " OnClick="BT_ArticleAdd_Click"
                 CssClass="btn"></asp:Button>
                <asp:Button ID="BT_ArticleEdit" runat="server" Text=" 修改 " OnClick="BT_ArticleEdit_Click"
                    CssClass="btn"></asp:Button>
                <img src="../../Images/help.gif" alt="" width="16" height="16" title="如果要进行分页，那么就选择“代码片断”里的“分页符”。" />
            </td>
        </tr>
        <tr>
            <td colspan="4">
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="HF_AnnexFlag" runat="server" />
    </form>
</body>
</html>
