<%@ Page Language="C#" MasterPageFile="~/Admin/MainPage.Master" AutoEventWireup="true" ValidateRequest="false" 
    Codebehind="CommentGroupEdit.aspx.cs" Inherits="PPFOR.Admin.ContentArea.Comment.CommentGroupEdit" Title="修改评论组" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PPFOR_mainContent" runat="server">    
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/ckfinder/ckfinder.js"></script> 
<script src="../../JS/popup.js" type="text/javascript"></script>  
<script type="text/javascript">
function BrowseServer()
{
	var finder = new CKFinder() ;
	finder.BasePath = '/ckfinder/';
	finder.SelectFunction = SetFileField;
	finder.RememberLastFolder=true;
	finder.PrintWaterImage=false;
	finder.ResourceType="Images";
	finder.Popup();
}
function SetFileField( fileUrl )
{
    var obj=document.getElementById( "<%= PPFOR_groupPic.ClientID %>" );
	obj.value = fileUrl ;
    if(document.all)
    {
        obj.fireEvent("onchange");
    }
    else
    {
        var evt = document.createEvent('HTMLEvents');   
         evt.initEvent('change',true,true);   
         obj.dispatchEvent(evt);   
    }   
}
function show(obj){
    if(obj!=null && obj.type=='checkbox')
    {
        var target1=document.getElementById('divSeo1');
        var target2=document.getElementById('divSeo2');
        target1.style.display=(obj.checked==true)?'':'none';  
        target2.style.display=(obj.checked==true)?'':'none'; 
    }
}
function showSection(checked){
    var obj=document.getElementById("<%=PPFOR_memberDegrees.ClientID %>");
    if(obj && obj.style) obj.style.display=checked ? '' : 'none';
}
function readable(obj,targetid){
    var target=document.getElementById(targetid);
    if(obj!=null && obj.type=='checkbox' && target!=null)
    {
        target.readOnly=obj.checked;
        if(!obj.checked)
        {
            target.select();
        }
    }
}
function validateGroupMailAddress(source,args)
{
    var obj=document.getElementById("<%=PPFOR_groupSendMail.ClientID %>");
    if(obj==null || !obj.checked)
    {
        args.IsValid=true;
    }
    else
    {      
         args.IsValid=(args.Value!=null && args.Value.length>0);        
    }
}
function showEmail(checked){
    var obj=document.getElementById("<%=PPFOR_groupMailAddress.ClientID %>");
    var objTr=document.getElementById("displayGroupMailAddress");
    if(obj!=null){
        if(checked){
            if(objTr!=null){
                objTr.style.display='';
            }
            if(obj.getAttribute('defaultValue')!=null){
                obj.value=obj.getAttribute('defaultValue');
            }
        }else{
            if(objTr!=null){
                objTr.style.display='none';
            }
            obj.setAttribute('defaultValue',obj.value);
            obj.value='';
        }
    }    
}
function openModelFilesForSelect(id)
{
    popup_show("选择模板文件","<iframe id='groupFrame' src='/Admin/CustomView/filemanager.aspx?rid=" + document.getElementById(id).getAttribute("rid") + "' scrolling='yes' width='100%' height='100%' frameborder='0' ></iframe>",520,360);
}
</script>
<form action="CommentGroupEdit.aspx" method="post" id="form1" runat="server">
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="fortable">
    <thead>   
        <tr>
            <td colspan="2" align="center">修改评论组</td>
        </tr>    
    </thead>                   
        <tr>
            <td style="width:15%" align="right">评论组名称：</td>
            <td>
                <asp:TextBox ID="PPFOR_groupName" runat="server" Width="300px" MaxLength="200"></asp:TextBox>                 
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" SetFocusOnError="true" ValidationExpression="^[^<>:\{\}\x22]{2,200}$" Display="Dynamic" ControlToValidate="PPFOR_groupName"><br />评论组名称长度必须在2至200个字符之间，且不能包含以下字符之一：<，>，:，{，}，"</asp:RegularExpressionValidator>
              <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" SetFocusOnError="true" Display="Dynamic" ControlToValidate="PPFOR_groupName"><br />评论组名称不能为空</asp:RequiredFieldValidator>
                <asp:Label ID="PPFOR_groupId" runat="server" Enabled="false" Visible="false"></asp:Label>
              <asp:Label ID="PPFOR_groupBelongMenu" runat="server" Enabled="false" Visible="false"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="right">静态文件名：</td>
            <td style="white-space:normal;">
                <asp:Label ID="PPFOR_htmlName" runat="server"></asp:Label>&nbsp;
            </td>
        </tr>
         <tr>
            <td align="right">评论组类型：</td>
            <td>
                <asp:DropDownList ID="PPFOR_groupTypeList" runat="server">
                </asp:DropDownList>                
            </td>
        </tr>
         <tr>
            <td align="right">评论组图片：</td>
            <td>       
                <asp:TextBox ID="PPFOR_groupPic" runat="server" Width="300px" MaxLength="255"></asp:TextBox>      
                <input type="button" value="选择图片" class="inputbutton" onmouseover="this.className='inputbutton_hover'" onmouseout="this.className='inputbutton'" onclick="BrowseServer();" />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" SetFocusOnError="true" ValidationExpression='^[/][^\\<>*?:|\"]{3,254}$' Display="Dynamic" ControlToValidate="PPFOR_groupPic"><br />图片文件路径必须以“/”开头，且长度必须在4至255个字符之间，且不能包含以下字符之一： \ < > | " ? : *</asp:RegularExpressionValidator>
            </td>
        </tr>            
        <tr>
            <td align="right">评论组模板：</td>
            <td>
                <asp:TextBox ID="PPFOR_groupTemplate" runat="server" Width="300px" MaxLength="255"></asp:TextBox>
                <input type="button" value="选择模板" class="inputbutton" onmouseover="this.className='inputbutton_hover'" onmouseout="this.className='inputbutton'" onclick="openModelFilesForSelect('<%=PPFOR_groupTemplate.ClientID %>');" />
                <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" SetFocusOnError="true" ValidationExpression='^[/][^\\<>*?:|\"]{3,254}$' Display="Dynamic" ControlToValidate="PPFOR_groupTemplate"><br />模板文件路径必须以“/”开头，且长度必须在4至255个字符之间，且不能包含以下字符之一： \ < > | " ? : *</asp:RegularExpressionValidator>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" SetFocusOnError="true" Display="Dynamic" ControlToValidate="PPFOR_groupTemplate"><br />评论组模板文件路径不能为空</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right">评论组内容：</td>
            <td>
                <asp:TextBox ID="PPFOR_groupContent" runat="server" TextMode="MultiLine" Height="84px" Width="502px"></asp:TextBox>
                    <script type="text/javascript">
                        var ckEditor=CKEDITOR.replace("<%=PPFOR_groupContent.ClientID%>", {
                         customConfig:'/ckeditor/templet_config.js'
                        });
                    </script>
            </td>
        </tr>  
        <tr>
            <td align="right">排序：</td>
            <td>
                <asp:TextBox ID="PPFOR_sort" runat="server" Text="0" MaxLength="4"></asp:TextBox>
                <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="PPFOR_sort" Display="Dynamic" SetFocusOnError="true" Type="Integer" MinimumValue="-999" MaximumValue="9999">排序顺序只能填写-999至9999之间的整数</asp:RangeValidator>
            </td>
        </tr>   
        <tr>
            <td align="right">是否显示：</td>
            <td>
                <asp:CheckBox ID="PPFOR_show" runat="server" Text="显示" Checked="true"></asp:CheckBox>               
            </td>
        </tr>    
        <tr>
            <td align="right">功能属性：</td>
            <td>
                <table class="innertable" width="99%">
                <tr>
                    <td style="width:30%"><asp:CheckBox ID="PPFOR_isShowCheckCode" runat="server" Text="显示验证码" Checked="true"></asp:CheckBox>&nbsp;</td>
                    <td style="width:30%"><asp:CheckBox ID="PPFOR_isNeedAudit" runat="server" Text="审核通过再在前台显示" Checked="true"></asp:CheckBox>&nbsp;</td>
                    <td style="width:30%"><asp:CheckBox ID="PPFOR_isAllowReply" runat="server" Text="允许回复" Checked="false"></asp:CheckBox>&nbsp;</td>
                </tr>
                </table>       
            </td>
        </tr>    
        <tr>
            <td align="right">评论控制：</td>
            <td>
                 <table class="innertable" width="99%">
                <tr>
                    <td style="width:30%"><asp:CheckBox ID="PPFOR_isCommentNameNotNull" runat="server" Text="评论人名称不能为空值" Checked="true"></asp:CheckBox>&nbsp;</td>
                    <td style="width:30%"><asp:CheckBox ID="PPFOR_isCommentSubjectNotNull" runat="server" Text="评论主题不能为空值" Checked="true"></asp:CheckBox>&nbsp;</td>
                    <td style="width:30%"><asp:CheckBox ID="PPFOR_isCommentContentNotNull" runat="server" Text="评论内容不能为空值" Checked="true"></asp:CheckBox>&nbsp;</td>
                </tr>
                <tr>                    
                    <td><asp:CheckBox ID="PPFOR_isCommentEmailNotNull" runat="server" Text="联系邮箱不能为空值" Checked="false"></asp:CheckBox>&nbsp;</td>
                    <td><asp:CheckBox ID="PPFOR_isCommentAddressNotNull" runat="server" Text="联系地址不能为空值" Checked="false"></asp:CheckBox>&nbsp;</td>
                    <td><asp:CheckBox ID="PPFOR_isCommentWebsiteNotNull" runat="server" Text="网址不能为空值" Checked="false"></asp:CheckBox>&nbsp;</td>
                </tr>             
                <tr>
                    <td><asp:CheckBox ID="PPFOR_isCommentPhoneNotNull" runat="server" Text="联系电话不能为空值" Checked="false"></asp:CheckBox>&nbsp;</td>
                    <td><asp:CheckBox ID="PPFOR_isCommentChatNotNull" runat="server" Text="其它联系方式不能为空值" Checked="false"></asp:CheckBox>&nbsp;</td>
                    <td>&nbsp;</td>
                </tr>
                </table>
            </td>
        </tr>   
        <tr>
            <td align="right">回复控制：</td>
            <td>
                 <table class="innertable" width="99%">
                <tr>
                    <td style="width:30%"><asp:CheckBox ID="PPFOR_isReplyNameNotNull" runat="server" Text="回复人名称不能为空值" Checked="true"></asp:CheckBox>&nbsp;</td>
                    <td style="width:30%"><asp:CheckBox ID="PPFOR_isReplyEmailNotNull" runat="server" Text="联系邮箱不能为空值" Checked="false"></asp:CheckBox>&nbsp;</td>
                    <td style="width:30%"><asp:CheckBox ID="PPFOR_isReplyAddressNotNull" runat="server" Text="联系地址不能为空值" Checked="false"></asp:CheckBox>&nbsp;</td>
                </tr>
                <tr> 
                    <td><asp:CheckBox ID="PPFOR_isReplyWebsiteNotNull" runat="server" Text="网址不能为空值" Checked="false"></asp:CheckBox>&nbsp;</td>
                    <td><asp:CheckBox ID="PPFOR_isReplyPhoneNotNull" runat="server" Text="联系电话不能为空值" Checked="false"></asp:CheckBox>&nbsp;</td>
                    <td><asp:CheckBox ID="PPFOR_isReplyChatNotNull" runat="server" Text="其它联系方式不能为空值" Checked="false"></asp:CheckBox>&nbsp;</td>                    
                </tr>
                </table>
            </td>
        </tr> 
        <tr>
            <td align="right">开放权限：</td>
            <td>
                <asp:RadioButton ID="PPFOR_publicSection" runat="server" GroupName="fileSection" Text="无限制" Checked="true" />&nbsp;&nbsp;&nbsp;
                <asp:RadioButton ID="PPFOR_memberSection" runat="server" GroupName="fileSection" Text="限制会员等级" />&nbsp;&nbsp;&nbsp;
                <asp:CheckBoxList ID="PPFOR_memberDegrees" CssClass="innertable" runat="server" RepeatColumns="2" RepeatDirection="Horizontal"></asp:CheckBoxList>               
            </td>
        </tr> 
         <tr>
          <td align="right">邮件发送：</td>
          <td><asp:CheckBox ID="PPFOR_groupSendMail" runat="server" />评论提交后是否需要发送邮件
          </td>
        </tr>  
        <tr id="displayGroupMailAddress" style="display:none;">
          <td align="right">邮箱地址：</td>
          <td><asp:TextBox ID="PPFOR_groupMailAddress" runat="server" MaxLength="100" Width="300px" /><br />
              <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" Display="Dynamic" SetFocusOnError="true" ControlToValidate="PPFOR_groupMailAddress" ValidationExpression="^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$">邮箱地址格式不对</asp:RegularExpressionValidator>
              <asp:CustomValidator ID="CustomValidator3" runat="server" Display="Dynamic" SetFocusOnError="true" ControlToValidate="PPFOR_groupMailAddress" ClientValidationFunction="validateGroupMailAddress" ValidateEmptyText="true">邮箱地址不能为空</asp:CustomValidator>              
          </td>
        </tr>      
         <tr>
            <td colspan="2" style="background-color: #f2f2f2" align="left">                
                <input type="checkbox" id="PPFOR_ckeSeo" runat="server" checked="checked" onclick="show(this)" />Seo 优化设置 & 其它
            </td>
        </tr>     
        <tr id="divSeo1">
            <td align="right">Meta关键字：</td>
            <td>
                <asp:TextBox ID="PPFOR_groupKeyWord" runat="server" Width="98%" MaxLength="255"></asp:TextBox><br />
                <input type="checkbox" id="PPFOR_groupKeyWordAuto" runat="server" checked="checked" />自动获取
            </td>
        </tr>
        <tr id="divSeo2">
            <td align="right">Meta描述：</td>
            <td>
                <asp:TextBox ID="PPFOR_groupDescription" runat="server" Width="98%" MaxLength="255"></asp:TextBox><br />
                <input type="checkbox" id="PPFOR_groupDescriptionAuto" runat="server" checked="checked" />自动获取
            </td>                  
        </tr>        
        <tr>
            <td colspan="2" style="width:100%; height:50px; display:none" align="center" valign="middle">
                <asp:Button ID="PPFOR_updateGroup" CssClass="inputbutton" runat="server" Text="提交" OnClick="PPFOR_updateGroupClick"/>
                <input name="reset" type="reset" id="reset1" class="inputbutton" onmouseover="this.className='inputbutton_hover'" onmouseout="this.className='inputbutton'" value="重置" />
                <asp:Label ID="PPFOR_goToGroupList" runat="server"></asp:Label>
                <script type="text/javascript">
                    addButtonArray("<%= PPFOR_updateGroup.ClientID %>","reset1","goBack");
                </script>
            </td>
        </tr>           
    </table>
</form>
</asp:Content>
