porting 7.6-rc1 into 8

This commit is contained in:
Stephan
2017-05-12 14:49:44 +02:00
parent ade6c2f057
commit 8561d85f7a
1148 changed files with 41983 additions and 17045 deletions

View File

@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
using Umbraco.Web.Models.Trees;
@@ -11,37 +8,20 @@ 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 IFileSystem FileSystem => Current.FileSystems.ScriptsFileSystem; // fixme inject
protected override IEnumerable<string> FileSearchPattern
{
get { return UmbracoConfig.For.UmbracoSettings().Content.ScriptFileTypes; }
}
private static readonly string[] ExtensionsStatic = { "js" };
protected override string EditFormUrl
{
get { return "settings/scripts/editScript.aspx?file={0}"; }
}
protected override string[] Extensions => ExtensionsStatic;
protected override bool EnableCreateOnFolder
{
get { return true; }
}
protected override string FileIcon => "icon-script";
protected override void OnRenderFolderNode(TreeNode treeNode)
{
}
protected override bool EnableCreateOnFolder => true;
protected override void OnRenderFileNode(TreeNode treeNode, FileInfo file)
protected override void OnRenderFolderNode(ref TreeNode treeNode)
{
treeNode.Icon =
file.Name.EndsWith(".js", StringComparison.OrdinalIgnoreCase) ?
"icon-script" :
"icon-code";
//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);";
}
}
}