Fixes: U4-2770 Legacy content dialogs doesnt render and removes a file that shouldn't have been committed.

This commit is contained in:
Shannon
2013-09-03 12:27:48 +10:00
parent 020623acd3
commit aee521ce1a
5 changed files with 77 additions and 132 deletions

View File

@@ -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 + "' ?"));
}
}
}