diff --git a/src/Umbraco.Core/Models/Validation/RequiredForPersistenceAttribute.cs b/src/Umbraco.Core/Models/Validation/RequiredForPersistenceAttribute.cs
index a02b9003d6..43344f80c4 100644
--- a/src/Umbraco.Core/Models/Validation/RequiredForPersistenceAttribute.cs
+++ b/src/Umbraco.Core/Models/Validation/RequiredForPersistenceAttribute.cs
@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Web.ModelBinding;
+using System.ComponentModel.DataAnnotations;
namespace Umbraco.Core.Models.Validation
{
diff --git a/src/Umbraco.Core/Services/ContentServiceExtensions.cs b/src/Umbraco.Core/Services/ContentServiceExtensions.cs
index ec95d4ead0..b13305ed2b 100644
--- a/src/Umbraco.Core/Services/ContentServiceExtensions.cs
+++ b/src/Umbraco.Core/Services/ContentServiceExtensions.cs
@@ -13,5 +13,15 @@ namespace Umbraco.Core.Services
{
return contentService.GetContentInRecycleBin().Any();
}
+
+ ///
+ /// Returns true if there is any media in the recycle bin
+ ///
+ ///
+ ///
+ public static bool RecycleBinSmells(this IMediaService mediaService)
+ {
+ return mediaService.GetMediaInRecycleBin().Any();
+ }
}
}
\ No newline at end of file
diff --git a/src/Umbraco.Web.UI/config/trees.config b/src/Umbraco.Web.UI/config/trees.config
index d8d4957c6d..14bbd2b560 100644
--- a/src/Umbraco.Web.UI/config/trees.config
+++ b/src/Umbraco.Web.UI/config/trees.config
@@ -4,8 +4,8 @@
-
-
+
@@ -41,4 +41,6 @@
iconClosed=".sprTreeFolder" iconOpen=".sprTreeFolder_o" sortOrder="10" />-->
+
+
\ No newline at end of file
diff --git a/src/Umbraco.Web/Trees/ContentTreeController.cs b/src/Umbraco.Web/Trees/ContentTreeController.cs
index 8684ddebaf..1769a4c2e1 100644
--- a/src/Umbraco.Web/Trees/ContentTreeController.cs
+++ b/src/Umbraco.Web/Trees/ContentTreeController.cs
@@ -17,20 +17,6 @@ using umbraco.interfaces;
namespace Umbraco.Web.Trees
{
- //[Tree(Constants.Applications.Content, Constants.Trees.Content, "Content")]
- //public class MediaTreeController : ContentTreeControllerBase
- //{
- // protected override TreeNodeCollection GetTreeData(string id, FormDataCollection queryStrings)
- // {
- // throw new NotImplementedException();
- // }
-
- // protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings)
- // {
- // throw new NotImplementedException();
- // }
- //}
-
[Tree(Constants.Applications.Content, Constants.Trees.Content, "Content")]
public class ContentTreeController : ContentTreeControllerBase
{
@@ -74,26 +60,10 @@ namespace Umbraco.Web.Trees
protected override TreeNodeCollection PerformGetTreeNodes(string id, FormDataCollection queryStrings)
{
- int iid;
- if (int.TryParse(id, out iid) == false)
- {
- throw new InvalidCastException("The id for the content tree must be an integer");
- }
+ var entities = GetChildEntities(id);
var nodes = new TreeNodeCollection();
- IEnumerable entities;
-
- //if a request is made for the root node data but the user's start node is not the default, then
- // we need to return their start node data
- if (iid == Constants.System.Root && UmbracoUser.StartNodeId != Constants.System.Root)
- {
- entities = Services.EntityService.GetChildren(UmbracoUser.StartNodeId, UmbracoObjectTypes.Document).ToArray();
- }
- else
- {
- entities = Services.EntityService.GetChildren(iid, UmbracoObjectTypes.Document).ToArray();
- }
-
+
foreach (var entity in entities)
{
var e = (UmbracoEntity)entity;
@@ -124,8 +94,11 @@ namespace Umbraco.Web.Trees
UmbracoUser.GetPermissions(Constants.System.Root.ToInvariantString()))
.Select(x => new MenuItem(x));
+ //these two are the standard items
menu.AddMenuItem();
menu.AddMenuItem();
+
+ //filter the standard items
var allowedMenu = GetUserAllowedMenuItems(menu, nodeActions);
if (allowedMenu.Any())
@@ -133,9 +106,9 @@ namespace Umbraco.Web.Trees
allowedMenu.Last().SeperatorBefore = true;
}
- // default actions for all users
+ // add default actions for *all* users
allowedMenu.AddMenuItem();
- menu.AddMenuItem(true);
+ allowedMenu.AddMenuItem(true);
return allowedMenu;
}
@@ -156,6 +129,11 @@ namespace Umbraco.Web.Trees
GetUserMenuItemsForNode(item));
}
+ protected override UmbracoObjectTypes UmbracoObjectType
+ {
+ get { return UmbracoObjectTypes.Document; }
+ }
+
protected IEnumerable