<%@ control language="VB" autoeventwireup="false" inherits="Admin_Hostmatic_CC_URLRedirection, MachSol.MachPanel.Web" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>

<div class="col-xs-12">
    <div class="card">
        <div class="header">
            <div class="displayInlineBlock">
                <h2>
                    <asp:Literal ID="Ltl_SubsInfo" runat="server" /></h2>
            </div>
            <asp:LinkButton ID="Btn_GoBack" runat="server" Text="<%$ Resources:Content,String1045 %>" CausesValidation="false" 
                CssClass="btn btn-primary waves-effect pull-right m-t--4px" />
        </div>
        <div class="body">
            <div class="row">
                <div class="col-xs-12">
                    <div class="row" id="Pnl_WebSettings" runat="server">
                        <div class="col-xs-12">
                            <div class="card">
                                <div class="header">
                                    <h3><%= Resources.Content.SPT001051%></h3>
                                </div>
                                <div class="body">
                                    <div class="row">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:RadioButton ID="RB_PhysicalPath" runat="server" GroupName="Paths" AutoPostBack="true" Text="<%$ Resources:Content,SMI0601%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_HomeFolder" runat="server" Enabled="false"></asp:TextBox>
                                                    <asp:RequiredFieldValidator SetFocusOnError="true" runat="server" ID="RFV_TxBx_HomeFolder"
                                                        ControlToValidate="TxBx_HomeFolder" ValidationGroup="URLRedirections" Display="None">
                                                    </asp:RequiredFieldValidator>
                                                    <%--                <asp:RegularExpressionValidator Display="none" ValidationExpression="(\\w+)*\\[a-zA-Z0-9]+"
                    ValidationGroup="URLRedirections" ControlToValidate="TxBx_HomeFolder" ID="REV_PhysicalPath"
                    runat="server" ErrorMessage='<%$ Resources:Content,String310%>'></asp:RegularExpressionValidator>--%>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <asp:Button ID="Btn_Browse" runat="server" class="btn btn-primary waves-effect" Text="<%$ Resources:Content,SPT002093%>" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <br />
                            <div class="card">
                                <div class="header">
                                    <h3><%= Resources.Content.SMI0602%></h3>
                                </div>
                                <div class="body">
                                    <div class="row">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            <asp:RadioButton ID="RB_URL" runat="server" GroupName="Paths" AutoPostBack="true" Text="<%$ Resources:Content,SMI0603%>" />:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="Txt_URL" runat="server"  Text="http://" Enabled="true"></asp:TextBox>
                                                    <asp:RequiredFieldValidator SetFocusOnError="true" runat="server" ID="RFV_HomeFolder"
                                                        ControlToValidate="Txt_URL" ValidationGroup="URLRedirections" Display="None">
                                                    </asp:RequiredFieldValidator>
                                                    <%--ValidationExpression="^(ht|f)tp(s?)://([\w-]+\.)+[\w-]+(/[\w-./?%&=]*)?$"--%>
                                                    <asp:RegularExpressionValidator Display="none"
                                                        ValidationExpression="(?!^ +$)^.+$"
                                                        ValidationGroup="URLRedirections" ControlToValidate="Txt_URL" ID="REV_Txt_URL"
                                                        runat="server" ErrorMessage='<%$ Resources:Content,String309%>'></asp:RegularExpressionValidator>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-12 row-label">The client will be sent to:</div>
                                    </div>
                                    <div class="row">
                                        <div class="col-sm-3 col-xs-12 row-label">The exact URL entered above:</div>
                                        <div class="col-sm-9 col-xs-12">
                                            <asp:CheckBox ID="CB_ExactURL" runat="server" Checked="true" Enabled="false" Text=" " />
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-sm-3 col-xs-12 row-label">A directory below URL entered:</div>
                                        <div class="col-sm-9 col-xs-12">
                                            <asp:CheckBox ID="CB_DirBelow" runat="server" Checked="true" Enabled="false" Text=" " />
                                        </div>
                                    </div>
                                    <div class="row" id="Tr_StatusCode" runat="server" visible="false">
                                        <div class="col-sm-3 col-xs-12 row-label">
                                            Status code:
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <asp:DropDownList ID="DDL_StatusCode" runat="server">
                                                    <asp:ListItem Text="<%$ Resources:Content,SMI0604%>" Value="0"></asp:ListItem>
                                                    <asp:ListItem Text="<%$ Resources:Content,SMI0605%>" Value="1"></asp:ListItem>
                                                    <asp:ListItem Text="<%$ Resources:Content,SMI0606%>" Value="2"></asp:ListItem>
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <asp:Button ID="Btn_save" runat="server" Text="<%$ Resources:Content,GN0000281%>" class="btn btn-primary waves-effect btnAction" ValidationGroup="URLRedirections" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<asp:Panel ID="Panel2" runat="server" Style="display: none" CssClass="width-modal-popup-auto">
    <ajax:UpdatePanel ID="UPdatePanel1" runat="server">
        <ContentTemplate>
            <div class="card" id="Tbl_Restore" runat="server">
                <div class="header">
                    <h3>File Browser</h3>
                </div>
                <div class="body">
                    <div class="row">
                        <div class="col-sm-3 col-xs-6">
                            <asp:Panel ID="Pnl_Tree" runat="server" Width="100%" Height="400px" BorderColor="ActiveBorder"
                                BorderStyle="Groove" ScrollBars="Auto">
                                <asp:TreeView ID="TV_Browsers" runat="server">
                                </asp:TreeView>
                            </asp:Panel>
                        </div>
                        <div class="col-sm-9 col-xs-12">
                            <asp:Panel ID="Panel1" runat="server" Height="400px" Width="100%" BorderColor="ActiveBorder"
                                BorderStyle="Groove" ScrollBars="Auto">
                                <asp:GridView ID="GV_Browsers" runat="server" AllowPaging="true" CssClass="table table-bordered table-striped table-hover"
                                    AutoGenerateColumns="false" EmptyDataText="<%$ Resources:Content,GN00001375%>"
                                    PageSize="500">

                                    <Columns>
                                        <asp:TemplateField HeaderText="<%$ Resources:Content,GN000170%>" HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3">
                                            <ItemTemplate>
                                                <asp:Image ID="img_Name" runat="server" />
                                                <asp:LinkButton ID="LB_Name" runat="server" CommandName="Name" CausesValidation="false"></asp:LinkButton>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="<%$ Resources:Content,DGN1119982%>" HeaderStyle-CssClass="col-xs-3" ItemStyle-CssClass="col-xs-3">
                                            <ItemTemplate>
                                                <asp:Label ID="Lbl_Size" runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="<%$ Resources:Content,GN0000673%>" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                            <ItemTemplate>
                                                <asp:Label ID="Lbl_Type" runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="<%$ Resources:Content,SMI0439%>" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                            <ItemTemplate>
                                                <asp:Label ID="Lbl_DateModified" runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="<%$ Resources:Content,GN00001496%>" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                            <ItemTemplate>
                                                <asp:Label ID="Lbl_DateCreated" runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </asp:Panel>
                        </div>
                    </div>
                    <div class="row" id="Tr_TextBox" runat="server">
                        <div class="col-sm-3 col-xs-12 row-label">
                            <label>*<asp:Label ID="Lbl_TextItem" runat="server" Text="<%$ Resources:Content,SMI651%>"></asp:Label></label>
                        </div>
                        <div class="col-sm-4 col-xs-12">
                            <div class="form-group">
                                <div class="form-line">
                                    <asp:TextBox ID="TxBx_Item" runat="server" ReadOnly="true" Enabled="false"></asp:TextBox>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-5 col-xs-12">
                            <asp:Button ID="Btn_Done" runat="server" Text="<%$ Resources:Content,GN0001184%>" OnClientClick="return SetHomeDir();"
                                class="btn btn-primary waves-effect" />
                            <asp:Button ID="Btn_Close" runat="server" Text="<%$ Resources:Content,GN000150%>" class="btn btn-primary waves-effect" CausesValidation="false" />
                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
        <Triggers>
            <ajax:AsyncPostBackTrigger ControlID="Btn_Done" />
        </Triggers>
    </ajax:UpdatePanel>
</asp:Panel>
<EM:ModalPopupExtender runat="server" ID="MPE_Browse" BackgroundCssClass="modalBackground"
    CancelControlID="Btn_Close" DropShadow="false" PopupControlID="Panel2" TargetControlID="Btn_Browse"
    OkControlID="Btn_Done">
</EM:ModalPopupExtender>

<asp:ValidationSummary ID="VS_WebProperties" runat="server" HeaderText='<%$ Resources:Content, EM000001 %>'
    ShowMessageBox="True" ShowSummary="False" ValidationGroup="URLRedirections" />

<script type="text/javascript" language="javascript">
    function SetHomeDir() {
        var modalSelectedDir = document.getElementById('<%= TxBx_Item.ClientID %>');
        var HomeDir = document.getElementById('<%= TxBx_HomeFolder.ClientID %>');
        //alert("ModelDir = " + modalSelectedDir.value);
        //alert("HomeDir = " + HomeDir.value);
        HomeDir.value = modalSelectedDir.value;
        //alert("Selected Dir = " + HomeDir.value);
        return true;
    }

</script>

