Merge branch 'U4-8198_file_system' of https://github.com/yannisgu/Umbraco-CMS into yannisgu-U4-8198_file_system

Conflicts:
	src/Umbraco.Web/Umbraco.Web.csproj
This commit is contained in:
Shannon
2016-03-30 16:07:45 +02:00
parent 3c697436b1
commit 74e1078c31
25 changed files with 476 additions and 647 deletions

View File

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http.Formatting;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
using Umbraco.Web.Models.Trees;
namespace Umbraco.Web.Trees
{
[Tree(Constants.Applications.Settings, Constants.Trees.Scripts, "Scripts", "icon-folder", "icon-folder", sortOrder: 2)]
public class ScriptsTreeController : FileSystemTreeController
{
protected override string FilePath
{
get { return SystemDirectories.Scripts + "/"; }
}
protected override IEnumerable<string> FileSearchPattern
{
get { return UmbracoConfig.For.UmbracoSettings().Content.ScriptFileTypes; }
}
protected override string EditFormUrl
{
get { return "settings/scripts/editScript.aspx?file={0}"; }
}
protected override bool EnableCreateOnFolder
{
get { return true; }
}
protected override void OnRenderFolderNode(TreeNode treeNode)
{
}
protected override void OnRenderFileNode(TreeNode treeNode, FileInfo file)
{
treeNode.Icon =
file.Name.EndsWith(".js", StringComparison.OrdinalIgnoreCase) ?
"icon-script" :
"icon-code";
}
}
}