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
|
2019-01-31 11:03:25 +11:00
|
|
|
|
root.RoutePath = $"{Constants.Applications.Users}/{Constants.Trees.Users}/users";
|
2019-06-07 17:02:55 +01:00
|
|
|
|
root.Icon = Constants.Icons.UserGroup;
|
2017-09-12 16:22:16 +02:00
|
|
|
|
|
|
|
|
|
|
root.HasChildren = false;
|
|
|
|
|
|
return root;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
|
|
|
|
|
|
{
|
2018-10-16 16:41:06 +11:00
|
|
|
|
//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)
|
|
|
|
|
|
{
|
2018-10-16 16:41:06 +11:00
|
|
|
|
//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
|
|
|
|
}
|