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

44 lines
1.5 KiB
C#
Raw Normal View History

2017-09-12 16:22:16 +02:00
using System.Net.Http.Formatting;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi.Filters;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees
{
[UmbracoTreeAuthorize(Constants.Trees.Users)]
2019-01-22 09:31:47 +01:00
[Tree(Constants.Applications.Users, Constants.Trees.Users, SortOrder = 0, IsSingleNodeTree = true)]
2017-09-12 16:22:16 +02:00
[PluginController("UmbracoTrees")]
[CoreTree]
public class UserTreeController : TreeController
{
/// <summary>
/// Helper method to create a root model for a tree
/// </summary>
/// <returns></returns>
protected override TreeNode CreateRootNode(FormDataCollection queryStrings)
{
var root = base.CreateRootNode(queryStrings);
//this will load in a custom UI instead of the dashboard for the root node
root.RoutePath = $"{Constants.Applications.Users}/{Constants.Trees.Users}/users";
2017-09-12 16:22:16 +02:00
root.Icon = "icon-users";
root.HasChildren = false;
return root;
}
protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
{
//full screen app without tree nodes
return TreeNodeCollection.Empty;
2017-09-12 16:22:16 +02:00
}
protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
{
//doesn't have a menu, this is a full screen app without tree nodes
return MenuItemCollection.Empty;
2017-09-12 16:22:16 +02:00
}
}
2017-09-23 10:08:18 +02:00
}