<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InsertFilesLink.aspx.cs" Inherits="ProcessDefinition.EditorModals.InsertFilesLink" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Insert File Link</title>
    <script src="../Scripts/jquery-1.6.3.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
    <script src="../Scripts/InsertFilesLink.js" type="text/javascript"></script>
    <dp:CustomerUserCommandScriptMce ID="cScript" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <div>

    <div class="insertModalItems">
    
    <h3><asp:Label runat="server" ID="lblRootDir" /></h3>
        
<asp:ListView ID="lstdirItems" runat="server" ItemPlaceholderID="diritemList"
        EnableViewState="False" >

    <LayoutTemplate>
    <ul id="dirSelectImg">
        <asp:PlaceHolder id="diritemList" runat="server"/>
    </ul>
    </LayoutTemplate>

    <ItemTemplate>
    <li>
        &nbsp;<span class="blueIcon ui-icon ui-icon-folder-collapsed"> </span> <asp:LinkButton ID="btnDir" runat="server" CommandArgument='<%#Eval("Name") %>' Text='<%#Eval("Name") %>' OnCommand="btnDir_Command" />
    </li>
    </ItemTemplate>

    <EmptyDataTemplate>

    </EmptyDataTemplate>
</asp:ListView>
    
<asp:ListView ID="lstItems" runat="server" ItemPlaceholderID="itemList"
        EnableViewState="False" >

    <LayoutTemplate>
    <ul id="selectImg">
        <asp:PlaceHolder id="itemList" runat="server"/>
    </ul>
    </LayoutTemplate>

    <ItemTemplate>
    <li>
    <input type="checkbox" value='<%#String.Format("{3}/files/{0}/{2}{1}",DevProcess.ProcessDefinitionService.SessionFacade.GetRepository(),Eval("Name"),RootUrl,pd.R.GetReposRoot()) %>' />
    <a href='<%#String.Format("{3}/files/{0}/{2}{1}",DevProcess.ProcessDefinitionService.SessionFacade.GetRepository(),Eval("Name"),RootUrl,pd.R.GetReposRoot()) %>' target="_blank"><%#Eval("Name") %></a>
    </li>
    </ItemTemplate>

    <EmptyDataTemplate>

    </EmptyDataTemplate>
</asp:ListView>
</div>
<button id="btnSelectLinks" runat="server" class="ui-corner-all ui-state-default dpButton">Select</button><br />

    <label>Upload file:</label><asp:FileUpload ID="upload" runat="server" /><asp:Button ID="btnUpload" runat="server" OnClick="btnUpload_Click" Text="Upload" /><br />
    <dp:ValidatedTextBox ID="txtCreateDir" runat="server" LabelText="New folder" ValidationGroup="newFolder" />
    <asp:Button ID="btnNewFolder" runat="server" Text="Create folder" ValidationGroup="newFolder" OnClick="btnNewFolder_Click" />
        
    </div>
    </form>
</body>
</html>
