Changed routes to have section + tree

This commit is contained in:
Shannon
2013-08-15 12:34:22 +10:00
parent 59d40c4127
commit c61206d03f
6 changed files with 120 additions and 79 deletions

View File

@@ -66,7 +66,7 @@ namespace Umbraco.Web.Trees
ui.GetText("general", "recycleBin"),
"icon-trash",
RecycleBinSmells,
queryStrings.GetValue<string>("application") + "/recyclebin"));
queryStrings.GetValue<string>("application") + TreeAlias.EnsureStartsWith('/') + "/recyclebin"));
return nodes;
}

View File

@@ -72,6 +72,14 @@ namespace Umbraco.Web.Trees
get { return _attribute.Title; }
}
/// <summary>
/// Gets the current tree alias from the attribute assigned to it.
/// </summary>
public string TreeAlias
{
get { return _attribute.Alias; }
}
/// <summary>
/// Returns the root node for the tree
/// </summary>
@@ -83,8 +91,8 @@ namespace Umbraco.Web.Trees
if (queryStrings == null) queryStrings = new FormDataCollection("");
var node = CreateRootNode(queryStrings);
//add the tree type to the root
node.AdditionalData.Add("treeType", GetType().FullName);
//add the tree alias to the root
node.AdditionalData.Add("treeAlias", TreeAlias);
AddQueryStringsToAdditionalData(node, queryStrings);
@@ -188,9 +196,7 @@ namespace Umbraco.Web.Trees
/// <param name="queryStrings"></param>
protected void AddQueryStringsToAdditionalData(TreeNode node, FormDataCollection queryStrings)
{
// Add additional data, ensure treeId isn't added as we've already done that
foreach (var q in queryStrings
.Where(x => x.Key != "treeId" && node.AdditionalData.ContainsKey(x.Key) == false))
foreach (var q in queryStrings.Where(x => node.AdditionalData.ContainsKey(x.Key) == false))
{
node.AdditionalData.Add(q.Key, q.Value);
}