Port v7@2aa0dfb2c5 - WIP

This commit is contained in:
Stephan
2018-03-27 10:04:07 +02:00
parent a2a4edb3be
commit 0a4878d2a3
119 changed files with 3016 additions and 1376 deletions

View File

@@ -1,4 +1,7 @@
using System.Net.Http.Formatting;
using umbraco.BusinessLogic.Actions;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi.Filters;
@@ -7,7 +10,7 @@ using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees
{
[UmbracoTreeAuthorize(Constants.Trees.Users)]
[Tree(Constants.Applications.Users, Constants.Trees.Users, "Users", sortOrder: 0)]
[Tree(Constants.Applications.Users, Constants.Trees.Users, null, sortOrder: 0)]
[PluginController("UmbracoTrees")]
[CoreTree]
public class UserTreeController : TreeController
@@ -39,6 +42,31 @@ namespace Umbraco.Web.Trees
protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
{
var menu = new MenuItemCollection();
if (id == Constants.System.Root.ToInvariantString())
{
//Create User
var createMenuItem = menu.Items.CreateMenuItem<ActionNew>(Services.TextService.Localize("actions/create"));
createMenuItem.Icon = "add";
createMenuItem.NavigateToRoute("users/users/overview?subview=users&create=true");
menu.Items.Add(createMenuItem);
//This is the same setting used in the global JS for 'showUserInvite'
if (EmailSender.CanSendRequiredEmail)
{
//Invite User (Action import closest type of action to an invite user)
var inviteMenuItem = menu.Items.CreateMenuItem<ActionImport>(Services.TextService.Localize("user/invite"));
inviteMenuItem.Icon = "message-unopened";
inviteMenuItem.NavigateToRoute("users/users/overview?subview=users&invite=true");
menu.Items.Add(inviteMenuItem);
}
return menu;
}
//There is no context menu options for editing a specific user
//Also we no longer list each user in the tree & in theory never hit this
return menu;
}
}