47 lines
1.6 KiB
C#
47 lines
1.6 KiB
C#
using System.Net.Http.Formatting;
|
|
using Umbraco.Core;
|
|
using Umbraco.Core.Services;
|
|
using Umbraco.Web.Models.Trees;
|
|
using Umbraco.Web.Mvc;
|
|
using Umbraco.Web.WebApi.Filters;
|
|
using Umbraco.Web._Legacy.Actions;
|
|
using Constants = Umbraco.Core.Constants;
|
|
|
|
namespace Umbraco.Web.Trees
|
|
{
|
|
[UmbracoTreeAuthorize(Constants.Trees.Users)]
|
|
[Tree(Constants.Applications.Users, Constants.Trees.Users, null, sortOrder: 0)]
|
|
[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 = string.Format("{0}/{1}/{2}", Constants.Applications.Users, Constants.Trees.Users, "overview");
|
|
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;
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|