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

32 lines
1.1 KiB
C#
Raw Normal View History

2017-05-12 14:49:44 +02:00
using Umbraco.Core;
using Umbraco.Core.IO;
2017-05-30 18:13:11 +02:00
using Umbraco.Web.Composing;
using Umbraco.Web.Models.Trees;
namespace Umbraco.Web.Trees
{
/// <summary>
/// Tree for displaying partial views in the settings app
/// </summary>
[Tree(Constants.Applications.Settings, Constants.Trees.PartialViews, "Partial Views", sortOrder: 2)]
public class PartialViewsTreeController : FileSystemTreeController
{
2017-05-12 14:49:44 +02:00
protected override IFileSystem FileSystem => Current.FileSystems.PartialViewsFileSystem;
2017-05-12 14:49:44 +02:00
private static readonly string[] ExtensionsStatic = { "cshtml" };
2017-05-12 14:49:44 +02:00
protected override string[] Extensions => ExtensionsStatic;
2017-05-12 14:49:44 +02:00
protected override string FileIcon => "icon-article";
2017-05-12 14:49:44 +02:00
protected override void OnRenderFolderNode(ref TreeNode treeNode)
{
2017-05-12 14:49:44 +02:00
//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);";
treeNode.Icon = "icon-article";
}
2017-05-12 14:49:44 +02:00
protected override bool EnableCreateOnFolder => true;
}
}