<%@ page language="C#" autoeventwireup="true" validaterequest="false" inherits="model_article_add, Fm.Web" %>

<%@ 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 href="skin/css.css" rel="stylesheet" type="text/css" />
     <link href="/images/css/inbox.css" rel="stylesheet" type="text/css" />
    <script language="javascript">
     function display()
    {
         var tab=document.getElementById("tab1");
         if(tab.style.display=="none")
         {
             tab.style.display="inline";
         }
         else
         {
             tab.style.display="none";
         }
    } 
    function getColor(color)
    {
        var sInitColor = color;                                 //获取参数传递的颜色
        if (sInitColor == null||sInitColor=="")
                var sColor = myColor.ChooseColorDlg();          //打开颜色对话框
        else
                var sColor = myColor.ChooseColorDlg(sInitColor);//设置颜色
                sColor = sColor.toString(16);                   //转换为16进制颜色
        if (sColor.length < 6) {                                //如果颜色小于6位
          var sTempString = "000000".substring(0,6-sColor.length);//格式化为6位
          sColor = sTempString.concat(sColor);
        }
        sColor = "#" + sColor;                                      //添加颜色标签
        return sColor;
    }
    //获取来源数据
    function GetSource()
    {
        var dropsource=document.getElementById("Drop_source");
        var source=document.getElementById("source");
        
        source.value=dropsource.options[dropsource.options.selectedIndex].value;
    }
    //获取作者数据
    function GetAuthor()
    {
        var dropauthor=document.getElementById("Drop_author");
        var author=document.getElementById("author");
        
        author.value=dropauthor.options[dropauthor.options.selectedIndex].value;
    }
    //判断标题和内容部能为空
    function panduan()
    {
        var title=document.getElementById("doctitle").value;
        //var content=document.getElementById("FCKeditor1").value;
        var Editor =FCKeditorAPI.GetInstance("FCKeditor1");
        var content=Editor.GetXHTML();
        var col=document.getElementById("Drop_column");
        if(title=="")
        {
            alert("标题不能为空!");
            return false;
        }
        else if(col.options[col.options.selectedIndex].value=="0")
        {
            alert("请选择投稿栏目!");
            return false;
        }
        else if(content=="")
        {
            alert("文章内容不能为空!");
            return false;
        }
        else 
        {
          return true;
        }
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="width: 100%" class=Ibx_gTable_Con>
            <tr>
                <td align="left" class="bg" colspan="2">
                    基本属性</td>
            </tr>
            <tr>
                <td width="120">
                    文档标题:</td>
                <td>
                    <asp:TextBox ID="doctitle" runat="server" Width="500px"></asp:TextBox>
                    </td>
            </tr>
            <tr>
                <td width="120">
                    文档属性:</td>
                <td>
                    <asp:CheckBox ID="head" runat="server" Text="头条" />
                    <asp:CheckBox ID="map" runat="server" Text="图文" />
                    <asp:CheckBox ID="flash" runat="server" Text="幻灯" />
                    <asp:CheckBox ID="commend" runat="server" Text="推荐" />
                    </td>
            </tr>
            <tr>
                <td width="120">
                    所属栏目：</td>
                <td>
                    <asp:DropDownList ID="Drop_column" runat="server">
                    </asp:DropDownList></td>
            </tr>
            <tr>
                <td width="120">
                    缩略图：</td>
                <td>
                 <script language=javascript>
                    //打开图片上传页面
                   function openurl()
                    {
                         window.open("tupian_upload.aspx","","top=100,left=220,width=520,height=560");
                    }
                    //打开服务器图片管理器
                    function openmap()
                    {
                        window.open("tupian_select.aspx","","top=100,left=80,width=500");
                    }
                    //接收缩略图URL
                    function GetPath(url)
                    {
                        document.getElementById("thumbnail").value=url;
                        document.getElementById("thumpreview").src=url;
                    }
                </script>
                <input id="thumbnail" type="text" runat="server" style="width:300px" />
                <input id="Up" type="button" onclick="openurl()" value="上 传" />
                <input id="LiuLan" onclick="openmap()" type="button" value="从服务器选择" />
                &nbsp;&nbsp;<img src="../images/thumbnail.jpg" id="thumpreview" />
                </td>
                
            </tr>
            <tr>
                <td class="bg" colspan="2">
                    内容模型</td>
            </tr>
            <tr>
                <td width="120">
                    作者来源:</td>
                <td>
                    作者:<asp:TextBox ID="author" runat="server"></asp:TextBox>
                    <asp:DropDownList ID="Drop_author" runat="server" onclick="GetAuthor()">
                    </asp:DropDownList>
                    来源:<asp:TextBox ID="source" runat="server"></asp:TextBox>
                    <asp:DropDownList ID="Drop_source" runat="server" onclick="GetSource()">
                    </asp:DropDownList></td>
            </tr>
            <tr>
                <td width="120">
                </td>
                <td>
                    分页符 <font color=red>#p#</font> (如:分页1的内容#p#分页2的内容)</td>
            </tr>
            
            <tr>
                <td width="120">
                    内容:</td>
                <td>
                    <fckeditorv2:fckeditor id="FCKeditor1" runat="server" height="500px"></fckeditorv2:fckeditor>
                </td>
            </tr>
          
            <tr>
                <td colspan="2" class="bg">
                  高级属性:<span onclick="display()" style="cursor:hand"><font color=red>显示/隐藏</font></span>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                <table id="tab1" style="width: 100%;display:none" class="Ibx_gTable_Con">
                        <tr>
                            <td width="18%">
                                文档评论设置:</td>
                            <td width="70%">
                                <asp:CheckBox ID="comment" runat="server" Text="是否允许评论" Checked="True" />
                                &nbsp; 发布选项:
                                <input id="html_true" name="html" checked="true" type="radio" value="true" runat=server />生成静态&nbsp;
                                <input id="html_false" name="html" type="radio" value="false" runat=server />动态浏览</td>
                        </tr>
                    <tr>
                        <td width="18%">
                            浏览次数:</td>
                        <td width="70%">
                            <asp:TextBox ID="click" runat="server" Width="100px">1</asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="click"
                                ErrorMessage="只能为数字" ValidationExpression="^[0-9]*$"></asp:RegularExpressionValidator></td>
                    </tr>
                        <tr>
                            <td width="18%">
                                关键字:</td>
                            <td width="70%">
                                <asp:TextBox ID="keywords" runat="server" Width="307px"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td width="18%">
                                描述:</td>
                            <td width="70%">
                                <asp:TextBox ID="intro" runat="server" Height="70px" TextMode="MultiLine" Width="308px"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td width="18%">
                                其他设置:</td>
                            <td width="70%">
                                标题颜色:<asp:TextBox ID="getcolor" runat="server" Width="100px"></asp:TextBox>
                                <input type=button value="选取颜色" onClick="getcolor.value=getColor()"/>
                                &nbsp; &nbsp;
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="center" colspan="2">
                    <asp:ImageButton ID="bt_save" runat="server" OnClientClick="return panduan();" ImageUrl="~/admin/skin/images/button_save.gif"
                        OnClick="bt_save_Click" /></td>
            </tr>
        </table>
    
    </div>
    </form>
    <OBJECT id="myColor" CLASSID="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b" width="0px" height="0px"></OBJECT>
</body>
</html>

