<%@ control language="VB" autoeventwireup="false" inherits="Admin_Hostmatic_CC_VirtualDirectories, MachSol.MachPanel.Web" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="EM" %>
<%@ Register Src="~/Template/ResourcesQuota.ascx" TagName='ResourceQuota' TagPrefix='EM' %>
<%@ Register Src="~/Template/GVPager.ascx" TagName="Pager" 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">
                    <asp:Panel ID="Pnl_Listing" runat="server">
                        <div class="row">
                            <div class="col-xs-12 Div_OpsRow" id="Div_OpsRow" runat="server">
                                <div class="card">
                                    <div class="header">
                                        <h3>
                                            <%= Resources.Content.GN00001320%>      <%--Operations--%>
                                        </h3>
                                    </div>
                                    <div class="body">
                                        <asp:Button ID="Btn_AddVirDir" runat="server" Text="<%$ Resources:Content,String1046%>" class="btn btn-primary waves-effect btnAction" />
                                    </div>
                                </div>
                            </div>
                            <div class="col-xs-12">
                                <asp:GridView ID="Gv_VirtualDirectories" CssClass="table table-bordered table-striped table-hover" EmptyDataText="<%$ Resources:Content, GN00001375 %>"
                                    AllowPaging="True" runat="server" AutoGenerateColumns="False">
                                    <Columns>
                                        <asp:TemplateField HeaderText="<%$ Resources:Content,SPT002837%>" HeaderStyle-CssClass="col-xs-5" ItemStyle-CssClass="col-xs-5">
                                            <ItemTemplate>
                                                <asp:Label ID="Lbl_VirDir" runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="<%$ Resources:Content,SPT002241%>" HeaderStyle-CssClass="col-xs-5" ItemStyle-CssClass="col-xs-5">
                                            <ItemTemplate>
                                                <asp:Label ID="Lbl_PointsTo" runat="server"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="<%$ Resources:Content,GN0000360%>" HeaderStyle-CssClass="col-xs-2" ItemStyle-CssClass="col-xs-2">
                                            <ItemTemplate>
                                                <asp:LinkButton ID="LB_Edit" runat="server" CssClass="btn btn-primary waves-effect" CommandName="VDirEdit"
                                                    Text='<%$ Resources:Content, GN0000276 %>' CausesValidation="false"></asp:LinkButton>
                                                <asp:LinkButton ID="LB_Remove" runat="server" CssClass="btn btn-primary waves-effect btnAction" CommandName="VDirRemove"
                                                    Text='<%$ Resources:Content, GN0000278 %>' CausesValidation="false"></asp:LinkButton>
                                                <EM:ConfirmButtonExtender ID="CBE_Remove" runat="server" ConfirmText="<%$Resources:Content,CBE001%>"
                                                    TargetControlID="LB_Remove">
                                                </EM:ConfirmButtonExtender>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </div>
                        </div>
                    </asp:Panel>
                    <div class="row" id="Pnl_Edit" runat="server">
                        <div class="col-xs-12">
                            <div class="card">
                                <div class="header" id="Tr_Add" runat="server">
                                    <h3><%= Resources.Content.String1046%></h3>
                                </div>
                                <div class="header" id="Tr_Edit" runat="server">
                                    <h3><%= Resources.Content.String1047%></h3>
                                </div>
                                <div class="body">
                                    <div class="row">
                                        <div class="col-sm-2 col-xs-12 row-label">
                                            <label>*<asp:Literal ID="Literal5" runat="server" Text="<%$ Resources:Content,GN000170%>" EnableViewState="false" />:</label>
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_Name" runat="server"></asp:TextBox>
                                                    <asp:RequiredFieldValidator SetFocusOnError="true" runat="server" ValidationGroup="VirDir"
                                                        ID="RequiredFieldValidator4" ControlToValidate="TxBx_Name" Display="None">
                                                    </asp:RequiredFieldValidator>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TxBx_Name"
                                                        Display="None" ValidationGroup="MIME" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                                    <EM:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="TxBx_Name"
                                                        FilterType="Numbers,UppercaseLetters,LowercaseLetters,Custom" ValidChars="" />
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-sm-2 col-xs-12 row-label">
                                            <label>*<asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:Content,String162%>" EnableViewState="false" />:</label>
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <div class="form-line">
                                                    <asp:TextBox ID="TxBx_Path" runat="server" Enabled="false"></asp:TextBox>
                                                    <asp:RequiredFieldValidator SetFocusOnError="true" runat="server" ID="RequiredFieldValidator1"
                                                        ControlToValidate="TxBx_Path" ValidationGroup="VirDir" Display="None">
                                                    </asp:RequiredFieldValidator>
                                                    <asp:RegularExpressionValidator ID="REV_URL" runat="server" Display="None" ValidationGroup="VirDir"
                                                        ErrorMessage='<% $Resources:Content,String309%>' ValidationExpression='^(ht|f)tp(s?)://([\w-]+\.)+[\w-]+(/[\w-./?%&=]*)?$'
                                                        ControlToValidate="TxBx_Path"></asp:RegularExpressionValidator>
                                                    <%--<asp:RegularExpressionValidator ID="REV_File" runat="server" ErrorMessage='<%$ Resources:Content,String310%>'
                        ControlToValidate="TxBx_Path" Display="None" SetFocusOnError="True" 
                        ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.htm|.html|.php|.asp)$" ValidationGroup="VirDir"></asp:RegularExpressionValidator>--%>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <asp:Button ID="Btn_Browse" runat="server" Text="<%$ Resources:Content,SPT002093%>" CausesValidation="false" CssClass="btn btn-primary waves-effect" />
                                        </div>
                                    </div>
                                    <div id="Tr_Permissions" runat="server">
                                        <div class="row">
                                            <div class="col-sm-2 col-xs-12 row-label">
                                                <label>*<asp:Literal ID="Literal3" runat="server" Text="<%$ Resources:Content,SPT002241%>" EnableViewState="false" />:</label>
                                            </div>
                                            <div class="col-sm-4 col-xs-12">
                                                <div class="form-group">
                                                    <asp:DropDownList ID="DDL_PointsTo" runat="server" AutoPostBack="true">
                                                        <asp:ListItem Text="<%$ Resources:Content,SPT002309%>" Value="1"></asp:ListItem>
                                                        <asp:ListItem Text="<%$ Resources:Content,SPT002310%>" Value="2"></asp:ListItem>
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-sm-2 col-xs-12 row-label">
                                                <label>Permissions:</label>
                                            </div>
                                            <div class="col-sm-4 col-xs-12">
                                                <div class="form-group">
                                                    <asp:CheckBox ID="ChBx_ReadPermission" runat="server" Text="<%$ Resources:Content,SPT002244%>" /><br />
                                                    <asp:CheckBox ID="ChBx_WritePermission" runat="server" Text="<%$ Resources:Content,SPT002245%>" /><br />
                                                    <asp:CheckBox ID="ChBx_DirectoryBrowsing" runat="server" Text="<%$ Resources:Content,SPT002246%>" />
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="col-sm-2 col-xs-12 row-label">
                                                <label>
                                                    <asp:Literal ID="Literal7" runat="server" Text="<%$ Resources:Content,SPT002248%>" EnableViewState="false" />:</label>
                                            </div>
                                            <div class="col-sm-4 col-xs-12">
                                                <div class="form-group">
                                                    <asp:DropDownList ID="DDL_ExecutePermission" runat="server">
                                                        <asp:ListItem Text="<%$ Resources:Content,GN0000918%>" Value="1"></asp:ListItem>
                                                        <asp:ListItem Text="<%$ Resources:Content,SMI652%>" Value="2" Selected="True"></asp:ListItem>
                                                        <asp:ListItem Text="<%$ Resources:Content,SMI653%>" Value="3"></asp:ListItem>
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-sm-2 col-xs-12 row-label">
                                            <label>
                                                <asp:Literal ID="Ltl_CreateApp" runat="server" Text="<%$ Resources:Content,SPT002247%>" EnableViewState="false" /></label>
                                        </div>
                                        <div class="col-sm-4 col-xs-12">
                                            <div class="form-group">
                                                <asp:CheckBox ID="ChBx_CreateApplication" runat="server" Checked="true" Enabled="false" Text=" " />
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <asp:Button ID="Btn_Save" runat="server" class="btn btn-primary waves-effect btnAction" Text="<%$ Resources:Content,GN0000281%>" ValidationGroup="VirDir" />
                                            <asp:Button ID="Btn_Cancel" runat="server" class="btn btn-primary waves-effect" Text="<%$ Resources:Content,GN0000572%>" />
                                        </div>
                                    </div>
                                </div>
                            </div>

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

                </div>
            </div>
        </div>
    </div>
</div>

<asp:Panel ID="Panel2" runat="server" Style="display: none" CssClass="width-modal-popup-auto">
    <ajax:UpdatePanel ID="update1" 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-6">
                            <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-2 col-xs-12 row-label">
                            <label>*<asp:Label ID="Lbl_TextItem" runat="server" Text="<%$ Resources:Content,SMI0440%>"></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-4 col-xs-12">
                            <asp:Button ID="Btn_Done" runat="server" Text="<%$ Resources:Content,GN0001184%>" class="btn btn-primary waves-effect" OnClientClick="return SetHomeDir();" />
                            <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"
    DropShadow="false" PopupControlID="Panel2" TargetControlID="Btn_Browse"
    OkControlID="Btn_Done">
</EM:ModalPopupExtender>

<asp:Button ID="Btn_Display" runat="server" Style="display: none;" />
<asp:Panel ID="Panel3" runat="server" BorderColor="ActiveBorder" BorderStyle="Groove"
    ScrollBars="Auto" Style="display: none" CssClass="width-modal-popup-auto">
    <EM:ResourceQuota runat="server" ID="ResourceQuotaView" />
</asp:Panel>
<EM:ModalPopupExtender X="150" runat="server" ID="MPE_Resource" BackgroundCssClass="modalBackground"
    DropShadow="false" PopupControlID="Panel3" TargetControlID="Btn_Display">
</EM:ModalPopupExtender>

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

    AllowArrowKeysInFilteredTextBoxExtender('<%=FilteredTextBoxExtender1.ClientID%>');
</script>