From 9ebe93df06b9834d081bd3b332b86ffe795bb75c Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 11 Mar 2016 15:56:00 +0100 Subject: [PATCH] remore ui replacements --- .../umbraco/controls/passwordChanger.ascx | 8 ++--- src/Umbraco.Web/Models/Trees/MenuItem.cs | 3 +- .../Trees/ContentTreeControllerBase.cs | 2 +- .../Trees/LegacyTreeDataConverter.cs | 36 +++++++++---------- .../umbraco/controls/ContentPicker.cs | 13 ++----- .../umbraco/controls/passwordChanger.ascx.cs | 3 +- .../TreePicker/SimpleContentPicker.cs | 3 +- .../TreePicker/SimpleMediaPicker.cs | 3 +- 8 files changed, 33 insertions(+), 38 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/controls/passwordChanger.ascx b/src/Umbraco.Web.UI/umbraco/controls/passwordChanger.ascx index b11dddda4e..791f5feee7 100644 --- a/src/Umbraco.Web.UI/umbraco/controls/passwordChanger.ascx +++ b/src/Umbraco.Web.UI/umbraco/controls/passwordChanger.ascx @@ -69,7 +69,7 @@
- +
@@ -79,7 +79,7 @@
- +
- +
- +
LegacyTreeDataConverter.GetLegacyConfirmView(Action, currentSection), view => LaunchDialogView( view, - ui.GetText("defaultdialogs", "confirmdelete") + " '" + (item == null ? "" : item.Name) + "' ?")); + ApplicationContext.Current.Services.TextService.Localize("defaultdialogs/confirmdelete") + " '" + (item == null ? "" : item.Name) + "' ?")); } #endregion diff --git a/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs b/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs index 2b197f08f6..af235bda83 100644 --- a/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs +++ b/src/Umbraco.Web/Trees/ContentTreeControllerBase.cs @@ -187,7 +187,7 @@ namespace Umbraco.Web.Trees RecycleBinId.ToInvariantString(), id, queryStrings, - ui.GetText("general", "recycleBin"), + Services.TextService.Localize("general/recycleBin"), "icon-trash", RecycleBinSmells, queryStrings.GetValue("application") + TreeAlias.EnsureStartsWith('/') + "/recyclebin")); diff --git a/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs b/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs index 7cd5d29a39..fa7706c908 100644 --- a/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs +++ b/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs @@ -137,7 +137,7 @@ namespace Umbraco.Web.Trees .OnFailure(() => GetLegacyConfirmView(currentAction, currentSection), view => menuItem.LaunchDialogView( view, - ui.GetText("defaultdialogs", "confirmdelete") + " '" + xmlTreeNode.Text + "' ?")) + ApplicationContext.Current.Services.TextService.Localize("defaultdialogs/confirmdelete") + " '" + xmlTreeNode.Text + "' ?")) .OnFailure(() => menuItem.AdditionalData.ContainsKey(MenuItem.JsActionKey) ? Attempt.Fail(false) : Attempt.Succeed(true), @@ -204,52 +204,52 @@ namespace Umbraco.Web.Trees return Attempt.Succeed( new LegacyUrlAction( "create.aspx?nodeId=" + nodeId + "&nodeType=" + nodeType + "&nodeName=" + nodeName + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "create"))); + ApplicationContext.Current.Services.TextService.Localize("actions/create"))); case "UmbClientMgr.appActions().actionNewFolder()": return Attempt.Succeed( new LegacyUrlAction( "createFolder.aspx?nodeId=" + nodeId + "&nodeType=" + nodeType + "&nodeName=" + nodeName + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "create"))); + ApplicationContext.Current.Services.TextService.Localize("actions/create"))); case "UmbClientMgr.appActions().actionSort()": return Attempt.Succeed( new LegacyUrlAction( "dialogs/sort.aspx?id=" + nodeId + "&nodeType=" + nodeType + "&app=" + currentSection + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "sort"))); + ApplicationContext.Current.Services.TextService.Localize("actions/sort"))); case "UmbClientMgr.appActions().actionRights()": return Attempt.Succeed( new LegacyUrlAction( "dialogs/cruds.aspx?id=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "rights"))); + ApplicationContext.Current.Services.TextService.Localize("actions/rights"))); case "UmbClientMgr.appActions().actionProtect()": return Attempt.Succeed( new LegacyUrlAction( "dialogs/protectPage.aspx?mode=cut&nodeId=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "protect"))); + ApplicationContext.Current.Services.TextService.Localize("actions/protect"))); case "UmbClientMgr.appActions().actionRollback()": return Attempt.Succeed( new LegacyUrlAction( "dialogs/rollback.aspx?nodeId=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "rollback"))); + ApplicationContext.Current.Services.TextService.Localize("actions/rollback"))); case "UmbClientMgr.appActions().actionNotify()": return Attempt.Succeed( new LegacyUrlAction( "dialogs/notifications.aspx?id=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "notify"))); + ApplicationContext.Current.Services.TextService.Localize("actions/notify"))); case "UmbClientMgr.appActions().actionPublish()": return Attempt.Succeed( new LegacyUrlAction( "dialogs/publish.aspx?id=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "publish"))); + ApplicationContext.Current.Services.TextService.Localize("actions/publish"))); case "UmbClientMgr.appActions().actionChangeDocType()": return Attempt.Succeed( new LegacyUrlAction( "dialogs/ChangeDocType.aspx?id=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "changeDocType"))); + ApplicationContext.Current.Services.TextService.Localize("actions/changeDocType"))); case "UmbClientMgr.appActions().actionToPublish()": return Attempt.Succeed( new LegacyUrlAction( "dialogs/SendPublish.aspx?id=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "sendtopublish"))); + ApplicationContext.Current.Services.TextService.Localize("actions/sendtopublish"))); case "UmbClientMgr.appActions().actionRePublish()": return Attempt.Succeed( new LegacyUrlAction( @@ -259,22 +259,22 @@ namespace Umbraco.Web.Trees return Attempt.Succeed( new LegacyUrlAction( "dialogs/assignDomain2.aspx?id=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "assignDomain"))); + ApplicationContext.Current.Services.TextService.Localize("actions/assignDomain"))); case "UmbClientMgr.appActions().actionSendToTranslate()": return Attempt.Succeed( new LegacyUrlAction( "dialogs/sendToTranslation.aspx?id=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "sendToTranslate"))); + ApplicationContext.Current.Services.TextService.Localize("actions/sendToTranslate"))); case "UmbClientMgr.appActions().actionEmptyTranscan()": return Attempt.Succeed( new LegacyUrlAction( "dialogs/emptyTrashcan.aspx?type=" + currentSection, - ui.GetText("actions", "emptyTrashcan"))); + ApplicationContext.Current.Services.TextService.Localize("actions/emptyTrashcan"))); case "UmbClientMgr.appActions().actionImport()": return Attempt.Succeed( new LegacyUrlAction( "dialogs/importDocumentType.aspx", - ui.GetText("actions", "importDocumentType"))); + ApplicationContext.Current.Services.TextService.Localize("actions/importDocumentType"))); case "UmbClientMgr.appActions().actionExport()": return Attempt.Succeed( new LegacyUrlAction( @@ -284,17 +284,17 @@ namespace Umbraco.Web.Trees return Attempt.Succeed( new LegacyUrlAction( "dialogs/viewAuditTrail.aspx?nodeId=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "auditTrail"))); + ApplicationContext.Current.Services.TextService.Localize("actions/auditTrail"))); case "UmbClientMgr.appActions().actionMove()": return Attempt.Succeed( new LegacyUrlAction( "dialogs/moveOrCopy.aspx?app=" + currentSection + "&mode=cut&id=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "move"))); + ApplicationContext.Current.Services.TextService.Localize("actions/move"))); case "UmbClientMgr.appActions().actionCopy()": return Attempt.Succeed( new LegacyUrlAction( "dialogs/moveOrCopy.aspx?app=" + currentSection + "&mode=copy&id=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, - ui.GetText("actions", "copy"))); + ApplicationContext.Current.Services.TextService.Localize("actions/copy"))); } return Attempt.Fail(); } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentPicker.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentPicker.cs index 374a76a71f..776b00755f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentPicker.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentPicker.cs @@ -1,16 +1,7 @@ using System; -using System.Data; -using System.Configuration; -using System.Web; -using System.Web.Security; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.WebControls.WebParts; -using System.Web.UI.HtmlControls; -using umbraco.cms.presentation.Trees; -using umbraco.presentation; using umbraco.uicontrols.TreePicker; using Umbraco.Core; +using Umbraco.Core.Services; namespace umbraco.controls { @@ -52,7 +43,7 @@ namespace umbraco.controls { get { - return ui.GetText("general", "choose") + " " + ui.GetText("sections", TreeAlias.ToLower()); + return ApplicationContext.Current.Services.TextService.Localize("general/choose") + " " + ApplicationContext.Current.Services.TextService.Localize("sections/" + TreeAlias.ToLower()); } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/passwordChanger.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/passwordChanger.ascx.cs index c7e5aedc5a..ff0f2a396c 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/passwordChanger.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/passwordChanger.ascx.cs @@ -12,10 +12,11 @@ using System.Web.UI.HtmlControls; using Umbraco.Core; using Umbraco.Core.Security; using Umbraco.Web.Models; +using Umbraco.Web.UI.Controls; namespace umbraco.controls { - public partial class passwordChanger : UserControl + public partial class passwordChanger : UmbracoUserControl { public string MembershipProviderName { get; set; } diff --git a/src/umbraco.controls/TreePicker/SimpleContentPicker.cs b/src/umbraco.controls/TreePicker/SimpleContentPicker.cs index af8f2e6f57..89b05118b7 100644 --- a/src/umbraco.controls/TreePicker/SimpleContentPicker.cs +++ b/src/umbraco.controls/TreePicker/SimpleContentPicker.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using Umbraco.Core; +using Umbraco.Core.Services; namespace umbraco.uicontrols.TreePicker { @@ -21,7 +22,7 @@ namespace umbraco.uicontrols.TreePicker { get { - return ui.GetText("general", "choose") + " " + ui.GetText("sections", "content"); + return ApplicationContext.Current.Services.TextService.Localize("general/choose") + " " + ApplicationContext.Current.Services.TextService.Localize("sections/content"); } } } diff --git a/src/umbraco.controls/TreePicker/SimpleMediaPicker.cs b/src/umbraco.controls/TreePicker/SimpleMediaPicker.cs index 91d07598a5..1588c21d99 100644 --- a/src/umbraco.controls/TreePicker/SimpleMediaPicker.cs +++ b/src/umbraco.controls/TreePicker/SimpleMediaPicker.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using Umbraco.Core; +using Umbraco.Core.Services; namespace umbraco.uicontrols.TreePicker { @@ -20,7 +21,7 @@ namespace umbraco.uicontrols.TreePicker { get { - return ui.GetText("general", "choose") + " " + ui.GetText("sections", "media"); + return ApplicationContext.Current.Services.TextService.Localize("general/choose") + " " + ApplicationContext.Current.Services.TextService.Localize("sections/media"); } } }