<%@ Page Title="" Language="vb" AutoEventWireup="true" MasterPageFile="~/SiteMaster.master" CodeBehind="ProjectUniverseConfigPage.aspx.cs" Inherits="MKInsight.Online.ActionTracking.ConfigurationPages.ProjectUniverseConfigPage" %>


<%@ Register Src="../UIControls/Header.ascx" TagName="Header" TagPrefix="uc4" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="../UIControls/MessageBox.ascx" TagName="MessageBox" TagPrefix="uc5" %>
<%@ Register Assembly="MKinsight.Online.UIServices" Namespace="Geekees.Common.Controls" TagPrefix="ct" %>

<%@ Register Src="../UIControls/Interface/TextBoxEx.ascx" TagName="TextBoxEx" TagPrefix="uc1" %>

<%@ Register Src="../UIControls/Interface/MultilineTextBoxEx.ascx" TagName="MultilineTextBoxEx" TagPrefix="uc2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <link href="<%:ResolveUrl("~/scripts/ASTJavascript/astreeview/astreeview.css")%>"
        type="text/css" rel="stylesheet" />
    <link href="<%:ResolveUrl("~/scripts/ASTJavascript/contextmenu/contextmenu.css")%>"
        type="text/css" rel="stylesheet" />

    <script src="<%:ResolveUrl("~/scripts/ASTJavascript/astreeview/astreeview_packed.js")%>"
        type="text/javascript"></script>

    <script src="<%:ResolveUrl("~/scripts/ASTJavascript/contextmenu/contextmenu_packed.js")%>"
        type="text/javascript"></script>

    <script type="text/javascript">
        function nodeSelectHandler(elem) {

            document.getElementById('<%:txtSelectedNode.ClientID%>').value = elem.parentNode.getAttribute("treeNodeValue");
            document.getElementById('<%:btnSelectionPBTrigger.ClientID%>').click();
        }

        function dndCompleteHandler(elem, newParent) {

            try {

                PageMethods.MoveProjects(elem.getAttribute("treeNodeValue"), newParent.getAttribute("treeNodeValue"), OnSucceeded, OnFailed);
                return true;

            }
            catch (err) {
                return false;
            }
        }

        function OnSucceeded(result, userContext, methodName) { }
        function OnFailed(error, userContext, methodName) { }

    </script>

    <style type="text/css">
        .IE8Fix {
            z-index: 100;
        }

        .handle {
            background: Black;
            width: 20px;
            height: 20px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="c_M" runat="server">
    <asp:UpdatePanel ID="up_E" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <uc4:Header ID="usc_Header" runat="server" />

            <uc5:MessageBox ID="usc_M" runat="server" />
            <asp:Panel ID="tbP" runat="server" CssClass="w-bar">

                <asp:LinkButton runat="server" ID="tbl_New" CssClass="w-button" Style="background: url(../images/add32.png); " OnClick="OnNew">
                    <asp:Label ID="tbl_NewLabel" runat="server"></asp:Label>

                </asp:LinkButton>

            </asp:Panel>
            <div style="display: none;">
                <asp:Button ID="btnSelectionPBTrigger" runat="server" OnClick="OnSelectNode" />
                <asp:TextBox ID="txtSelectedNode" runat="server"></asp:TextBox>
                <asp:TextBox ID="txtMessage" runat="server"></asp:TextBox>
            </div>
            <table style="width: 100%">
                <tr style="vertical-align: top;">
                    <td style="width: 400px;">
                        <div style="vertical-align: top;">
                            <asp:Panel ID="pt" runat="server" ScrollBars="Both" CssClass="c3boxleft">
                                <ct:ASTreeView ID="astvMyTree" runat="server" BasePath="~/scripts/ASTJavascript/astreeview/"
                                    DataTableRootNodeValue="0"
                                    EnableRoot="false"
                                    EnableNodeSelection="true"
                                    EnableCheckbox="false"
                                    EnableDragDrop="true"
                                    EnableTreeLines="false"
                                    EnableNodeIcon="true"
                                    EnableCustomizedNodeIcon="false"
                                    EnableContextMenu="false"
                                    EnableDebugMode="false"
                                    EnableAjaxOnEditDelete="true"
                                    AddNodeProvider="~/ConfigurationPages/ProjectUniverseConfigPage.aspx"
                                    LoadNodesProvider="~/ConfigurationPages/ProjectUniverseConfigPage.aspx"
                                    AdditionalLoadNodesRequestParameters="{'t1':'ajaxLoad'}"
                                    OnNodeSelectedScript="nodeSelectHandler(elem);"
                                    EnableParentNodeExpand="true"
                                    EnableHorizontalLock="true"
                                    EnableContainerDragDrop="true"
                                    OnNodeDragAndDropCompleteScript="dndCompleteHandler( elem, newParent );"
                                    EnableOnNodeDragAndDropCompleteScriptReturn="true"
                                    Width="400" />
                            </asp:Panel>
                        </div>
                    </td>
                    <td>
                        <div>
                            <asp:Panel ID="pv" runat="server" Visible="False" CssClass="c3boxv">
                                <table>
                                    
                                    <tr>
                                        <td>
                                            <uc1:TextBoxEx ID="u_Name" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <uc2:MultilineTextBoxEx ID="u_Desc" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <hr class="ee" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="left" colspan="2" style="vertical-align:top;">
                                           
                                                <asp:Button ID="btn_Update" runat="server" Font-Bold="true" Text="Update" OnClick="OnActionButtonsClick" />
                                                <asp:Button ID="btn_Add" runat="server" Font-Bold="true" Text="Add" OnClick="OnActionButtonsClick" />
                                                <asp:Button ID="btn_MakeARootLevel" runat="server" Font-Bold="true" Text="Add" OnClick="OnActionButtonsClick" />
                                                <asp:Button ID="lnkCancel" runat="server" OnClick="OnActionButtonsClick"/>
                                                <span class="tab"></span>
                                                <asp:Button ID="btn_Delete" runat="server" Text="Delete" ForeColor="Red" OnClick="OnActionButtonsClick"/>
                                            
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                        </div>
                    </td>
                </tr>
            </table>
            <div>
                <hr class="ee" />
                <img alt="" src="../images/handdrag16.png" />
                <asp:Label ID="lbl_DrapDropMessage" runat="server" Font-Italic="true" Font-Size="Smaller"
                    ForeColor="Gray"></asp:Label>
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="astvMyTree" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
