<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UserDefined.aspx.cs" Inherits="Admin_UserDefined" %>

<%@ Import Namespace="Spaces" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>
        <%=Globals.Text["GuestLimits_Title"]%>
    </title>
    <link href="Admin.css" rel="stylesheet" type="text/css" />
     

    <script src="<%=Globals.ApplicationPath %>/Include/js/dialog.js" type="text/javascript"></script>

    <script src="<%=Globals.ApplicationPath %>/Include/js/base.js" type="text/javascript"></script>

    <script>
    function check_title(sStr)
{
	if (sStr.length == '')
	{
		_error_msg_show('友情连接名称不能为空');
		return false;
	}
	else if (sStr.length > 28)
	{
		_error_msg_show('友情连接名称长度不能超过28个字符或14个汉字');
		return false;
	}
	return true;
}

    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div align="center">
            &nbsp; &nbsp;</div>
        <table width="640" border="0" align="center" cellpadding="0" cellspacing="0" class="black333333_red_noline">
            <tr>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="3" height="3">
                                <img src="img/O_angle_up_left.gif" width="3" height="3"></td>
                            <td bgcolor="#ACD373" width="100%">
                            </td>
                            <td width="3">
                                <img src="img/O_angle_up_right.gif" width="3" height="3"></td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td bgcolor="#acd373" height="30">
                    &nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffffff"><b><%=Globals.Text["LayoutSettings_FriendLink"]%></b></font>
                </td>
            </tr>
            <tr>
                <td class="form_border">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="20">
                                &nbsp;</td>
                            <td>
                                &nbsp;<asp:Label ID="Message" runat="server">添加友情连接</asp:Label></td>
                            <td width="20">
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;</td>
                            <td>
                                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="black333333_red_noline">
                                    <tr>
                                        <td align="right">
                                            <font color="#FF6600"><a href="editPost.aspx">
                                                <%=Globals.Text["GuestLimits_PublishArtical"]%>
                                            </a></font>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <fieldset>
                                                <legend>&nbsp;<%=Globals.Text["UserDefined_LinkManage"]%>&nbsp;</legend>
                                                <div align="right">
                                                    <%=Globals.Text["UserDefined_LinkInterface"]%>
                                                    <br>
                                                    <%=Globals.Text["UserDefined_LinkEdit"]%>
                                                    <br>
                                                    <br>
                                                </div>
                                            </fieldset>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td height="5">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                        </td>
                                        <tr>
                                            <td>
                                                <!-- 功能列表 -->
                                                <!-- /功能列表 -->
                                                <!-- 分类列表 -->
                                                <!-- /分类列表 -->
                                            </td>
                                        </tr>
                                </table>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;</td>
                            <td>
                                <asp:GridView ID="UserLinkView" runat="server" CellPadding="3" CellSpacing="2" BackColor="White"
                                    CssClass="black333333_red_noline" AutoGenerateColumns="False" Width="100%" BorderWidth="0px">
                                    <RowStyle BackColor="#EEF5E2" />
                                    <HeaderStyle BackColor="#669900" ForeColor="White" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="菜单名">
                                            <ItemTemplate>
                                                <asp:HiddenField ID="LinkID" runat="server" Value='<%# Bind("LinkID") %>' />
                                                <asp:Label ID="LinkName" runat="server" Text='<%# Bind("LinkName") %>'></asp:Label>
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <asp:HiddenField ID="LinkID" runat="server" Value='<%# Bind("LinkID") %>' />
                                                <asp:TextBox ID="LinkName" runat="server" Text='<%# Bind("LinkName") %>' onblur="check_title(this.value)"></asp:TextBox>
                                            </EditItemTemplate>
                                            <FooterTemplate>
                                                <asp:TextBox ID="LinkName" runat="server"></asp:TextBox>
                                            </FooterTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="菜单连接地址">
                                            <ItemTemplate>
                                                <asp:Label ID="UrlAddress" runat="server" Text='<%# Bind("UrlAddress") %>'></asp:Label>
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <asp:TextBox ID="UrlAddress" runat="server" Text='<%# Bind("UrlAddress") %>'></asp:TextBox>
                                            </EditItemTemplate>
                                            <FooterTemplate>
                                                <asp:TextBox ID="UrlAddress" runat="server"></asp:TextBox>
                                            </FooterTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="新窗口打开">
                                            <ItemTemplate>
                                                <asp:Label ID="NewWindow" runat="server" Text='<%# Convert.ToBoolean(Eval("NewWindow"))?"新窗口打开":"当前窗口" %>'></asp:Label>
                                            </ItemTemplate>
                                            <EditItemTemplate>
                                                <asp:CheckBox ID="NewWindow" runat="server" Checked='<%# Convert.ToBoolean(Eval("NewWindow"))  %>' />
                                            </EditItemTemplate>
                                            <FooterTemplate>
                                                <asp:CheckBox ID="NewWindow" runat="server" />
                                            </FooterTemplate>
                                        </asp:TemplateField>
                                        <asp:CommandField ShowEditButton="True" EditText="&lt;img src='./img/edit.gif' width='20' height='18' /&gt;"
                                            HeaderText="编辑">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:CommandField>
                                        <asp:CommandField ShowDeleteButton="True" DeleteText="<img src='./img/icon_del.gif' width='14' height='14' />"
                                            ItemStyle-HorizontalAlign="Center" HeaderText="删除" />
                                    </Columns>
                                </asp:GridView>
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                                &nbsp;<fieldset>
                                    <legend>&nbsp;<%=Globals.Text["UserDefined_LinkAdd"]%>&nbsp;</legend>
                                    <div align="center">
                                        <table>
                                            <tr>
                                                <td align="right">
                                                    <%=Globals.Text["UserDefined_LinkName"]%>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtLinkName" runat="server" Width="150px" MaxLength=20></asp:TextBox></td>
                                              

                                                 

                                              
                                            </tr>
                                            <tr>
                                                <td>
                                                  友情连接地址:
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtAddress" runat="server" Text="http://" Width="150px" MaxLength="255"></asp:TextBox></td>
                                            </tr>
                                             <tr>
                                                <td align="right">
                                                说明:
                                                </td>
                                                <td align="left">
                                                   <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine" Rows=4 Width="150px" MaxLength="1000"></asp:TextBox></td>
                                            </tr>
                                            <tr>
                                                <td align="right">
                                               <%=Globals.Text["UserDefined_OpenNewWindow"]%> </td>
                                                <td align="left">
                                                    <asp:CheckBox ID="chkNewWindow" runat="server" Text="在新窗口打开" /></td>
                                                <td rowspan="1">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="right">
                                                    
                                                </td>
                                                <td align="left">
                                                    &nbsp;<asp:Button ID="btnAdd" runat="server" Text="添加" OnClick="btnAdd_Click" OnClientClick="return chkForm()" /></td>
                                            </tr>
                                        </table>
                                           <script type="text/javascript">
                                    function chkForm()
                                    {
                                     var menuName=$('<%=txtLinkName.ClientID %>').value;
                                     if(menuName.trim()=="")
    {
    _error_msg_show('请输入友情连接名！:S')
     return false;
    }
    var address=$('<%=txtAddress.ClientID %>').value;
                if(address.trim()==""||address.trim()=="http://")
                       {
    _error_msg_show('请输入友情连接地址！:S')
                          return  false;
                     }
                     return true;
                     }
                                                    </script>
                                        <br />
                                    </div>
                                </fieldset>
                                <br />
                            </td>
                            <td>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td height="30" bgcolor="#E3F0D0" align="center">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
