Files
Umbraco-CMS/src/Umbraco.Web/Trees/PartialViewsTreeController.cs

37 lines
1.1 KiB
C#
Raw Normal View History

2017-01-19 09:49:27 +01:00
using Umbraco.Core;
using Umbraco.Core.IO;
using Umbraco.Web.Models.Trees;
namespace Umbraco.Web.Trees
{
/// <summary>
/// Tree for displaying partial views in the settings app
/// </summary>
[Tree(Constants.Applications.Settings, "partialViews", null, sortOrder: 2)]
2017-06-01 17:24:10 +02:00
public class PartialViewsTreeController : FileSystemTreeController2
2017-01-19 09:49:27 +01:00
{
2017-03-20 15:26:06 +01:00
protected override IFileSystem2 FileSystem
2017-01-19 09:49:27 +01:00
{
2017-03-20 15:26:06 +01:00
get { return FileSystemProviderManager.Current.PartialViewsFileSystem; }
2017-01-19 09:49:27 +01:00
}
2017-03-20 15:26:06 +01:00
private static readonly string[] ExtensionsStatic = { "cshtml" };
protected override string[] Extensions
{
2017-03-20 15:26:06 +01:00
get { return ExtensionsStatic; }
}
2017-01-19 09:49:27 +01:00
2017-03-20 15:26:06 +01:00
protected override string FileIcon
2017-01-19 09:49:27 +01:00
{
2017-03-20 15:26:06 +01:00
get { return "icon-article"; }
2017-01-19 09:49:27 +01: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);";
}
2017-01-19 09:49:27 +01:00
}
}