Fixes: U4-2770 Legacy content dialogs doesnt render and removes a file that shouldn't have been committed.
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
namespace Umbraco.Web.Trees.Menu
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
using umbraco;
|
||||
|
||||
namespace Umbraco.Web.Trees.Menu
|
||||
{
|
||||
public static class MenuItemExtensions
|
||||
{
|
||||
@@ -56,5 +60,18 @@
|
||||
menuItem.AdditionalData[ActionUrlKey] = url;
|
||||
menuItem.AdditionalData[ActionUrlMethodKey] = url;
|
||||
}
|
||||
|
||||
internal static void ConvertLegacyMenuItem(this MenuItem menuItem, IUmbracoEntity item, string nodeType, string currentSection)
|
||||
{
|
||||
//First try to get a URL/title from the legacy action,
|
||||
// if that doesn't work, try to get the legacy confirm view
|
||||
Attempt<LegacyTreeDataConverter.LegacyUrlAction>
|
||||
.Try(LegacyTreeDataConverter.GetUrlAndTitleFromLegacyAction(menuItem.Action, item.Id.ToInvariantString(), nodeType, item.Name, currentSection),
|
||||
action => menuItem.LaunchDialogUrl(action.Url, action.DialogTitle))
|
||||
.IfFailed(() => LegacyTreeDataConverter.GetLegacyConfirmView(menuItem.Action, currentSection),
|
||||
view => menuItem.LaunchDialogView(
|
||||
view,
|
||||
ui.GetText("defaultdialogs", "confirmdelete") + " '" + item.Name + "' ?"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user