https://github.com/umbraco/Umbraco-CMS/issues/10054 - Added TreeAlias to the remaining tree notifications
This commit is contained in:
@@ -17,6 +17,11 @@ namespace Umbraco.Cms.Web.BackOffice.Trees
|
||||
/// </summary>
|
||||
public string NodeId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The alias of the tree the menu is rendering for
|
||||
/// </summary>
|
||||
public string TreeAlias { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The menu being rendered
|
||||
/// </summary>
|
||||
@@ -27,11 +32,12 @@ namespace Umbraco.Cms.Web.BackOffice.Trees
|
||||
/// </summary>
|
||||
public FormCollection QueryString { get; }
|
||||
|
||||
public MenuRenderingNotification(string nodeId, MenuItemCollection menu, FormCollection queryString)
|
||||
public MenuRenderingNotification(string nodeId, MenuItemCollection menu, FormCollection queryString, string treeAlias)
|
||||
{
|
||||
NodeId = nodeId;
|
||||
Menu = menu;
|
||||
QueryString = queryString;
|
||||
TreeAlias = treeAlias;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,15 +14,21 @@ namespace Umbraco.Cms.Web.BackOffice.Trees
|
||||
/// </summary>
|
||||
public TreeNode Node { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The alias of the tree the menu is rendering for
|
||||
/// </summary>
|
||||
public string TreeAlias { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The query string of the current request
|
||||
/// </summary>
|
||||
public FormCollection QueryString { get; }
|
||||
|
||||
public RootNodeRenderingNotification(TreeNode node, FormCollection queryString)
|
||||
public RootNodeRenderingNotification(TreeNode node, FormCollection queryString, string treeAlias)
|
||||
{
|
||||
Node = node;
|
||||
QueryString = queryString;
|
||||
TreeAlias = treeAlias;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace Umbraco.Cms.Web.BackOffice.Trees
|
||||
if (IsDialog(queryStrings))
|
||||
node.RoutePath = "#";
|
||||
|
||||
await _eventAggregator.PublishAsync(new RootNodeRenderingNotification(node, queryStrings));
|
||||
await _eventAggregator.PublishAsync(new RootNodeRenderingNotification(node, queryStrings, TreeAlias));
|
||||
|
||||
return node;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ namespace Umbraco.Cms.Web.BackOffice.Trees
|
||||
|
||||
var menu = menuResult.Value;
|
||||
//raise the event
|
||||
await _eventAggregator.PublishAsync(new MenuRenderingNotification(id, menu, queryStrings));
|
||||
await _eventAggregator.PublishAsync(new MenuRenderingNotification(id, menu, queryStrings, TreeAlias));
|
||||
return menu;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user