2017-07-20 19:16:28 +10:00
|
|
|
|
using Umbraco.Core.IO;
|
2017-01-19 09:49:27 +01:00
|
|
|
|
using Umbraco.Web.Models.Trees;
|
2017-07-20 19:16:28 +10:00
|
|
|
|
using Umbraco.Web.Mvc;
|
|
|
|
|
|
using Umbraco.Web.WebApi.Filters;
|
|
|
|
|
|
using Constants = Umbraco.Core.Constants;
|
2017-01-19 09:49:27 +01:00
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Trees
|
|
|
|
|
|
{
|
2017-02-08 15:43:31 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Tree for displaying partial view macros in the developer app
|
|
|
|
|
|
/// </summary>
|
2017-05-11 10:10:13 +08:00
|
|
|
|
[Tree(Constants.Applications.Developer, "partialViewMacros", null, sortOrder: 6)]
|
2017-07-20 19:16:28 +10:00
|
|
|
|
[UmbracoTreeAuthorize(Constants.Trees.PartialViewMacros)]
|
|
|
|
|
|
[PluginController("UmbracoTrees")]
|
|
|
|
|
|
[CoreTree]
|
2017-07-24 14:05:04 +02:00
|
|
|
|
public class PartialViewMacrosTreeController : FileSystemTreeController
|
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.MacroPartialsFileSystem; }
|
2017-01-19 09:49:27 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-07-12 14:26:44 +02:00
|
|
|
|
private static readonly string[] ExtensionsStatic = {"cshtml"};
|
2017-03-20 15:26:06 +01:00
|
|
|
|
|
|
|
|
|
|
protected override string[] Extensions
|
2017-01-19 09:49:27 +01:00
|
|
|
|
{
|
2017-03-20 15:26:06 +01:00
|
|
|
|
get { return ExtensionsStatic; }
|
2017-01-19 09:49:27 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-01-19 10:41:08 +01:00
|
|
|
|
protected override string FileIcon
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return "icon-article"; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-01-26 11:32:13 +00: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
|
|
|
|
}
|
|
|
|
|
|
}
|