Modify FileSystemTree Controller - that if * is used for file extension then we will return all files :)

This commit is contained in:
Warren Buckley
2018-12-05 15:15:45 +00:00
parent 28c4b2ee7f
commit 8425c3124d
2 changed files with 8 additions and 2 deletions

View File

@@ -57,6 +57,10 @@ namespace Umbraco.Web.Trees
var files = FileSystem.GetFiles(path).Where(x =>
{
var extension = Path.GetExtension(x);
if (Extensions.Contains("*"))
return true;
return extension != null && Extensions.Contains(extension.Trim('.'), StringComparer.InvariantCultureIgnoreCase);
});

View File

@@ -10,9 +10,11 @@ namespace Umbraco.Web.Trees
{
protected override IFileSystem FileSystem => new PhysicalFileSystem("~/"); // fixme inject
protected override string[] Extensions => new string[] { };
private static readonly string[] ExtensionsStatic = { "*" };
protected override string FileIcon => "icon-script";
protected override string[] Extensions => ExtensionsStatic;
protected override string FileIcon => "icon-document";
protected override void OnRenderFolderNode(ref TreeNode treeNode)
{