2019-01-22 09:31:47 +01:00
|
|
|
|
using Umbraco.Core.IO;
|
2018-12-05 14:28:07 +00:00
|
|
|
|
using Umbraco.Web.Models.Trees;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Trees
|
|
|
|
|
|
{
|
2019-01-22 09:31:47 +01:00
|
|
|
|
// this is not a section tree - do not mark with [Tree]
|
|
|
|
|
|
[CoreTree]
|
2018-12-05 14:28:07 +00:00
|
|
|
|
public class FilesTreeController : FileSystemTreeController
|
|
|
|
|
|
{
|
2019-01-22 09:31:47 +01:00
|
|
|
|
protected override IFileSystem FileSystem => new PhysicalFileSystem("~/");
|
2018-12-05 14:28:07 +00:00
|
|
|
|
|
2018-12-05 15:15:45 +00:00
|
|
|
|
private static readonly string[] ExtensionsStatic = { "*" };
|
2018-12-05 14:28:07 +00:00
|
|
|
|
|
2018-12-05 15:15:45 +00:00
|
|
|
|
protected override string[] Extensions => ExtensionsStatic;
|
|
|
|
|
|
|
|
|
|
|
|
protected override string FileIcon => "icon-document";
|
2018-12-05 14:28:07 +00:00
|
|
|
|
|
|
|
|
|
|
protected override void OnRenderFolderNode(ref TreeNode treeNode)
|
|
|
|
|
|
{
|
|
|
|
|
|
//TODO: This isn't the best way to ensure a noop process for clicking a node but it works for now.
|
|
|
|
|
|
treeNode.AdditionalData["jsClickCallback"] = "javascript:void(0);";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|