PageRenderTime 55ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/DesktopModules/Admin/FileManager/FileManager.ascx.cs

https://github.com/mailekah/AgapeConnect1
C# | 2499 lines | 1914 code | 132 blank | 453 comment | 99 complexity | dd438f47e13b1f24c0a6df29be52de39 MD5 | raw file
Possible License(s): BSD-3-Clause, Apache-2.0

Large files files are truncated, but you can click here to view the full file

  1. #region Copyright
  2. //
  3. // DotNetNukeŽ - http://www.dotnetnuke.com
  4. // Copyright (c) 2002-2012
  5. // by DotNetNuke Corporation
  6. //
  7. // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
  8. // documentation files (the "Software"), to deal in the Software without restriction, including without limitation
  9. // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
  10. // to permit persons to whom the Software is furnished to do so, subject to the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be included in all copies or substantial portions
  13. // of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  16. // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
  18. // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  19. // DEALINGS IN THE SOFTWARE.
  20. #endregion
  21. #region Usings
  22. using System;
  23. using System.Collections;
  24. using System.Collections.Generic;
  25. using System.Collections.Specialized;
  26. using System.Data;
  27. using System.IO;
  28. using System.Linq;
  29. using System.Text.RegularExpressions;
  30. using System.Threading;
  31. using System.Web;
  32. using System.Web.UI;
  33. using System.Web.UI.HtmlControls;
  34. using System.Web.UI.WebControls;
  35. using DotNetNuke.Common.Utilities;
  36. using DotNetNuke.Entities.Host;
  37. using DotNetNuke.Entities.Icons;
  38. using DotNetNuke.Entities.Modules;
  39. using DotNetNuke.Entities.Modules.Actions;
  40. using DotNetNuke.Entities.Portals;
  41. using DotNetNuke.Instrumentation;
  42. using DotNetNuke.Security;
  43. using DotNetNuke.Security.Permissions;
  44. using DotNetNuke.Services.Exceptions;
  45. using DotNetNuke.Services.FileSystem;
  46. using DotNetNuke.Services.Localization;
  47. using DotNetNuke.UI.Skins.Controls;
  48. using DotNetNuke.UI.Utilities;
  49. using DotNetNuke.UI.WebControls;
  50. using ICSharpCode.SharpZipLib.Zip;
  51. using Microsoft.VisualBasic;
  52. using DataCache = DotNetNuke.Common.Utilities.DataCache;
  53. using DNNTreeNode = DotNetNuke.UI.WebControls.TreeNode;
  54. using DNNTreeNodeCollection = DotNetNuke.UI.WebControls.TreeNodeCollection;
  55. using FileInfo = DotNetNuke.Services.FileSystem.FileInfo;
  56. using Globals = DotNetNuke.Common.Globals;
  57. #endregion
  58. namespace DotNetNuke.Modules.Admin.FileManager
  59. {
  60. /// -----------------------------------------------------------------------------
  61. /// Project : DotNetNuke
  62. /// Class : FileManager
  63. ///
  64. /// -----------------------------------------------------------------------------
  65. /// <summary>
  66. /// Supplies the functionality for uploading files to the Portal
  67. /// Synchronizing Files within the folder and the database
  68. /// and Provides status of available disk space for the portal
  69. /// as well as limiting uploads to the restricted allocated file space
  70. /// </summary>
  71. /// <remarks>
  72. /// </remarks>
  73. /// <history>
  74. /// [DYNST] 2/1/2004 Created
  75. /// [Jon Henning] 11/1/2004 Updated to use ClientAPI/DNNTree
  76. /// [cnurse] 12/2/2004 Database Synchronization added
  77. /// </history>
  78. /// -----------------------------------------------------------------------------
  79. public partial class FileManager : PortalModuleBase, IActionable, IClientAPICallbackEventHandler
  80. {
  81. #region "Private Members"
  82. private string _ErrorMessage =
  83. "<TABLE><TR><TD height=100% class=NormalRed>{0}</TD></TR><TR valign=bottom><TD align=center><INPUT id=btnClearError onclick=clearErrorMessage(); type=button value=OK></TD></TR></TABLE>";
  84. private SortedList<int, string> _folderMappings;
  85. #endregion
  86. #region "Protected Properties"
  87. protected bool IsAdminRole
  88. {
  89. get
  90. {
  91. return PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName);
  92. }
  93. }
  94. #endregion
  95. #region "Public Properties"
  96. public int FolderPortalID
  97. {
  98. get
  99. {
  100. if (IsHostMenu)
  101. {
  102. return Null.NullInteger;
  103. }
  104. else
  105. {
  106. return PortalId;
  107. }
  108. }
  109. }
  110. public string RootFolderName
  111. {
  112. get
  113. {
  114. if (ViewState["RootFolderName"] != null)
  115. {
  116. return ViewState["RootFolderName"].ToString();
  117. }
  118. else
  119. {
  120. return "";
  121. }
  122. }
  123. set
  124. {
  125. ViewState["RootFolderName"] = value;
  126. }
  127. }
  128. public string RootFolderPath
  129. {
  130. get
  131. {
  132. string _CurRootFolder;
  133. if (IsHostMenu)
  134. {
  135. _CurRootFolder = Globals.HostMapPath;
  136. }
  137. else
  138. {
  139. _CurRootFolder = PortalSettings.HomeDirectoryMapPath;
  140. }
  141. return _CurRootFolder;
  142. }
  143. }
  144. public string Sort
  145. {
  146. get
  147. {
  148. return ViewState["strSort"].ToString();
  149. }
  150. set
  151. {
  152. ViewState.Add("strSort", value);
  153. }
  154. }
  155. public string LastSort
  156. {
  157. get
  158. {
  159. return ViewState["strLastSort"].ToString();
  160. }
  161. set
  162. {
  163. ViewState.Add("strLastSort", value);
  164. }
  165. }
  166. public string FilterFiles
  167. {
  168. get
  169. {
  170. return ViewState["strFilterFiles"].ToString();
  171. }
  172. set
  173. {
  174. ViewState.Add("strFilterFiles", value);
  175. }
  176. }
  177. public string LastPath
  178. {
  179. get
  180. {
  181. return UnMaskPath(ClientAPI.GetClientVariable(Page, "LastPath"));
  182. }
  183. set
  184. {
  185. value = MaskPath(value);
  186. ClientAPI.RegisterClientVariable(Page, "LastPath", value, true);
  187. }
  188. }
  189. public string DestPath
  190. {
  191. get
  192. {
  193. return ClientAPI.GetClientVariable(Page, "DestPath");
  194. }
  195. set
  196. {
  197. ClientAPI.RegisterClientVariable(Page, "DestPath", value, true);
  198. }
  199. }
  200. public string SourcePath
  201. {
  202. get
  203. {
  204. return ClientAPI.GetClientVariable(Page, "SourcePath");
  205. }
  206. set
  207. {
  208. ClientAPI.RegisterClientVariable(Page, "SourcePath", value, true);
  209. }
  210. }
  211. public string MoveFiles
  212. {
  213. get
  214. {
  215. return ClientAPI.GetClientVariable(Page, "MoveFiles");
  216. }
  217. set
  218. {
  219. ClientAPI.RegisterClientVariable(Page, "MoveFiles", value, true);
  220. }
  221. }
  222. public bool IsRefresh
  223. {
  224. get
  225. {
  226. return Convert.ToBoolean(ClientAPI.GetClientVariable(Page, "IsRefresh"));
  227. }
  228. set
  229. {
  230. ClientAPI.RegisterClientVariable(Page, "IsRefresh", Convert.ToString(Convert.ToInt32(value)), true);
  231. }
  232. }
  233. public bool DisabledButtons
  234. {
  235. get
  236. {
  237. return Convert.ToBoolean(ClientAPI.GetClientVariable(Page, "DisabledButtons"));
  238. }
  239. set
  240. {
  241. ClientAPI.RegisterClientVariable(Page, "DisabledButtons", Convert.ToString(Convert.ToInt32(value)), true);
  242. }
  243. }
  244. public string MoveStatus
  245. {
  246. get
  247. {
  248. return ClientAPI.GetClientVariable(Page, "MoveStatus");
  249. }
  250. set
  251. {
  252. ClientAPI.RegisterClientVariable(Page, "MoveStatus", value, true);
  253. }
  254. }
  255. public string LastFolderPath
  256. {
  257. get
  258. {
  259. if (ViewState["LastFolderPath"] != null)
  260. {
  261. return ViewState["LastFolderPath"].ToString();
  262. }
  263. else
  264. {
  265. return "";
  266. }
  267. }
  268. set
  269. {
  270. ViewState["LastFolderPath"] = value;
  271. }
  272. }
  273. public int PageSize
  274. {
  275. get
  276. {
  277. return Convert.ToInt32(selPageSize.SelectedValue);
  278. }
  279. }
  280. public int PageIndex
  281. {
  282. get
  283. {
  284. if (ViewState["PageIndex"] != null)
  285. {
  286. return Convert.ToInt32(ViewState["PageIndex"]);
  287. }
  288. else
  289. {
  290. return 0;
  291. }
  292. }
  293. set
  294. {
  295. if (value >= 0 && value < dgFileList.PageCount)
  296. {
  297. ViewState["PageIndex"] = value;
  298. }
  299. }
  300. }
  301. private SortedList<int, string> FolderMappings
  302. {
  303. get
  304. {
  305. if (_folderMappings == null)
  306. {
  307. _folderMappings = new SortedList<int, string>();
  308. var folderMappingController = FolderMappingController.Instance;
  309. var folderMappings = folderMappingController.GetFolderMappings(FolderPortalID);
  310. folderMappings.ForEach(f => _folderMappings.Add(f.FolderMappingID, f.MappingName));
  311. }
  312. return _folderMappings;
  313. }
  314. }
  315. #endregion
  316. #region "Private Methods"
  317. protected bool HasPermission(string permissionKey)
  318. {
  319. var hasPermision = UserInfo.IsSuperUser;
  320. var strSourcePath = UnMaskPath(DestPath).Replace(RootFolderPath, "").Replace("\\", "/");
  321. var objFolder = FolderManager.Instance.GetFolder(FolderPortalID, strSourcePath);
  322. if (!hasPermision && objFolder != null)
  323. {
  324. hasPermision = IsEditable && FolderPermissionController.HasFolderPermission(objFolder.FolderPermissions, permissionKey);
  325. }
  326. return hasPermision;
  327. }
  328. /// -----------------------------------------------------------------------------
  329. /// <summary>
  330. /// Adds a File to the DataTable used for the File List grid
  331. /// </summary>
  332. /// <param name="tblFiles">The DataTable</param>
  333. /// <param name="objFile">The FileInfo object to add</param>
  334. /// <remarks>
  335. /// </remarks>
  336. /// <history>
  337. /// [cnurse] 12/3/2004 documented
  338. /// [cnurse] 04/24/2006 Updated to use new Secure Storage
  339. /// </history>
  340. /// -----------------------------------------------------------------------------
  341. private void AddFileToTable(DataTable tblFiles, FileInfo objFile)
  342. {
  343. DataRow dRow = tblFiles.NewRow();
  344. dRow["FileType"] = "File";
  345. dRow["FileId"] = objFile.FileId;
  346. dRow["FileName"] = objFile.FileName;
  347. dRow["FileSize"] = objFile.Size.ToString("##,##0");
  348. dRow["IntFileSize"] = objFile.Size;
  349. if (!String.IsNullOrEmpty(objFile.Extension) || objFile.Extension != null)
  350. {
  351. dRow["Extension"] = objFile.Extension;
  352. }
  353. else
  354. {
  355. dRow["Extension"] = "none";
  356. }
  357. if (objFile.SupportsFileAttributes)
  358. {
  359. dRow["SupportsFileAttributes"] = true;
  360. if (objFile.FileAttributes.HasValue)
  361. {
  362. dRow["DateModified"] = objFile.LastModificationTime;
  363. dRow["Archive"] = objFile.FileAttributes.Value & FileAttributes.Archive;
  364. dRow["ReadOnly"] = objFile.FileAttributes.Value & FileAttributes.ReadOnly;
  365. dRow["Hidden"] = objFile.FileAttributes.Value & FileAttributes.Hidden;
  366. dRow["System"] = objFile.FileAttributes.Value & FileAttributes.System;
  367. dRow["AttributeString"] = GetAttributeString(objFile.FileAttributes.Value);
  368. }
  369. }
  370. else
  371. {
  372. dRow["SupportsFileAttributes"] = false;
  373. dRow["Archive"] = false;
  374. dRow["ReadOnly"] = false;
  375. dRow["Hidden"] = false;
  376. dRow["System"] = false;
  377. dRow["AttributeString"] = "";
  378. }
  379. tblFiles.Rows.Add(dRow);
  380. }
  381. /// -----------------------------------------------------------------------------
  382. /// <summary>
  383. /// Adds node to tree
  384. /// </summary>
  385. /// <param name="strName">Name of folder to display</param>
  386. /// <param name="strKey">Masked Key of folder location</param>
  387. /// <param name="eImage">Type of image</param>
  388. /// <param name="objNodes">Node collection to add to</param>
  389. /// <returns></returns>
  390. /// <remarks>
  391. /// </remarks>
  392. /// <history>
  393. /// [Jon Henning] 10/26/2004 Created
  394. /// [Jon Henning] 8/24/2005 Added Populate on Demand (POD) logic
  395. /// </history>
  396. /// -----------------------------------------------------------------------------
  397. private DNNTreeNode AddNode(string strName, string strKey, int imageIndex, DNNTreeNodeCollection objNodes)
  398. {
  399. DNNTreeNode objNode;
  400. objNode = new DNNTreeNode(HttpUtility.HtmlEncode(strName));
  401. objNode.Key = strKey;
  402. objNode.ToolTip = strName;
  403. objNode.ImageIndex = imageIndex;
  404. objNode.CssClass = "FileManagerTreeNode";
  405. objNodes.Add(objNode);
  406. if (objNode.Key == DestPath)
  407. {
  408. objNode.Selected = true;
  409. objNode.MakeNodeVisible();
  410. }
  411. return objNode;
  412. }
  413. /// -----------------------------------------------------------------------------
  414. /// <summary>
  415. /// Adds node to tree
  416. /// </summary>
  417. /// <param name="folder">The FolderInfo object to add</param>
  418. /// <param name="objNodes">Node collection to add to</param>
  419. /// <returns></returns>
  420. /// <remarks>
  421. /// </remarks>
  422. /// <history>
  423. /// [cnurse] 04/24/2006 Created
  424. /// </history>
  425. /// -----------------------------------------------------------------------------
  426. private DNNTreeNode AddNode(FolderInfo folder, DNNTreeNodeCollection objNodes)
  427. {
  428. DNNTreeNode objNode;
  429. string strName = folder.FolderName;
  430. string strKey = MaskPath(RootFolderPath + folder.FolderPath);
  431. var subFolders = FolderManager.Instance.GetFolders(folder).ToList();
  432. var imageIndex = FolderMappings.IndexOfKey(folder.FolderMappingID);
  433. objNode = AddNode(strName, strKey, imageIndex, objNodes);
  434. objNode.HasNodes = subFolders.Count > 0;
  435. return objNode;
  436. }
  437. /// -----------------------------------------------------------------------------
  438. /// <summary>
  439. /// BindFileList
  440. /// </summary>
  441. /// <remarks>
  442. /// </remarks>
  443. /// <history>
  444. /// [Jon Henning] 11/1/2004 Created
  445. /// </history>
  446. /// -----------------------------------------------------------------------------
  447. private void BindFileList()
  448. {
  449. string strCurPage;
  450. LastPath = PathUtils.Instance.RemoveTrailingSlash(UnMaskPath(DestPath));
  451. dgFileList.PageSize = PageSize;
  452. dgFileList.CurrentPageIndex = PageIndex;
  453. var folderPath = PathUtils.Instance.StripFolderPath(DestPath).Replace("\\", "/");
  454. if (Host.EnableFileAutoSync)
  455. {
  456. FolderManager.Instance.Synchronize(FolderPortalID, folderPath, false, true);
  457. }
  458. GetFilesByFolder(folderPath);
  459. if (dgFileList.PageCount > 1)
  460. {
  461. tblMessagePager.Visible = true;
  462. strCurPage = Localization.GetString("Pages");
  463. lblCurPage.Text = string.Format(strCurPage, (dgFileList.CurrentPageIndex + 1), (dgFileList.PageCount));
  464. lnkMoveFirst.Text = "<img border=0 Alt='" + Localization.GetString("First") + "' src='" + IconController.IconURL("MoveFirst") + "'>";
  465. lnkMovePrevious.Text = "<img border=0 Alt='" + Localization.GetString("Previous") + "' src='" + IconController.IconURL("MovePrevious") + "'>";
  466. lnkMoveNext.Text = "<img border=0 Alt='" + Localization.GetString("Next") + "' src='" + IconController.IconURL("MoveNext") + "'>";
  467. lnkMoveLast.Text = "<img border=0 Alt='" + Localization.GetString("Last") + "' src='" + IconController.IconURL("Movelast") + "'>";
  468. }
  469. else
  470. {
  471. tblMessagePager.Visible = false;
  472. }
  473. lblCurFolder.Text = Regex.Replace(DestPath, "^0\\\\", RootFolderName + "\\");
  474. MoveFiles = "";
  475. UpdateSpaceUsed();
  476. }
  477. /// -----------------------------------------------------------------------------
  478. /// <summary>
  479. ///
  480. /// </summary>
  481. /// <remarks>
  482. /// </remarks>
  483. /// <history>
  484. /// [cpaterra] 4/6/2006 Created
  485. /// </history>
  486. /// -----------------------------------------------------------------------------
  487. private void BindStorageLocationTypes()
  488. {
  489. ddlStorageLocation.Items.Clear();
  490. foreach (var folderMapping in FolderMappingController.Instance.GetFolderMappings(FolderPortalID))
  491. {
  492. ddlStorageLocation.Items.Add(new ListItem(folderMapping.MappingName, folderMapping.FolderMappingID.ToString()));
  493. }
  494. }
  495. /// -----------------------------------------------------------------------------
  496. /// <summary>
  497. /// The BindFolderTree helper method is used to bind the list of
  498. /// files for this portal or for the hostfolder, to an asp:DATAGRID server control
  499. /// </summary>
  500. /// <remarks>
  501. /// </remarks>
  502. /// <history>
  503. /// [DYNST] 2/1/2004 Created
  504. /// [Jon Henning] 11/1/2004 Updated to use ClientAPI/DNNTree
  505. /// [cnurse] 12/2/2004 Updated to use Localization for Root
  506. /// [Jon Henning] 8/24/2005 Added Populate on Demand (POD) logic
  507. /// [cnurse] 04/24/2006 Updated to use new Secure Storage
  508. /// </history>
  509. /// -----------------------------------------------------------------------------
  510. private void BindFolderTree()
  511. {
  512. DNNTreeNode objNode;
  513. //Clear the Tree Nodes Collection
  514. DNNTree.TreeNodes.Clear();
  515. objNode = AddNode(RootFolderName, MaskPath(RootFolderPath), FolderMappings.IndexOfValue("Standard"), DNNTree.TreeNodes);
  516. var folders = FolderManager.Instance.GetFolders(FolderPortalID).ToList();
  517. objNode.HasNodes = folders.Count > 1;
  518. if (DNNTree.PopulateNodesFromClient == false || DNNTree.IsDownLevel)
  519. {
  520. PopulateTree(objNode.TreeNodes, RootFolderPath);
  521. }
  522. if (DNNTree.SelectedTreeNodes.Count == 0)
  523. {
  524. objNode.Selected = true;
  525. }
  526. }
  527. /// -----------------------------------------------------------------------------
  528. /// <summary>
  529. /// GeneratePermissionsGrid generates the permissions grid for the folder
  530. /// </summary>
  531. /// <remarks>
  532. /// </remarks>
  533. /// <history>
  534. /// [cnurse] 12/2/2004 documented
  535. /// </history>
  536. /// -----------------------------------------------------------------------------
  537. private void GeneratePermissionsGrid()
  538. {
  539. var folderPath = PathUtils.Instance.StripFolderPath(DestPath).Replace("\\", "/");
  540. dgPermissions.FolderPath = folderPath;
  541. var objFolderInfo = FolderManager.Instance.GetFolder(FolderPortalID, folderPath);
  542. if (objFolderInfo != null && ddlStorageLocation.Items.FindByValue(Convert.ToString(objFolderInfo.FolderMappingID)) != null)
  543. {
  544. ddlStorageLocation.SelectedValue = Convert.ToString(objFolderInfo.FolderMappingID);
  545. phSecureFolderWarning.Visible = !objFolderInfo.IsStorageSecure;
  546. }
  547. }
  548. /// -----------------------------------------------------------------------------
  549. /// <summary>
  550. /// GetAttributeString generates the attributes string from the FileAttributes
  551. /// </summary>
  552. /// <remarks>
  553. /// </remarks>
  554. /// <history>
  555. /// [cnurse] 12/2/2004 documented
  556. /// </history>
  557. /// -----------------------------------------------------------------------------
  558. private string GetAttributeString(FileAttributes attributes)
  559. {
  560. string strResult = "";
  561. if ((attributes & FileAttributes.Archive) == FileAttributes.Archive)
  562. {
  563. strResult += "A";
  564. }
  565. if ((attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
  566. {
  567. strResult += "R";
  568. }
  569. if ((attributes & FileAttributes.Hidden) == FileAttributes.Hidden)
  570. {
  571. strResult += "H";
  572. }
  573. if ((attributes & FileAttributes.System) == FileAttributes.System)
  574. {
  575. strResult += "S";
  576. }
  577. return strResult;
  578. }
  579. /// -----------------------------------------------------------------------------
  580. /// <summary>
  581. /// GetFilesByFolder gets the Files/Folders to display
  582. /// </summary>
  583. /// <remarks>
  584. /// </remarks>
  585. /// <history>
  586. /// [cnurse] 12/2/2004 documented and modified to display Folders in
  587. /// the grid
  588. /// [cnurse] 04/24/2006 Updated to use new Secure Storage
  589. /// </history>
  590. /// -----------------------------------------------------------------------------
  591. private void GetFilesByFolder(string strFolderName)
  592. {
  593. DataTable tblFiles = GetFileTable();
  594. var objFolder = FolderManager.Instance.GetFolder(FolderPortalID, strFolderName);
  595. if (objFolder != null)
  596. {
  597. var arrFiles = FolderManager.Instance.GetFiles(objFolder);
  598. foreach (FileInfo objFile in arrFiles)
  599. {
  600. AddFileToTable(tblFiles, objFile);
  601. }
  602. }
  603. var dv = new DataView();
  604. dv.Table = tblFiles;
  605. dv.Sort = Sort;
  606. if (!String.IsNullOrEmpty(FilterFiles))
  607. {
  608. dv.RowFilter = "FileName like '%" + FilterFiles + "%'";
  609. }
  610. dgFileList.DataSource = dv;
  611. dgFileList.DataBind();
  612. }
  613. /// -----------------------------------------------------------------------------
  614. /// <summary>
  615. /// GetFileTable creates the DataTable used to store the list of files and folders
  616. /// </summary>
  617. /// <remarks>
  618. /// </remarks>
  619. /// <history>
  620. /// [cnurse] 12/3/2004 documented and modified to display Folders in
  621. /// the grid
  622. /// </history>
  623. /// -----------------------------------------------------------------------------
  624. private DataTable GetFileTable()
  625. {
  626. var tblFiles = new DataTable("Files");
  627. var myColumns = new DataColumn();
  628. myColumns.DataType = Type.GetType("System.String");
  629. myColumns.ColumnName = "FileType";
  630. tblFiles.Columns.Add(myColumns);
  631. myColumns = new DataColumn();
  632. myColumns.DataType = Type.GetType("System.Int32");
  633. myColumns.ColumnName = "FileId";
  634. tblFiles.Columns.Add(myColumns);
  635. myColumns = new DataColumn();
  636. myColumns.DataType = Type.GetType("System.String");
  637. myColumns.ColumnName = "FileName";
  638. tblFiles.Columns.Add(myColumns);
  639. myColumns = new DataColumn();
  640. myColumns.DataType = Type.GetType("System.String");
  641. myColumns.ColumnName = "FileSize";
  642. tblFiles.Columns.Add(myColumns);
  643. myColumns = new DataColumn();
  644. myColumns.DataType = Type.GetType("System.Int32");
  645. myColumns.ColumnName = "IntFileSize";
  646. tblFiles.Columns.Add(myColumns);
  647. myColumns = new DataColumn();
  648. myColumns.DataType = Type.GetType("System.DateTime");
  649. myColumns.ColumnName = "DateModified";
  650. tblFiles.Columns.Add(myColumns);
  651. myColumns = new DataColumn();
  652. myColumns.DataType = Type.GetType("System.Boolean");
  653. myColumns.ColumnName = "ReadOnly";
  654. tblFiles.Columns.Add(myColumns);
  655. myColumns = new DataColumn();
  656. myColumns.DataType = Type.GetType("System.Boolean");
  657. myColumns.ColumnName = "Hidden";
  658. tblFiles.Columns.Add(myColumns);
  659. myColumns = new DataColumn();
  660. myColumns.DataType = Type.GetType("System.Boolean");
  661. myColumns.ColumnName = "System";
  662. tblFiles.Columns.Add(myColumns);
  663. myColumns = new DataColumn();
  664. myColumns.DataType = Type.GetType("System.Boolean");
  665. myColumns.ColumnName = "Archive";
  666. tblFiles.Columns.Add(myColumns);
  667. myColumns = new DataColumn();
  668. myColumns.DataType = Type.GetType("System.String");
  669. myColumns.ColumnName = "AttributeString";
  670. tblFiles.Columns.Add(myColumns);
  671. myColumns = new DataColumn();
  672. myColumns.DataType = Type.GetType("System.String");
  673. myColumns.ColumnName = "Extension";
  674. tblFiles.Columns.Add(myColumns);
  675. myColumns = new DataColumn();
  676. myColumns.DataType = Type.GetType("System.Boolean");
  677. myColumns.ColumnName = "SupportsFileAttributes";
  678. tblFiles.Columns.Add(myColumns);
  679. return tblFiles;
  680. }
  681. /// -----------------------------------------------------------------------------
  682. /// <summary>
  683. /// Gets the size of the all the files in the zip file
  684. /// </summary>
  685. /// <remarks>
  686. /// </remarks>
  687. /// <history>
  688. /// [cnurse] 12/4/2004 Created
  689. /// </history>
  690. /// -----------------------------------------------------------------------------
  691. private long GetZipFileExtractSize(string strFileName)
  692. {
  693. ZipEntry objZipEntry;
  694. ZipInputStream objZipInputStream;
  695. try
  696. {
  697. objZipInputStream = new ZipInputStream(File.OpenRead(strFileName));
  698. }
  699. catch (Exception ex)
  700. {
  701. DnnLog.Error(ex);
  702. ShowErrorMessage(MaskString(ex.Message));
  703. return -1;
  704. }
  705. objZipEntry = objZipInputStream.GetNextEntry();
  706. long iTemp = 0;
  707. while (objZipEntry != null)
  708. {
  709. iTemp = iTemp + objZipEntry.Size;
  710. objZipEntry = objZipInputStream.GetNextEntry();
  711. }
  712. objZipInputStream.Close();
  713. return iTemp;
  714. }
  715. /// -----------------------------------------------------------------------------
  716. /// <summary>
  717. /// Sets common properties on DNNTree control
  718. /// </summary>
  719. /// <remarks>
  720. /// </remarks>
  721. /// <history>
  722. /// [Jon Henning] 11/1/2004 Created
  723. /// [Jon Henning] 8/24/2005 Added Populate on Demand (POD) logic
  724. /// </history>
  725. /// -----------------------------------------------------------------------------
  726. private void InitializeTree()
  727. {
  728. DNNTree.SystemImagesPath = ResolveUrl("~/images/");
  729. PreloadFolderImages();
  730. DNNTree.ImageList.Add(IconController.IconURL("File"));
  731. DNNTree.IndentWidth = 10;
  732. DNNTree.CollapsedNodeImage = IconController.IconURL("Max","12X12");
  733. DNNTree.ExpandedNodeImage = IconController.IconURL("Min", "12X12");
  734. DNNTree.PopulateNodesFromClient = true;
  735. DNNTree.JSFunction = "nodeSelected();";
  736. }
  737. private void PreloadFolderImages()
  738. {
  739. IFolderMappingController folderMappingController = FolderMappingController.Instance;
  740. FolderMappingInfo folderMappingInfo = null;
  741. string imageUrl = String.Empty;
  742. foreach (var folderMapping in FolderMappings)
  743. {
  744. folderMappingInfo = folderMappingController.GetFolderMapping(folderMapping.Key);
  745. imageUrl = folderMappingInfo.ImageUrl;
  746. DNNTree.ImageList.Add(imageUrl);
  747. }
  748. }
  749. private void ManageToolbarButton(HtmlGenericControl wrapperControl, Image imageControl, string js, string imageRootName, bool enableButton)
  750. {
  751. if (enableButton)
  752. {
  753. wrapperControl.Attributes.Add("style", "cursor: pointer");
  754. wrapperControl.Attributes.Add("onclick", js);
  755. imageControl.ImageUrl = IconController.IconURL(imageRootName);
  756. }
  757. else
  758. {
  759. wrapperControl.Attributes.Remove("style");
  760. wrapperControl.Attributes.Remove("onclick");
  761. imageControl.ImageUrl = IconController.IconURL(imageRootName + "Disabled");
  762. }
  763. }
  764. private void ManageSecurity()
  765. {
  766. ManageToolbarButton(addFolder, lnkAddFolderIMG, "return canAddFolder();", "AddFolder", HasPermission("ADD"));
  767. ManageToolbarButton(deleteFolder, lnkDelFolderIMG, "return deleteFolder();", "DeleteFolder", HasPermission("DELETE"));
  768. ManageToolbarButton(syncFolder, lnkSyncFolderIMG, "__doPostBack(m_sUCPrefixName + 'lnkSyncFolder', '');", "Synchronize", HasPermission("MANAGE"));
  769. chkRecursive.Enabled = HasPermission("MANAGE");
  770. ManageToolbarButton(refresh, lnkRefreshIMG, "__doPostBack(m_sUCPrefixName + 'lnkRefresh', '');", "Refresh", true);
  771. ManageToolbarButton(copy, lnkCopy, "copyCheckedFiles();", "CopyFile", HasPermission("COPY"));
  772. ManageToolbarButton(move, lnkMove, "moveFiles();", "MoveFile", HasPermission("COPY"));
  773. ManageToolbarButton(upload, lnkUploadIMG, "__doPostBack(m_sUCPrefixName + 'lnkUpload', '');", "UploadFile", HasPermission("ADD"));
  774. ManageToolbarButton(delete, lnkDelete, "deleteCheckedFiles();", "Delete", HasPermission("DELETE"));
  775. ManageToolbarButton(filter, lnkFilterIMG, "__doPostBack(m_sUCPrefixName + 'lnkFilter', '');", "Search", true);
  776. lnkCopy.Enabled = IsEditable;
  777. lnkMove.Enabled = IsEditable;
  778. lnkUpload.Enabled = IsEditable;
  779. lnkDelete.Enabled = IsEditable;
  780. }
  781. /// -----------------------------------------------------------------------------
  782. /// <summary>
  783. /// Masks the path
  784. /// </summary>
  785. /// <remarks>
  786. /// </remarks>
  787. /// <history>
  788. /// [Jon Henning] 11/1/2004 Created
  789. /// </history>
  790. /// -----------------------------------------------------------------------------
  791. private string MaskPath(string strOrigPath)
  792. {
  793. return strOrigPath.Replace(PathUtils.Instance.RemoveTrailingSlash(RootFolderPath), "0").Replace("/", "\\");
  794. }
  795. /// -----------------------------------------------------------------------------
  796. /// <summary>
  797. /// Masks a string
  798. /// </summary>
  799. /// <remarks>
  800. /// </remarks>
  801. /// <history>
  802. /// [Jon Henning] 11/1/2004 Created
  803. /// </history>
  804. /// -----------------------------------------------------------------------------
  805. private string MaskString(string strSource)
  806. {
  807. var search = PathUtils.Instance.RemoveTrailingSlash(RootFolderPath).ToUpper();
  808. var replace = Localization.GetString("PortalRoot", LocalResourceFile);
  809. var result = "";
  810. var temp = strSource.ToUpper();
  811. var position = temp.IndexOf(search);
  812. while (position >= 0)
  813. {
  814. result += strSource.Substring(0, position) + replace;
  815. strSource = strSource.Substring(position + search.Length);
  816. temp = temp.Substring(position + search.Length);
  817. position = temp.IndexOf(search);
  818. }
  819. return result + strSource;
  820. }
  821. /// -----------------------------------------------------------------------------
  822. /// <summary>
  823. /// Populates DNNTree control with folder hiearachy
  824. /// </summary>
  825. /// <param name="objNodes">Node collection to add children to</param>
  826. /// <param name="strPath">Path of parent node</param>
  827. /// <remarks>
  828. /// </remarks>
  829. /// <history>
  830. /// [Jon Henning] 10/26/2004 Created
  831. /// [Jon Henning] 8/24/2005 Added Populate on Demand (POD) logic
  832. /// [cnurse] 04/24/2006 Updated to use new Secure Storage
  833. /// </history>
  834. /// -----------------------------------------------------------------------------
  835. private void PopulateTree(DNNTreeNodeCollection objNodes, string strPath)
  836. {
  837. var folderPath = strPath.Replace(RootFolderPath, "").Replace("\\", "/");
  838. var parentFolder = FolderManager.Instance.GetFolder(FolderPortalID, folderPath);
  839. var folders = FolderManager.Instance.GetFolders(parentFolder);
  840. DNNTreeNode objNode;
  841. //Iterate through the SubFolders
  842. foreach (var folder in folders)
  843. {
  844. if (FolderPermissionController.CanViewFolder((FolderInfo)folder))
  845. {
  846. objNode = AddNode((FolderInfo)folder, objNodes);
  847. if (DNNTree.PopulateNodesFromClient == false)
  848. {
  849. PopulateTree(objNode.TreeNodes, folder.FolderPath);
  850. }
  851. }
  852. }
  853. }
  854. private void SetFolder(DNNTreeNode node)
  855. {
  856. dgFileList.EditItemIndex = -1;
  857. if (DNNTree.IsDownLevel)
  858. {
  859. DestPath = node.Key;
  860. LastPath = node.Key;
  861. }
  862. ManageSecurity();
  863. BindFileList();
  864. GeneratePermissionsGrid();
  865. }
  866. /// -----------------------------------------------------------------------------
  867. /// <summary>
  868. /// Sets up the file manager for Edit Mode
  869. /// </summary>
  870. /// <remarks>
  871. /// </remarks>
  872. /// <history>
  873. /// [Jon Henning] 11/1/2004 Created
  874. /// </history>
  875. /// -----------------------------------------------------------------------------
  876. private void SetEditMode()
  877. {
  878. if (dgFileList.EditItemIndex > -1)
  879. {
  880. //In Edit Mode
  881. int intCount = dgFileList.Items.Count;
  882. CheckBox chkFile2;
  883. CheckBox chkFile;
  884. ImageButton lnkDeleteFile;
  885. ImageButton lnkEditFile;
  886. int i;
  887. for (i = 0; i <= intCount - 1; i++)
  888. {
  889. if (i != dgFileList.EditItemIndex)
  890. {
  891. chkFile2 = (CheckBox) dgFileList.Items[i].FindControl("chkFile2");
  892. chkFile = (CheckBox) dgFileList.Items[i].FindControl("chkFile");
  893. lnkDeleteFile = (ImageButton) dgFileList.Items[i].FindControl("lnkDeleteFile");
  894. lnkEditFile = (ImageButton) dgFileList.Items[i].FindControl("lnkEditFile");
  895. if ((chkFile2) != null)
  896. {
  897. chkFile2.Enabled = false;
  898. }
  899. if ((chkFile) != null)
  900. {
  901. chkFile.Enabled = false;
  902. }
  903. if ((lnkDeleteFile) != null)
  904. {
  905. lnkDeleteFile.Enabled = false;
  906. lnkDeleteFile.ImageUrl = IconController.IconURL("TrashDisabled");
  907. lnkDeleteFile.AlternateText = "";
  908. }
  909. if ((lnkEditFile) != null)
  910. {
  911. lnkEditFile.Enabled = false;
  912. lnkEditFile.ImageUrl = IconController.IconURL("EditDisabled");
  913. lnkEditFile.AlternateText = "";
  914. }
  915. chkFile2 = null;
  916. chkFile = null;
  917. lnkDeleteFile = null;
  918. lnkEditFile = null;
  919. }
  920. }
  921. DisabledButtons = true;
  922. }
  923. else
  924. {
  925. }
  926. dgFileList.Columns[0].HeaderStyle.Width = Unit.Percentage(5);
  927. dgFileList.Columns[1].HeaderStyle.Width = Unit.Percentage(25);
  928. dgFileList.Columns[2].HeaderStyle.Width = Unit.Percentage(25);
  929. dgFileList.Columns[3].HeaderStyle.Width = Unit.Percentage(7);
  930. dgFileList.Columns[4].HeaderStyle.Width = Unit.Percentage(15);
  931. }
  932. /// -----------------------------------------------------------------------------
  933. /// <summary>
  934. /// Sets up the Error Message
  935. /// </summary>
  936. /// <remarks>
  937. /// </remarks>
  938. /// <history>
  939. /// [Jon Henning] 11/1/2004 Created
  940. /// </history>
  941. /// -----------------------------------------------------------------------------
  942. private void ShowErrorMessage(string strMessage)
  943. {
  944. strMessage = strMessage.Replace("\\", "\\\\");
  945. strMessage = strMessage.Replace("'", "\\'");
  946. strMessage = strMessage.Replace(Environment.NewLine, "\\n");
  947. strMessage = string.Format(_ErrorMessage, strMessage);
  948. ClientAPI.RegisterClientVariable(Page, "ErrorMessage", strMessage, true);
  949. }
  950. /// -----------------------------------------------------------------------------
  951. /// <summary>
  952. /// Synchronizes the complete File System
  953. /// </summary>
  954. /// <remarks>
  955. /// </remarks>
  956. /// <history>
  957. /// [Jon Henning] 11/1/2004 Created
  958. /// </history>
  959. /// -----------------------------------------------------------------------------
  960. private void Synchronize()
  961. {
  962. if (IsHostMenu)
  963. {
  964. FolderManager.Instance.Synchronize(Null.NullInteger);
  965. }
  966. else
  967. {
  968. FolderManager.Instance.Synchronize(PortalId);
  969. }
  970. }
  971. /// -----------------------------------------------------------------------------
  972. /// <summary>
  973. /// Unmasks the path
  974. /// </summary>
  975. /// <remarks>
  976. /// </remarks>
  977. /// <history>
  978. /// [Jon Henning] 11/1/2004 Created
  979. /// </history>
  980. /// -----------------------------------------------------------------------------
  981. private string UnMaskPath(string strOrigPath)
  982. {
  983. strOrigPath = PathUtils.Instance.AddTrailingSlash(RootFolderPath) + PathUtils.Instance.StripFolderPath(strOrigPath);
  984. return strOrigPath.Replace("/", "\\");
  985. }
  986. /// -----------------------------------------------------------------------------
  987. /// <summary>
  988. /// Updates the space Used label
  989. /// </summary>
  990. /// <remarks>
  991. /// </remarks>
  992. /// <history>
  993. /// [Jon Henning] 11/1/2004 Created
  994. /// </history>
  995. /// -----------------------------------------------------------------------------
  996. private void UpdateSpaceUsed()
  997. {
  998. string strDestFolder = PathUtils.Instance.AddTrailingSlash(UnMaskPath(DestPath));
  999. var objPortalController = new PortalController();
  1000. string strUsed;
  1001. string strQuota;
  1002. if (PortalSettings.HostSpace == 0)
  1003. {
  1004. strQuota = Localization.GetString("UnlimitedSpace", LocalResourceFile);
  1005. }
  1006. else
  1007. {
  1008. strQuota = PortalSettings.HostSpace + "MB";
  1009. }
  1010. if (IsHostMenu)
  1011. {
  1012. lblFileSpace.Text = "&nbsp;";
  1013. }
  1014. else
  1015. {
  1016. long spaceUsed = objPortalController.GetPortalSpaceUsedBytes(FolderPortalID);
  1017. if (spaceUsed < 1024)
  1018. {
  1019. strUsed = spaceUsed.ToString("0.00") + "B";
  1020. }
  1021. else if (spaceUsed < (1024*1024))
  1022. {
  1023. strUsed = (spaceUsed/1024).ToString("0.00") + "KB";
  1024. }
  1025. else
  1026. {
  1027. strUsed = (spaceUsed/(1024*1024)).ToString("0.00") + "MB";
  1028. }
  1029. lblFileSpace.Text = string.Format(Localization.GetString("SpaceUsed", LocalResourceFile), strUsed, strQuota);
  1030. }
  1031. }
  1032. #endregion
  1033. #region "Protected Methods"
  1034. /// -----------------------------------------------------------------------------
  1035. /// <summary>
  1036. /// The DeleteFiles helper method is used to delete the files in the list
  1037. /// </summary>
  1038. /// <remarks>
  1039. /// </remarks>
  1040. /// <param name="strFiles">The list of files to delete</param>
  1041. /// <history>
  1042. /// [DYNST] 2/1/2004 Created
  1043. /// [Jon Henning] 11/1/2004 Updated to use ClientAPI/DNNTree
  1044. /// </history>
  1045. /// -----------------------------------------------------------------------------
  1046. protected void DeleteFiles(string strFiles)
  1047. {
  1048. var arFiles = strFiles.Split(';');
  1049. if (arFiles.Length == 0)
  1050. {
  1051. return;
  1052. }
  1053. var strErrorMessage = "";
  1054. var strSourcePath = Globals.GetSubFolderPath(PathUtils.Instance.AddTrailingSlash(LastPath) + arFiles[0], FolderPortalID);
  1055. var folder = FolderManager.Instance.GetFolder(FolderPortalID, strSourcePath);
  1056. for (var i = 0; i <= arFiles.Length - 1; i++)
  1057. {
  1058. if (!String.IsNullOrEmpty(arFiles[i]))
  1059. {
  1060. var file = Services.FileSystem.FileManager.Instance.GetFile(folder, arFiles[i]);
  1061. try
  1062. {
  1063. Services.FileSystem.FileManager.Instance.DeleteFile(file);
  1064. }
  1065. catch (Exception ex)
  1066. {
  1067. DnnLog.Error(ex);
  1068. strErrorMessage += Localization.GetString("ErrorDeletingFile", LocalResourceFile) +
  1069. PathUtils.Instance.AddTrailingSlash(UnMaskPath(DestPath)) +
  1070. arFiles[i] +
  1071. "<br/>&nbsp;&nbsp;&nbsp;" + ex.Message + "<br/>";
  1072. }
  1073. }
  1074. }
  1075. if (!String.IsNullOrEmpty(strErrorMessage))
  1076. {
  1077. strErrorMessage = MaskString(strErrorMessage);
  1078. ShowErrorMessage(strErrorMessage);
  1079. }
  1080. BindFileList();
  1081. }
  1082. /// -----------------------------------------------------------------------------
  1083. /// <summary>
  1084. /// Renders the page output
  1085. /// </summary>
  1086. /// <remarks>
  1087. /// </remarks>
  1088. /// <history>
  1089. /// [Jon Henning] 11/1/2004 Created
  1090. /// </history>
  1091. /// -----------------------------------------------------------------------------
  1092. protected override void Render(HtmlTextWriter output)
  1093. {
  1094. //mark various controls as valid for event validation
  1095. Page.ClientScript.RegisterForEventValidation(lnkAddFolder.UniqueID);
  1096. Page.ClientScript.RegisterForEventValidation(lnkDeleteFolder.UniqueID);
  1097. Page.ClientScript.RegisterForEventValidation(lnkDeleteAllCheckedFiles.UniqueID);
  1098. Page.ClientScript.RegisterForEventValidation(lnkRefresh.UniqueID);
  1099. Page.ClientScript.RegisterForEventValidation(lnkSelectFolder.UniqueID);
  1100. Page.ClientScript.RegisterForEventValidation(lnkSyncFolder.UniqueID);
  1101. Page.ClientScript.RegisterForEventValidation(lnkFilter.UniqueID);
  1102. Page.ClientScript.RegisterForEventValidation(lnkCopy.UniqueID);
  1103. Page.ClientScript.RegisterForEventValidation(lnkUpload.UniqueID);
  1104. Page.ClientScript.RegisterForEventValidation(lnkMove.UniqueID);
  1105. Page.ClientScript.RegisterForEventValidation(lnkMoveFirst.UniqueID);
  1106. Page.ClientScript.RegisterForEventValidation(lnkMoveLast.UniqueID);
  1107. Page.ClientScript.RegisterForEventValidation(lnkMoveNext.UniqueID);
  1108. Page.ClientScript.RegisterForEventValidation(lnkMovePrevious.UniqueID);
  1109. Page.ClientScript.RegisterForEventValidation(lnkMoveFiles.UniqueID);
  1110. if (dgFileList.Items.Count <= 10 && dgFileList.PageCount == 1)
  1111. {
  1112. dgFileList.PagerStyle.Visible = false;
  1113. }
  1114. base.Render(output);
  1115. }
  1116. #endregion
  1117. #region "Public Methods"
  1118. /// -----------------------------------------------------------------------------
  1119. /// <summary>
  1120. /// The CheckDestFolderAccess helper method Checks to make sure file copy/move
  1121. /// operation will not exceed portal available space
  1122. /// </summary>
  1123. /// <remarks>
  1124. /// </remarks>
  1125. /// <history>
  1126. /// [DYNST] 2/1/2004 Created
  1127. /// [Jon Henning] 11/1/2004 Updated to use ClientAPI/DNNTree
  1128. /// [cnurse] 12/2/2004 Updated to use Localization
  1129. /// </history>
  1130. /// -----------------------------------------------------------------------------
  1131. public string CheckDestFolderAccess(long intSize)
  1132. {
  1133. if (Request.IsAuthenticated)
  1134. {
  1135. string strDestFolder = PathUtils.Instance.AddTrailingSlash(UnMaskPath(DestPath));
  1136. var objPortalController = new PortalController();
  1137. if (objPortalController.HasSpaceAvailable(FolderPortalID, intSize) || Globals.IsHostTab(PortalSettings.ActiveTab.TabID))
  1138. {
  1139. return "";
  1140. }
  1141. else
  1142. {
  1143. return Localization.GetString("NotEnoughSpace", LocalResourceFile);
  1144. }
  1145. }
  1146. else
  1147. {
  1148. return Localization.GetString("PleaseLogin", LocalResourceFile);
  1149. }
  1150. }
  1151. /// -----------------------------------------------------------------------------
  1152. /// <summary>
  1153. /// Gets the Image associated with the File/Folder
  1154. /// </summary>
  1155. /// <remarks>
  1156. /// </remarks>
  1157. /// <history>
  1158. /// [cnurse] 12/4/2004 Created
  1159. /// </history>
  1160. /// -----------------------------------------------------------------------------
  1161. public string GetImageUrl(string type)
  1162. {
  1163. string url = "";
  1164. try
  1165. {
  1166. if (type == "folder")
  1167. {
  1168. url = IconController.IconURL("ExtClosedFolder");
  1169. }
  1170. else
  1171. {
  1172. if (!String.IsNullOrEmpty(type) && File.Exists(Server.MapPath(IconController.IconURL("Ext" + type))))
  1173. {
  1174. url = IconController.IconURL("Ext" + type);
  1175. }
  1176. else
  1177. {
  1178. url = IconController.IconURL("ExtFile");
  1179. }
  1180. }
  1181. }
  1182. catch (Exception exc) //Module failed to load
  1183. {
  1184. Exceptions.ProcessModuleLoadException(this, exc);
  1185. }
  1186. return url;
  1187. }
  1188. #endregion
  1189. #region "Event Handlers"
  1190. protected override void OnInit(EventArgs e)
  1191. {
  1192. base.OnInit(e);
  1193. cmdUpdate.Click += cmdUpdate_Click;
  1194. dgFileList.ItemDataBound += dgFileList_ItemDataBound;
  1195. dgFileList.SortCommand += dgFileList_SortCommand;
  1196. DNNTree.NodeClick += DNNTree_NodeClick;
  1197. DNNTree.PopulateOnDemand += DNNTree_PopulateOnDemand;
  1198. lnkAddFolder.Command += lnkAddFolder_Command;
  1199. lnkDeleteFolder.Command += lnkDelet…

Large files files are truncated, but you can click here to view the full file