From f0343788b7da3d1ef9f43cdc54c44f87112322ce Mon Sep 17 00:00:00 2001 From: Per Ploug Date: Fri, 29 May 2015 09:20:50 +0200 Subject: [PATCH] Tree actions for CT --- .../Trees/DocumentTypeTreeController.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Trees/DocumentTypeTreeController.cs b/src/Umbraco.Web/Trees/DocumentTypeTreeController.cs index d7d2cca335..b978e39735 100644 --- a/src/Umbraco.Web/Trees/DocumentTypeTreeController.cs +++ b/src/Umbraco.Web/Trees/DocumentTypeTreeController.cs @@ -4,6 +4,8 @@ using System.Linq; using System.Net.Http.Formatting; using System.Text; using System.Threading.Tasks; +using umbraco; +using umbraco.BusinessLogic.Actions; using Umbraco.Core; using Umbraco.Web.Models.Trees; using Umbraco.Web.WebApi.Filters; @@ -29,7 +31,22 @@ namespace Umbraco.Web.Trees protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings) { - return new MenuItemCollection(); + var menu = new MenuItemCollection(); + + if (id == Constants.System.Root.ToInvariantString()) + { + // root actions + menu.Items.Add(ui.Text("actions", ActionNew.Instance.Alias)); + menu.Items.Add(ui.Text("actions", ActionRefresh.Instance.Alias), true); + return menu; + } + else + { + //delete doc type + menu.Items.Add(ui.Text("actions", ActionDelete.Instance.Alias)); + } + + return menu; } } }