diff --git a/Build/Tools/NuGet/DotNetNuke.Abstractions.nuspec b/Build/Tools/NuGet/DotNetNuke.Abstractions.nuspec deleted file mode 100644 index 24365059835..00000000000 --- a/Build/Tools/NuGet/DotNetNuke.Abstractions.nuspec +++ /dev/null @@ -1,22 +0,0 @@ - - - - DotNetNuke.Abstractions - $version$ - DNN Platform (Abstractions) - DNN Corp - DNN Corp - MIT - false - http://www.dnnsoftware.com/favicon.ico - https://github.com/dnnsoftware/Dnn.Platform - - Provides common abstraction API references for the DNN Platform. - - Copyright (c) .NET Foundation and Contributors, All Rights Reserved. - - - - - - diff --git a/Build/Tools/NuGet/DotNetNuke.Bundle.nuspec b/Build/Tools/NuGet/DotNetNuke.Bundle.nuspec index 5eb3fa1aef2..95ced463f27 100644 --- a/Build/Tools/NuGet/DotNetNuke.Bundle.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Bundle.nuspec @@ -13,7 +13,7 @@ This package is a metapackage that automatically includes all other available DNN Packages, this should only be used in situations where support for ALL types of development are truly needed. - Copyright (c) .NET Foundation and Contributors, All Rights Reserved. + DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.Core.nuspec b/Build/Tools/NuGet/DotNetNuke.Core.nuspec index a4468a8ea30..6835a3fb5a7 100644 --- a/Build/Tools/NuGet/DotNetNuke.Core.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Core.nuspec @@ -13,7 +13,7 @@ Provides basic references to the DotNetNuke.dll to develop extensions for the DNN Platform. For MVC or WebAPI please see other packages available as well - Copyright (c) .NET Foundation and Contributors, All Rights Reserved. + DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.DependencyInjection.nuspec b/Build/Tools/NuGet/DotNetNuke.DependencyInjection.nuspec index 8d6a6bf3fe3..2d9dbc5b781 100644 --- a/Build/Tools/NuGet/DotNetNuke.DependencyInjection.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.DependencyInjection.nuspec @@ -13,7 +13,7 @@ Provides API references needed to use Dependency Injection for the DNN Platform. - Copyright (c) .NET Foundation and Contributors, All Rights Reserved. + DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.Instrumentation.nuspec b/Build/Tools/NuGet/DotNetNuke.Instrumentation.nuspec index ae6fd71060a..5dffdf8d456 100644 --- a/Build/Tools/NuGet/DotNetNuke.Instrumentation.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Instrumentation.nuspec @@ -13,7 +13,7 @@ Provides references to enhanced logging and instrumentation available within DNN Platform for extension developers. Including access to Log4Net - Copyright (c) .NET Foundation and Contributors, All Rights Reserved. + DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.Providers.FolderProviders.nuspec b/Build/Tools/NuGet/DotNetNuke.Providers.FolderProviders.nuspec index 6c6ba7840bc..1fe82884eb6 100644 --- a/Build/Tools/NuGet/DotNetNuke.Providers.FolderProviders.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Providers.FolderProviders.nuspec @@ -13,7 +13,7 @@ Provides API references needed to develop custom folder providers, or to consume folder providers - Copyright (c) .NET Foundation and Contributors, All Rights Reserved. + DotNetNuke is copyright 2002-2019 by DNN Corp. All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.SiteExportImport.nuspec b/Build/Tools/NuGet/DotNetNuke.SiteExportImport.nuspec index 09a294bec9b..cb9a17f77eb 100644 --- a/Build/Tools/NuGet/DotNetNuke.SiteExportImport.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.SiteExportImport.nuspec @@ -13,7 +13,7 @@ This package contains components required for developing extensiong to utilize site export/import features. - Copyright (c) .NET Foundation and Contributors, All Rights Reserved. + DNN and DotNetNuke are copyright 2002-2018 by DNN Corp. All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.Web.Client.nuspec b/Build/Tools/NuGet/DotNetNuke.Web.Client.nuspec index 9d35ec99083..adb9ba22b5a 100644 --- a/Build/Tools/NuGet/DotNetNuke.Web.Client.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Web.Client.nuspec @@ -13,7 +13,7 @@ Provides API references for usage of the Client Dependency Framework (CDF) for the inclusion of CSS and JS files within DNN Platform - Copyright (c) .NET Foundation and Contributors, All Rights Reserved. + DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.Web.Deprecated.nuspec b/Build/Tools/NuGet/DotNetNuke.Web.Deprecated.nuspec index b66b4d8c0ad..2aed056ceaf 100644 --- a/Build/Tools/NuGet/DotNetNuke.Web.Deprecated.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Web.Deprecated.nuspec @@ -13,7 +13,7 @@ Provides API references for deprecated items removed from the primary API's, such as DNN's Telerik component. These elements may not be distributed with DNN in the future - Copyright (c) .NET Foundation and Contributors, All Rights Reserved. + DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.Web.Mvc.nuspec b/Build/Tools/NuGet/DotNetNuke.Web.Mvc.nuspec index e65ea7c4f25..f4f93d06834 100644 --- a/Build/Tools/NuGet/DotNetNuke.Web.Mvc.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Web.Mvc.nuspec @@ -13,7 +13,7 @@ Provides API references needed to develop ASP.MVC extensions for DNN Platform - Copyright (c) .NET Foundation and Contributors, All Rights Reserved. + DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.Web.nuspec b/Build/Tools/NuGet/DotNetNuke.Web.nuspec index 297f102e875..19187265f56 100644 --- a/Build/Tools/NuGet/DotNetNuke.Web.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.Web.nuspec @@ -13,7 +13,7 @@ Provides references to core components such as Caching, Security and other security-related items for DNN Platform - Copyright (c) .NET Foundation and Contributors, All Rights Reserved. + DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. diff --git a/Build/Tools/NuGet/DotNetNuke.WebApi.nuspec b/Build/Tools/NuGet/DotNetNuke.WebApi.nuspec index 19f92884f72..e6a3f201196 100644 --- a/Build/Tools/NuGet/DotNetNuke.WebApi.nuspec +++ b/Build/Tools/NuGet/DotNetNuke.WebApi.nuspec @@ -13,7 +13,7 @@ This package contains components required for developing WebAPI based services for DNN Platform. - Copyright (c) .NET Foundation and Contributors, All Rights Reserved. + DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved. diff --git a/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj b/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj index 945f6a17b04..c22d39ca857 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj +++ b/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj @@ -50,12 +50,6 @@ ..\..\DotNetNuke.WebUtility\bin\DotNetNuke.WebUtility.dll - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - @@ -109,10 +103,6 @@ - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - {3cd5f6b8-8360-4862-80b6-f402892db7dd} DotNetNuke.Instrumentation @@ -144,9 +134,6 @@ - - - 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs index 85b87bbae4e..c4ce44ac774 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs @@ -1,22 +1,22 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -29,14 +29,15 @@ using System.IO; using System.Linq; using System.Text; +using System.Web.UI; using System.Web.UI.WebControls; -using Microsoft.Extensions.DependencyInjection; using Dnn.Modules.Console.Components; -using DotNetNuke.Abstractions; +using DotNetNuke.Common; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Tabs; using DotNetNuke.Entities.Users; +using DotNetNuke.Framework; using DotNetNuke.Framework.JavaScriptLibraries; using DotNetNuke.Instrumentation; using DotNetNuke.Security.Permissions; @@ -52,18 +53,12 @@ namespace Dnn.Modules.Console { public partial class ViewConsole : PortalModuleBase { - private readonly INavigationManager _navigationManager; private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof (ViewConsole)); private ConsoleController _consoleCtrl; private string _defaultSize = string.Empty; private string _defaultView = string.Empty; private int _groupTabID = -1; - private IList _tabs; - - public ViewConsole() - { - _navigationManager = DependencyProvider.GetRequiredService(); - } + private IList _tabs; #region Public Properties @@ -79,7 +74,7 @@ public bool AllowViewChange public bool IncludeHiddenPages { - get { return Settings.ContainsKey("IncludeHiddenPages") && bool.Parse(Settings["IncludeHiddenPages"].ToString()); } + get { return Settings.ContainsKey("IncludeHiddenPages") && bool.Parse(Settings["IncludeHiddenPages"].ToString()); } } public ConsoleController ConsoleCtrl @@ -382,7 +377,7 @@ protected override void OnLoad(EventArgs e) } IconSize.SelectedValue = DefaultSize; View.SelectedValue = DefaultView; - + if ((!IsPostBack)) { Console.Attributes["class"] = Console.Attributes["class"] + " " + Mode.ToLower(CultureInfo.InvariantCulture); @@ -419,7 +414,7 @@ protected override void OnLoad(EventArgs e) { tabIdList.Add(tab.TabID); } - _tabs.Add(tab); + _tabs.Add(tab); } } @@ -508,12 +503,12 @@ protected string GetHtml(TabInfo tab) var tabUrl = tab.FullUrl; if (ProfileUserId > -1) { - tabUrl = _navigationManager.NavigateURL(tab.TabID, "", "UserId=" + ProfileUserId.ToString(CultureInfo.InvariantCulture)); + tabUrl = Globals.NavigateURL(tab.TabID, "", "UserId=" + ProfileUserId.ToString(CultureInfo.InvariantCulture)); } if (GroupId > -1) { - tabUrl = _navigationManager.NavigateURL(tab.TabID, "", "GroupId=" + GroupId.ToString(CultureInfo.InvariantCulture)); + tabUrl = Globals.NavigateURL(tab.TabID, "", "GroupId=" + GroupId.ToString(CultureInfo.InvariantCulture)); } returnValue += string.Format(sb.ToString(), diff --git a/DNN Platform/Admin Modules/Dnn.Modules.Console/packages.config b/DNN Platform/Admin Modules/Dnn.Modules.Console/packages.config deleted file mode 100644 index 015e7e36813..00000000000 --- a/DNN Platform/Admin Modules/Dnn.Modules.Console/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs index ee5ef8e40bf..625790b1c95 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs @@ -1,22 +1,22 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2012 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -40,8 +40,7 @@ using DotNetNuke.Entities.Controllers; using DotNetNuke.Entities.Content.Taxonomy; using DotNetNuke.Services.Log.EventLog; -using DotNetNuke.Abstractions; -using Microsoft.Extensions.DependencyInjection; + #endregion namespace Dnn.Module.ModuleCreator @@ -49,11 +48,6 @@ namespace Dnn.Module.ModuleCreator public partial class CreateModule : PortalModuleBase { - private readonly INavigationManager _navigationManager; - public CreateModule() - { - _navigationManager = DependencyProvider.GetRequiredService(); - } #region Private Methods @@ -153,7 +147,7 @@ private string CreateModuleControl() sourceCode = sourceCode.Replace("_CONTROL_", GetControl()); sourceCode = sourceCode.Replace("_YEAR_", DateTime.Now.Year.ToString()); - //get filename + //get filename fileName = Path.GetFileName(filePath); fileName = fileName.Replace("template", GetControl()); fileName = fileName.Replace("_OWNER_", GetOwner()); @@ -331,7 +325,7 @@ private bool CreateModuleDefinition() var objModuleDefinition = new ModuleDefinitionInfo(); objModuleDefinition.ModuleDefID = Null.NullInteger; objModuleDefinition.DesktopModuleID = objDesktopModule.DesktopModuleID; - // need core enhancement to have a unique DefinitionName + // need core enhancement to have a unique DefinitionName objModuleDefinition.FriendlyName = GetClassName(); //objModuleDefinition.FriendlyName = txtModule.Text; //objModuleDefinition.DefinitionName = GetClassName(); @@ -444,7 +438,7 @@ protected void cmdCreate_Click(object sender, EventArgs e) HostController.Instance.Update("Owner", txtOwner.Text, false); if (CreateModuleDefinition()) { - Response.Redirect(_navigationManager.NavigateURL(), true); + Response.Redirect(Globals.NavigateURL(), true); } } else diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj index 9d22fa01297..c3a3c7a38ab 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj @@ -49,12 +49,6 @@ ..\..\DotNetNuke.WebUtility\bin\DotNetNuke.WebUtility.dll - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - @@ -172,14 +166,6 @@ - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - - - {0fca217a-5f9a-4f5b-a31b-86d64ae65198} - DotNetNuke.DependencyInjection - {3cd5f6b8-8360-4862-80b6-f402892db7dd} DotNetNuke.Instrumentation @@ -227,9 +213,6 @@ - - - 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/packages.config b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/packages.config deleted file mode 100644 index 015e7e36813..00000000000 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs index bcd1f10c0ac..c1abe1c3f2a 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs @@ -1,22 +1,22 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2012 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -25,10 +25,10 @@ using System; using System.IO; +using System.Collections; +using System.Collections.Generic; using System.Web.UI.WebControls; -using Microsoft.Extensions.DependencyInjection; -using DotNetNuke.Abstractions; using DotNetNuke.Common; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; @@ -39,7 +39,9 @@ using DotNetNuke.Entities.Controllers; using DotNetNuke.Security; using DotNetNuke.Entities.Modules.Definitions; +using DotNetNuke.Services.Installer; using DotNetNuke.Services.Installer.Packages; +using DotNetNuke.Services.Installer.Writers; using DotNetNuke.Services.Log.EventLog; #endregion @@ -48,12 +50,6 @@ namespace Dnn.Module.ModuleCreator { public partial class ViewSource : PortalModuleBase { - private readonly INavigationManager _navigationManager; - public ViewSource() - { - _navigationManager = DependencyProvider.GetRequiredService(); - } - #region Private Members @@ -74,7 +70,7 @@ private string ReturnURL { get { - return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? _navigationManager.NavigateURL(); + return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? Globals.NavigateURL(); } } @@ -355,7 +351,7 @@ private string CreateModuleControl() sourceCode = sourceCode.Replace("_CONTROL_", GetControl()); sourceCode = sourceCode.Replace("_YEAR_", DateTime.Now.Year.ToString()); - //get filename + //get filename fileName = Path.GetFileName(filePath); fileName = fileName.Replace("template", GetControl()); fileName = fileName.Replace("_OWNER_", objPackage.Owner.Replace(" ", "")); @@ -526,7 +522,7 @@ private void OnPackageClick(object sender, EventArgs e) var objModuleDefinition = ModuleDefinitionController.GetModuleDefinitionByID(objModuleControl.ModuleDefID); var objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, PortalId); ModuleInfo objModule = ModuleController.Instance.GetModuleByDefinition(-1, "Extensions"); - Response.Redirect(_navigationManager.NavigateURL(objModule.TabID, "PackageWriter", "rtab=" + TabId.ToString(), "packageId=" + objDesktopModule.PackageID.ToString(), "mid=" + objModule.ModuleID.ToString()) + "?popUp=true", true); + Response.Redirect(Globals.NavigateURL(objModule.TabID, "PackageWriter", "rtab=" + TabId.ToString(), "packageId=" + objDesktopModule.PackageID.ToString(), "mid=" + objModule.ModuleID.ToString()) + "?popUp=true", true); } private void OnConfigureClick(object sender, EventArgs e) @@ -535,7 +531,7 @@ private void OnConfigureClick(object sender, EventArgs e) var objModuleDefinition = ModuleDefinitionController.GetModuleDefinitionByID(objModuleControl.ModuleDefID); var objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, PortalId); ModuleInfo objModule = ModuleController.Instance.GetModuleByDefinition(-1, "Extensions"); - Response.Redirect(_navigationManager.NavigateURL(objModule.TabID, "Edit", "mid=" + objModule.ModuleID.ToString(), "PackageID=" + objDesktopModule.PackageID.ToString()) + "?popUp=true", true); + Response.Redirect(Globals.NavigateURL(objModule.TabID, "Edit", "mid=" + objModule.ModuleID.ToString(), "PackageID=" + objDesktopModule.PackageID.ToString()) + "?popUp=true", true); } private void OnCreateClick(object sender, EventArgs e) @@ -555,4 +551,4 @@ private void OnCreateClick(object sender, EventArgs e) #endregion } -} +} \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Abstractions/DotNetNuke.Abstractions.csproj b/DNN Platform/DotNetNuke.Abstractions/DotNetNuke.Abstractions.csproj deleted file mode 100644 index 1af5f9edaba..00000000000 --- a/DNN Platform/DotNetNuke.Abstractions/DotNetNuke.Abstractions.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - netstandard2.0 - false - - - - - SolutionInfo.cs - - - - - - - - diff --git a/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs b/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs deleted file mode 100644 index 9abf932250b..00000000000 --- a/DNN Platform/DotNetNuke.Abstractions/INavigationManager.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using DotNetNuke.Abstractions.Portals; - -namespace DotNetNuke.Abstractions -{ - public interface INavigationManager - { - /// - /// Gets the URL to the current page. - /// - /// Formatted URL. - string NavigateURL(); - - /// - /// Gets the URL to the given page. - /// - /// The tab ID. - /// Formatted URL. - string NavigateURL(int tabID); - - /// - /// Gets the URL to the given page. - /// - /// The tab ID. - /// if set to true the page is a "super-tab," i.e. a host-level page. - /// Formatted URL. - string NavigateURL(int tabID, bool isSuperTab); - - /// - /// Gets the URL to show the control associated with the given control key. - /// - /// The control key, or or null. - /// Formatted URL. - string NavigateURL(string controlKey); - - /// - /// Gets the URL to show the control associated with the given control key. - /// - /// The control key, or or null. - /// Any additional parameters, in "key=value" format. - /// Formatted URL. - string NavigateURL(string controlKey, params string[] additionalParameters); - - /// - /// Gets the URL to show the control associated with the given control key on the given page. - /// - /// The tab ID. - /// The control key, or or null. - /// Formatted URL. - string NavigateURL(int tabID, string controlKey); - - /// - /// Gets the URL to show the given page. - /// - /// The tab ID. - /// The control key, or or null. - /// Any additional parameters. - /// Formatted URL. - string NavigateURL(int tabID, string controlKey, params string[] additionalParameters); - - /// - /// Gets the URL to show the given page. - /// - /// The tab ID. - /// The portal settings. - /// The control key, or or null. - /// Any additional parameters. - /// Formatted URL. - string NavigateURL(int tabID, IPortalSettings settings, string controlKey, params string[] additionalParameters); - - /// - /// Gets the URL to show the given page. - /// - /// The tab ID. - /// if set to true the page is a "super-tab," i.e. a host-level page. - /// The portal settings. - /// The control key, or or null. - /// Any additional parameters. - /// Formatted URL. - string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, params string[] additionalParameters); - - /// - /// Gets the URL to show the given page. - /// - /// The tab ID. - /// if set to true the page is a "super-tab," i.e. a host-level page. - /// The portal settings. - /// The control key, or or null. - /// The language code. - /// Any additional parameters. - /// Formatted URL. - string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, string language, params string[] additionalParameters); - - /// - /// Gets the URL to show the given page. - /// - /// The tab ID. - /// if set to true the page is a "super-tab," i.e. a host-level page. - /// The portal settings. - /// The control key, or or null. - /// The language code. - /// The page name to pass to . - /// Any additional parameters. - /// Formatted url. - string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, string language, string pageName, params string[] additionalParameters); - } -} diff --git a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs b/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs deleted file mode 100644 index 7bfd99a725f..00000000000 --- a/DNN Platform/DotNetNuke.Abstractions/Portals/IPortalSettings.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace DotNetNuke.Abstractions.Portals -{ - public interface IPortalSettings - { - int PortalId { get; } - bool ContentLocalizationEnabled { get; } - bool EnableUrlLanguage { get; } - bool SSLEnabled { get; } - string SSLURL { get; } - } -} diff --git a/DNN Platform/DotNetNuke.Web.Mvc/DotNetNuke.Web.Mvc.csproj b/DNN Platform/DotNetNuke.Web.Mvc/DotNetNuke.Web.Mvc.csproj index 10138b1eb7c..3a2df51a852 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/DotNetNuke.Web.Mvc.csproj +++ b/DNN Platform/DotNetNuke.Web.Mvc/DotNetNuke.Web.Mvc.csproj @@ -197,10 +197,6 @@ - - {6928a9b1-f88a-4581-a132-d3eb38669bb0} - DotNetNuke.Abstractions - {0fca217a-5f9a-4f5b-a31b-86d64ae65198} DotNetNuke.DependencyInjection diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnRedirecttoRouteResult.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnRedirecttoRouteResult.cs index dba43cbe51e..16c237f5937 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnRedirecttoRouteResult.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnRedirecttoRouteResult.cs @@ -1,29 +1,27 @@ #region Copyright -// +// // DotNetNuke® - http://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DNN Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System.Web.Mvc; using System.Web.Routing; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Web.Mvc.Framework.Controllers; using DotNetNuke.Web.Mvc.Helpers; @@ -31,11 +29,9 @@ namespace DotNetNuke.Web.Mvc.Framework.ActionResults { internal class DnnRedirecttoRouteResult : RedirectToRouteResult { - protected INavigationManager NavigationManager { get; } public DnnRedirecttoRouteResult(string actionName, string controllerName, string routeName, RouteValueDictionary routeValues, bool permanent) : base(routeName, routeValues, permanent) { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); ActionName = actionName; ControllerName = controllerName; } @@ -66,7 +62,7 @@ public override void ExecuteResult(ControllerContext context) else { //TODO - match other actions - url = NavigationManager.NavigateURL(); + url = Globals.NavigateURL(); } if (Permanent) @@ -82,3 +78,4 @@ public override void ExecuteResult(ControllerContext context) } } } + \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Routing/StandardModuleRoutingProvider.cs b/DNN Platform/DotNetNuke.Web.Mvc/Routing/StandardModuleRoutingProvider.cs index 5e5fc686fed..ae8de091e43 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Routing/StandardModuleRoutingProvider.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Routing/StandardModuleRoutingProvider.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - http://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DNN Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -24,10 +24,8 @@ using System.Linq; using System.Web; using System.Web.Routing; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Collections; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Entities.Modules; using DotNetNuke.UI.Modules; @@ -35,22 +33,16 @@ namespace DotNetNuke.Web.Mvc.Routing { public class StandardModuleRoutingProvider : ModuleRoutingProvider { - protected INavigationManager NavigationManager { get; } private const string ExcludedQueryStringParams = "tabid,mid,ctl,language,popup,action,controller"; private const string ExcludedRouteValues = "mid,ctl,popup"; - public StandardModuleRoutingProvider() - { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); - } - public override string GenerateUrl(RouteValueDictionary routeValues, ModuleInstanceContext moduleContext) { //Look for a module control string controlKey = (routeValues.ContainsKey("ctl")) ? (string)routeValues["ctl"] : String.Empty; - List additionalParams = (from routeValue in routeValues - where !ExcludedRouteValues.Split(',').ToList().Contains(routeValue.Key.ToLowerInvariant()) + List additionalParams = (from routeValue in routeValues + where !ExcludedRouteValues.Split(',').ToList().Contains(routeValue.Key.ToLowerInvariant()) select routeValue.Key + "=" + routeValue.Value) .ToList(); @@ -58,7 +50,7 @@ public override string GenerateUrl(RouteValueDictionary routeValues, ModuleInsta if (String.IsNullOrEmpty(controlKey)) { additionalParams.Insert(0, "moduleId=" + moduleContext.Configuration.ModuleID); - url = NavigationManager.NavigateURL("", additionalParams.ToArray()); + url = Globals.NavigateURL("", additionalParams.ToArray()); } else { diff --git a/DNN Platform/DotNetNuke.Web.Razor/DotNetNuke.Web.Razor.csproj b/DNN Platform/DotNetNuke.Web.Razor/DotNetNuke.Web.Razor.csproj index 04694be556c..fccba35c5ec 100644 --- a/DNN Platform/DotNetNuke.Web.Razor/DotNetNuke.Web.Razor.csproj +++ b/DNN Platform/DotNetNuke.Web.Razor/DotNetNuke.Web.Razor.csproj @@ -128,10 +128,6 @@ - - {6928a9b1-f88a-4581-a132-d3eb38669bb0} - DotNetNuke.Abstractions - {0fca217a-5f9a-4f5b-a31b-86d64ae65198} DotNetNuke.DependencyInjection diff --git a/DNN Platform/DotNetNuke.Web.Razor/Helpers/UrlHelper.cs b/DNN Platform/DotNetNuke.Web.Razor/Helpers/UrlHelper.cs index 8cc41313293..be1f3b37c43 100644 --- a/DNN Platform/DotNetNuke.Web.Razor/Helpers/UrlHelper.cs +++ b/DNN Platform/DotNetNuke.Web.Razor/Helpers/UrlHelper.cs @@ -1,30 +1,28 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.UI.Modules; using System; -using Microsoft.Extensions.DependencyInjection; #endregion @@ -34,25 +32,23 @@ namespace DotNetNuke.Web.Razor.Helpers public class UrlHelper { private readonly ModuleInstanceContext _context; - protected INavigationManager NavigationManager { get; } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public UrlHelper(ModuleInstanceContext context) { _context = context; - NavigationManager = Globals.DependencyProvider.GetRequiredService(); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public string NavigateToControl() { - return NavigationManager.NavigateURL(_context.TabId); + return Globals.NavigateURL(_context.TabId); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public string NavigateToControl(string controlKey) { - return NavigationManager.NavigateURL(_context.TabId, controlKey, "mid=" + _context.ModuleId); + return Globals.NavigateURL(_context.TabId, controlKey, "mid=" + _context.ModuleId); } } -} +} \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Web/DotNetNuke.Web.csproj b/DNN Platform/DotNetNuke.Web/DotNetNuke.Web.csproj index 58492dd158b..620702eb8f0 100644 --- a/DNN Platform/DotNetNuke.Web/DotNetNuke.Web.csproj +++ b/DNN Platform/DotNetNuke.Web/DotNetNuke.Web.csproj @@ -419,10 +419,6 @@ - - {6928a9b1-f88a-4581-a132-d3eb38669bb0} - DotNetNuke.Abstractions - {0fca217a-5f9a-4f5b-a31b-86d64ae65198} DotNetNuke.DependencyInjection diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/LanguageServiceController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/LanguageServiceController.cs index b33b0dcf549..0d3a946c273 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/LanguageServiceController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/LanguageServiceController.cs @@ -25,27 +25,24 @@ using System.Linq; using System.Net; using System.Net.Http; +using System.Threading; using System.Web; using System.Web.Http; using System.Collections.Generic; +using DotNetNuke.Application; +using DotNetNuke.Common; +using DotNetNuke.Entities.Controllers; using DotNetNuke.Entities.Portals; using DotNetNuke.Services.Localization; using DotNetNuke.Web.Api; using DotNetNuke.Entities.Tabs; -using DotNetNuke.Abstractions; namespace DotNetNuke.Web.InternalServices { [DnnAuthorize] public class LanguageServiceController : DnnApiController { - protected INavigationManager NavigationManager { get; } - public LanguageServiceController(INavigationManager navigationManager) - { - NavigationManager = navigationManager; - } - public class PageDto { public string Name { get; set; } @@ -73,8 +70,8 @@ public HttpResponseMessage GetNonTranslatedPages(string languageCode) pages.Add(new PageDto() { Name = page.TabName, - ViewUrl = NavigationManager.NavigateURL(page.TabID), - EditUrl = NavigationManager.NavigateURL(page.TabID, "Tab", "action=edit", "returntabid=" + PortalSettings.ActiveTab.TabID) + ViewUrl = DotNetNuke.Common.Globals.NavigateURL(page.TabID), + EditUrl = DotNetNuke.Common.Globals.NavigateURL(page.TabID, "Tab", "action=edit", "returntabid=" + PortalSettings.ActiveTab.TabID) }); } } diff --git a/DNN Platform/DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs b/DNN Platform/DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs index 5d942d8512e..b9fee81edab 100644 --- a/DNN Platform/DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs +++ b/DNN Platform/DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs @@ -1,30 +1,28 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Globalization; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Internal; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Portals; @@ -36,12 +34,6 @@ namespace DotNetNuke.Web.Mvp [Obsolete("Deprecated in DNN 9.2.0. Replace WebFormsMvp and DotNetNuke.Web.Mvp with MVC or SPA patterns instead. Scheduled removal in v11.0.0.")] public abstract class ProfileModuleViewBase : ModuleView, IProfileModule where TModel : class, new() { - protected INavigationManager NavigationManager { get; } - public ProfileModuleViewBase() - { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); - } - #region IProfileModule Members public abstract bool DisplayModule { get; } @@ -110,7 +102,7 @@ protected override void OnInit(EventArgs e) { //Clicked on breadcrumb - don't know which user Response.Redirect(Request.IsAuthenticated - ? NavigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "", "UserId=" + ModuleContext.PortalSettings.UserId.ToString(CultureInfo.InvariantCulture)) + ? Globals.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "", "UserId=" + ModuleContext.PortalSettings.UserId.ToString(CultureInfo.InvariantCulture)) : GetRedirectUrl(), true); } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarTool.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarTool.cs index 06815b5a702..9e726912683 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarTool.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarTool.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -24,11 +24,9 @@ using System.Collections.Generic; using System.Threading; using System.Web.UI; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Application; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Internal; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Host; @@ -48,12 +46,6 @@ namespace DotNetNuke.Web.UI.WebControls [ParseChildren(true)] public class DnnRibbonBarTool : Control, IDnnRibbonBarTool { - protected INavigationManager NavigationManager { get; } - public DnnRibbonBarTool() - { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); - } - #region Properties private IDictionary _allTools; @@ -241,7 +233,7 @@ public virtual void ControlPanelTool_OnClick(object sender, EventArgs e) if ((HasToolPermissions("DeletePage"))) { string url = TestableGlobals.Instance.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=delete"); - Page.Response.Redirect(url, true); + Page.Response.Redirect(url, true); } break; case "CopyPermissionsToChildren": @@ -314,7 +306,7 @@ protected virtual void ProcessTool() { DnnLink.Enabled = false; } - //create popup event + //create popup event else if (ToolInfo.ShowAsPopUp && PortalSettings.EnablePopUps) { // Prevent PageSettings in a popup if SSL is enabled and enforced, which causes redirection/javascript broswer security issues. @@ -491,7 +483,7 @@ protected virtual string BuildToolUrl() break; case "ExportPage": - returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "ExportTab"); + returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "ExportTab"); break; case "NewPage": @@ -578,7 +570,7 @@ protected virtual string GetTabURL(List additionalParams) } string currentCulture = Thread.CurrentThread.CurrentCulture.Name; - strURL = NavigationManager.NavigateURL(moduleInfo.TabID, isHostPage, PortalSettings, ToolInfo.ControlKey, currentCulture, additionalParams.ToArray()); + strURL = Globals.NavigateURL(moduleInfo.TabID, isHostPage, PortalSettings, ToolInfo.ControlKey, currentCulture, additionalParams.ToArray()); } return strURL; @@ -595,7 +587,7 @@ protected virtual bool ActiveTabHasChildren() return true; } - + protected virtual string GetString(string key) { return Utilities.GetLocalizedStringFromParent(key, this); diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/DotNetNuke.Website.Deprecated.csproj b/DNN Platform/DotNetNuke.Website.Deprecated/DotNetNuke.Website.Deprecated.csproj index b5b35e0cb6e..14d2098f69d 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/DotNetNuke.Website.Deprecated.csproj +++ b/DNN Platform/DotNetNuke.Website.Deprecated/DotNetNuke.Website.Deprecated.csproj @@ -75,12 +75,6 @@ - - ..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - @@ -157,10 +151,6 @@ - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - {ddf18e36-41a0-4ca7-a098-78ca6e6f41c1} DotNetNuke.Instrumentation @@ -197,7 +187,6 @@ Designer - diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs index 71f0a2d82e0..67352eb4c48 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -23,13 +23,14 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Globalization; using System.Linq; +using System.Text; using System.Threading; using System.Web; -using System.Web.UI.WebControls; -using Microsoft.Extensions.DependencyInjection; +using System.Web.UI; -using DotNetNuke.Abstractions; +using DotNetNuke.Application; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Content.Taxonomy; using DotNetNuke.Entities.Modules; @@ -44,6 +45,7 @@ using DotNetNuke.Services.Localization; using DotNetNuke.Services.Log.EventLog; using DotNetNuke.Services.Personalization; +using DotNetNuke.UI.ControlPanels; using DotNetNuke.UI.Utilities; using DotNetNuke.Web.UI; using DotNetNuke.Web.UI.WebControls; @@ -58,17 +60,13 @@ namespace DotNetNuke.UI.ControlPanel { + using System.Web.UI.WebControls; + public partial class AddModule : UserControlBase, IDnnRibbonBarTool { - private readonly INavigationManager _navigationManager; private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof (AddModule)); private bool _enabled = true; - public AddModule() - { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); - } - /// /// Return the for the selected portal (from the Site list), unless /// the site list is not visible or there are no other sites in our site group, in which case @@ -169,7 +167,7 @@ protected override void OnLoad(EventArgs e) var objModule = ModuleController.Instance.GetModuleByDefinition(-1, "Extensions"); if (objModule != null) { - var strURL = _navigationManager.NavigateURL(objModule.TabID, true); + var strURL = Globals.NavigateURL(objModule.TabID, true); hlMoreExtensions.NavigateUrl = strURL + "#moreExtensions"; } else @@ -406,7 +404,7 @@ protected DesktopModuleInfo SelectedModule return null; } - } + } #endregion @@ -480,7 +478,7 @@ private void DoAddExistingModule(int moduleId, int tabId, string paneName, int p if ((cloneModule)) { newModule.ModuleID = Null.NullInteger; - + //copy module settings and tab module settings newModule.ModuleSettings.Clear(); foreach (var key in moduleInfo.ModuleSettings.Keys) @@ -916,4 +914,4 @@ public bool CanAddModuleToPage() } } -} +} \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs index 9c4cddbeb15..90f323ae21c 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -24,7 +24,6 @@ using System.Collections; using System.IO; using System.Web.UI; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; using DotNetNuke.Common.Utilities; @@ -42,17 +41,10 @@ namespace DotNetNuke.UI.ControlPanel { - using DotNetNuke.Abstractions; using System.Web.UI.WebControls; public partial class AddPage : UserControl, IDnnRibbonBarTool { - private readonly INavigationManager _navigationManager; - public AddPage() - { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); - } - #region "Event Handlers" protected override void OnLoad(EventArgs e) @@ -124,7 +116,7 @@ protected void CmdAddPageClick(object sender, EventArgs e) if ((string.IsNullOrEmpty(errMsg))) { - Response.Redirect(_navigationManager.NavigateURL(newTab.TabID)); + Response.Redirect(Globals.NavigateURL(newTab.TabID)); } else { @@ -262,4 +254,4 @@ private string GetString(string key) #endregion } -} +} \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs index ed3ef32c5f4..e7efcbedc32 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -27,7 +27,6 @@ using System.Linq; using System.Text; using System.Web; -using Microsoft.Extensions.DependencyInjection; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using DotNetNuke.Application; @@ -53,7 +52,6 @@ using DotNetNuke.Web.Components.Controllers; using DotNetNuke.Web.Components.Controllers.Models; using Globals = DotNetNuke.Common.Globals; -using DotNetNuke.Abstractions; #endregion @@ -63,15 +61,9 @@ namespace DotNetNuke.UI.ControlPanels { public partial class ControlBar : ControlPanelBase { - private readonly INavigationManager _navigationManager; - public ControlBar() - { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); - } - - private readonly IList _adminCommonTabs = new List { "Site Settings", - "Security Roles", - "User Accounts", + private readonly IList _adminCommonTabs = new List { "Site Settings", + "Security Roles", + "User Accounts", "File Management" }; private readonly IList _hostCommonTabs = new List { "Host Settings", @@ -92,7 +84,7 @@ public ControlBar() protected string LoadTabModuleMessage { get; set; } - protected string BookmarkModuleCategory + protected string BookmarkModuleCategory { get { @@ -122,7 +114,7 @@ public override bool IncludeInControlHierarchy return base.IncludeInControlHierarchy && (IsPageAdmin() || IsModuleAdmin()); } } - + #region Event Handlers protected override void OnInit(EventArgs e) @@ -142,7 +134,7 @@ protected override void OnInit(EventArgs e) } protected override void OnLoad(EventArgs e) - { + { base.OnLoad(e); if (PortalSettings.EnablePopUps && Host.EnableModuleOnLineHelp) @@ -183,7 +175,7 @@ protected override void OnLoad(EventArgs e) LoadTabModuleMessage = multipleSite ? GetString("LoadingTabModuleCE.Text") : GetString("LoadingTabModule.Text"); } - + #endregion #region Protected Methods @@ -197,7 +189,7 @@ protected bool CheckPageQuota() protected string GetUpgradeIndicator() { UserInfo objUser = UserController.Instance.GetCurrentUserInfo(); - + if (objUser != null && objUser.IsSuperUser) { var upgradeIndicator = ControlBarController.Instance.GetUpgradeIndicator(DotNetNukeContext.Current.Application.Version, @@ -216,28 +208,28 @@ private void LoadCustomMenuItems() { foreach (var menuItem in ControlBarController.Instance.GetCustomMenuItems()) { - var liElement = new HtmlGenericControl("li"); + var liElement = new HtmlGenericControl("li"); liElement.Attributes.Add("id", menuItem.ID + "_tab"); var control = Page.LoadControl(menuItem.Source); control.ID = menuItem.ID; - + liElement.Controls.Add(control); - + CustomMenuItems.Controls.Add(liElement); } } private string GetUpgradeIndicatorButton(UpgradeIndicatorViewModel upgradeIndicator) - { + { return string.Format("\"{4}\"", upgradeIndicator.ID, upgradeIndicator.WebAction, upgradeIndicator.CssClass, ResolveClientUrl(upgradeIndicator.ImageUrl), upgradeIndicator.AltText, upgradeIndicator.ToolTip); } protected string PreviewPopup() { - var previewUrl = string.Format("{0}/Default.aspx?ctl={1}&previewTab={2}&TabID={2}", - Globals.AddHTTP(PortalSettings.PortalAlias.HTTPAlias), + var previewUrl = string.Format("{0}/Default.aspx?ctl={1}&previewTab={2}&TabID={2}", + Globals.AddHTTP(PortalSettings.PortalAlias.HTTPAlias), "MobilePreview", PortalSettings.ActiveTab.TabID); @@ -284,7 +276,7 @@ protected IEnumerable LoadPaneList() p.ToString(), "BOTTOM" }; - + resultPanes.Add(botPane); } } @@ -298,7 +290,7 @@ protected string GetString(string key) return Localization.GetString(key, LocalResourceFile); } - protected string BuildToolUrl(string toolName, bool isHostTool, string moduleFriendlyName, + protected string BuildToolUrl(string toolName, bool isHostTool, string moduleFriendlyName, string controlKey, string navigateUrl, bool showAsPopUp) { if (isHostTool && !UserController.Instance.GetCurrentUserInfo().IsSuperUser) @@ -317,68 +309,68 @@ protected string BuildToolUrl(string toolName, bool isHostTool, string moduleFri case "PageSettings": if (TabPermissionController.CanManagePage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=settingTab"); + returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=settingTab"); } break; case "CopyPage": if (TabPermissionController.CanCopyPage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=copy&activeTab=copyTab"); + returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=copy&activeTab=copyTab"); } break; case "DeletePage": if (TabPermissionController.CanDeletePage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=delete"); + returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=delete"); } break; case "PageTemplate": if (TabPermissionController.CanManagePage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=advancedTab"); + returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=advancedTab"); } break; case "PageLocalization": if (TabPermissionController.CanManagePage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=localizationTab"); + returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=localizationTab"); } break; case "PagePermission": if (TabPermissionController.CanAdminPage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=permissionsTab"); + returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=permissionsTab"); } break; case "ImportPage": if (TabPermissionController.CanImportPage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "ImportTab"); + returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "ImportTab"); } break; case "ExportPage": if (TabPermissionController.CanExportPage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "ExportTab"); + returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "ExportTab"); } break; case "NewPage": if (TabPermissionController.CanAddPage()) { - returnValue = _navigationManager.NavigateURL("Tab", "activeTab=settingTab"); + returnValue = Globals.NavigateURL("Tab", "activeTab=settingTab"); } break; case "PublishPage": if (TabPermissionController.CanAdminPage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID); + returnValue = Globals.NavigateURL(PortalSettings.ActiveTab.TabID); } break; default: if (!string.IsNullOrEmpty(moduleFriendlyName)) { var additionalParams = new List(); - returnValue = GetTabURL(additionalParams, toolName, isHostTool, + returnValue = GetTabURL(additionalParams, toolName, isHostTool, moduleFriendlyName, controlKey, showAsPopUp); } break; @@ -386,7 +378,7 @@ protected string BuildToolUrl(string toolName, bool isHostTool, string moduleFri return returnValue; } - protected string GetTabURL(List additionalParams, string toolName, bool isHostTool, + protected string GetTabURL(List additionalParams, string toolName, bool isHostTool, string moduleFriendlyName, string controlKey, bool showAsPopUp) { int portalId = isHostTool ? Null.NullInteger : PortalSettings.PortalId; @@ -413,7 +405,7 @@ protected string GetTabURL(List additionalParams, string toolName, bool } string currentCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name; - strURL = _navigationManager.NavigateURL(moduleInfo.TabID, isHostPage, PortalSettings, controlKey, currentCulture, additionalParams.ToArray()); + strURL = Globals.NavigateURL(moduleInfo.TabID, isHostPage, PortalSettings, controlKey, currentCulture, additionalParams.ToArray()); } return strURL; @@ -552,7 +544,7 @@ protected string GetMenuItem(TabInfo tab, bool isRemoveBookmark = false, bool is } return string.Empty; } - + protected string GetAdminBaseMenu() { @@ -583,7 +575,7 @@ protected string GetAdminAdvancedMenu() protected string GetHostBaseMenu() { var tabs = HostBaseTabs; - + var sb = new StringBuilder(); foreach (var tab in tabs) { @@ -611,7 +603,7 @@ protected string GetBookmarkItems(string title) { var isHostTool = title == "host"; var bookmarkItems = isHostTool ? HostBookmarkItems : AdminBookmarkItems; - + if(bookmarkItems != null && bookmarkItems.Any()) { var sb = new StringBuilder(); @@ -668,7 +660,7 @@ protected IEnumerable LoadLanguagesList() if(CurrentUICulture == null) { object oCulture = Personalization.GetProfile("Usability", "UICulture"); - + if (oCulture != null) { CurrentUICulture = oCulture.ToString(); @@ -680,7 +672,7 @@ protected IEnumerable LoadLanguagesList() SetLanguage(true, CurrentUICulture); } } - + IEnumerable cultureListItems = Localization.LoadCultureInListItems(CultureDropDownTypes.NativeName, CurrentUICulture, "", false); foreach (var cultureItem in cultureListItems) @@ -825,7 +817,7 @@ private bool LoadSiteList() } private void LoadVisibilityList() - { + { var items = new Dictionary { { "0", GetString("PermissionView") }, { "1", GetString("PermissionEdit") } }; VisibilityLst.Items.Clear(); @@ -868,7 +860,7 @@ private void AutoSetUserMode() SetUserMode("EDIT"); SetLastPageHistory(pageId); Response.Redirect(Request.RawUrl, true); - + } return; @@ -957,8 +949,8 @@ protected List AdminBookmarkItems { var bookmarkItems = Personalization.GetProfile("ControlBar", "admin" + PortalSettings.PortalId); - _adminBookmarkItems = bookmarkItems != null - ? bookmarkItems.ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList() + _adminBookmarkItems = bookmarkItems != null + ? bookmarkItems.ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList() : new List(); } @@ -975,14 +967,14 @@ protected List HostBookmarkItems { var bookmarkItems = Personalization.GetProfile("ControlBar", "host" + PortalSettings.PortalId); - _hostBookmarkItems = bookmarkItems != null - ? bookmarkItems.ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList() + _hostBookmarkItems = bookmarkItems != null + ? bookmarkItems.ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList() : new List(); } return _hostBookmarkItems; } - } + } private List _adminTabs; private List _adminBaseTabs; diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs index f30de71e5f9..9128a397bb5 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -24,7 +24,6 @@ using System.IO; using System.Linq; using System.Web.UI; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; using DotNetNuke.Common.Utilities; @@ -44,17 +43,10 @@ namespace DotNetNuke.UI.ControlPanel { - using DotNetNuke.Abstractions; using System.Web.UI.WebControls; public partial class UpdatePage : UserControl, IDnnRibbonBarTool { - private readonly INavigationManager _navigationManager; - public UpdatePage() - { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); - } - #region "Event Handlers" protected override void OnLoad(EventArgs e) @@ -135,7 +127,7 @@ protected void CmdUpdateClick(object sender, EventArgs e) if ((string.IsNullOrEmpty(errMsg))) { - Response.Redirect(_navigationManager.NavigateURL(tab.TabID)); + Response.Redirect(Globals.NavigateURL(tab.TabID)); } else { @@ -383,4 +375,4 @@ private bool IsParentTab(TabInfo tab, int parentTabId) #endregion } -} +} \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs index 3bce79d5c05..5d55c895f19 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -26,10 +26,8 @@ using System.Linq; using System.Web; using System.Web.UI.WebControls; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Host; using DotNetNuke.Entities.Modules; @@ -62,11 +60,6 @@ namespace DotNetNuke.Modules.Admin.FileManager public partial class WebUpload : PortalModuleBase { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof (WebUpload)); - private readonly INavigationManager _navigationManager; - public WebUpload() - { - _navigationManager = DependencyProvider.GetRequiredService(); - } #region "Members" private string _DestinationFolder; @@ -192,7 +185,7 @@ private void CheckSecurity() { if (!ModulePermissionController.HasModulePermission(ModuleConfiguration.ModulePermissions, "CONTENT,EDIT") && !UserController.Instance.GetCurrentUserInfo().IsInRole("Administrators")) { - Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); + Response.Redirect(Globals.NavigateURL("Access Denied"), true); } } @@ -243,7 +236,7 @@ public string ReturnURL() { TabID = int.Parse(Request.Params["rtab"]); } - return _navigationManager.NavigateURL(TabID); + return Globals.NavigateURL(TabID); } protected override void OnInit(EventArgs e) @@ -405,7 +398,7 @@ private void cmdReturn_Click(Object sender, EventArgs e) { Response.Redirect(ReturnURL(), true); } - + #endregion } -} +} \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/packages.config b/DNN Platform/DotNetNuke.Website.Deprecated/packages.config deleted file mode 100644 index 015e7e36813..00000000000 --- a/DNN Platform/DotNetNuke.Website.Deprecated/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/DNN Platform/HttpModules/DotNetNuke.HttpModules.csproj b/DNN Platform/HttpModules/DotNetNuke.HttpModules.csproj index 7ddc4120994..7b42500b543 100644 --- a/DNN Platform/HttpModules/DotNetNuke.HttpModules.csproj +++ b/DNN Platform/HttpModules/DotNetNuke.HttpModules.csproj @@ -80,10 +80,6 @@ - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - {6b29aded-7b56-4484-bea5-c0e09079535b} DotNetNuke.Library diff --git a/DNN Platform/HttpModules/UrlRewrite/FriendlyUrlProvider.cs b/DNN Platform/HttpModules/UrlRewrite/FriendlyUrlProvider.cs index 39e10cc9f41..aa14afeb46c 100644 --- a/DNN Platform/HttpModules/UrlRewrite/FriendlyUrlProvider.cs +++ b/DNN Platform/HttpModules/UrlRewrite/FriendlyUrlProvider.cs @@ -24,7 +24,7 @@ #region Usings using System; -using DotNetNuke.Abstractions.Portals; + using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; using DotNetNuke.Entities.Urls; @@ -108,7 +108,7 @@ public override string FriendlyUrl(TabInfo tab, string path, string pageName) return _providerInstance.FriendlyUrl(tab, path, pageName); } - public override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings) + public override string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings settings) { return _providerInstance.FriendlyUrl(tab, path, pageName, settings); } diff --git a/DNN Platform/Library/Common/Globals.cs b/DNN Platform/Library/Common/Globals.cs index faf938c754d..61ee689db81 100644 --- a/DNN Platform/Library/Common/Globals.cs +++ b/DNN Platform/Library/Common/Globals.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -40,8 +40,7 @@ using System.Web.UI; using System.Web.UI.HtmlControls; using System.Xml; -using DotNetNuke.Abstractions; -using DotNetNuke.Abstractions.Portals; + using DotNetNuke.Application; using DotNetNuke.Collections.Internal; using DotNetNuke.Common.Internal; @@ -99,7 +98,7 @@ public sealed class Globals public static readonly Regex FileValidNameRegex = new Regex(@"^(?!(?:PRN|AUX|CLOCK\$|NUL|CON|COM\d|LPT\d)(?:\..+)?$)[^\x00-\x1F\xA5\\?*:\"";|\/<>]+(??[\\]^`{|}"; - + #region PerformanceSettings enum /// @@ -148,13 +147,13 @@ public enum PerformanceSettings /// /// /// NoRegistration: Disabled registration in portal. - /// PrivateRegistration: Once user's account information has been submitted, - /// the portal Administrator will be notified and user's application will be subjected to a screening procedure. + /// PrivateRegistration: Once user's account information has been submitted, + /// the portal Administrator will be notified and user's application will be subjected to a screening procedure. /// If user's application is authorized, the user will receive notification of access to the portal environment. - /// PublicRegistration: Once user's account information has been submitted, + /// PublicRegistration: Once user's account information has been submitted, /// user will be immediately granted access to the portal environment. - /// VerifiedRegistration: Once user's account information has been submitted, - /// user will receive an email containing unique Verification Code. + /// VerifiedRegistration: Once user's account information has been submitted, + /// user will receive an email containing unique Verification Code. /// The Verification Code will be required the first time when user attempt to sign in to the portal environment. /// public enum PortalRegistrationType @@ -616,12 +615,12 @@ public static UpgradeStatus Status { if (IsInstalled()) { - //Errors connecting to the database after an initial installation should be treated as errors. + //Errors connecting to the database after an initial installation should be treated as errors. tempStatus = UpgradeStatus.Error; } else { - //An error that occurs before the database has been installed should be treated as a new install + //An error that occurs before the database has been installed should be treated as a new install tempStatus = UpgradeStatus.Install; } } @@ -678,7 +677,7 @@ public static bool IncrementalVersionExists(Version version) if (Directory.Exists(providerpath)) { var incrementalcount = Directory.GetFiles(providerpath, Upgrade.GetStringVersion(version) + ".*." + Upgrade.DefaultProvider).Length; - + if (incrementalcount > Globals.GetLastAppliedIteration(version)) { return true; @@ -694,7 +693,7 @@ public static bool IncrementalVersionExists(Version version) /// /// /// - /// If DotNetNuke has been installed, then we should treat database connection errors as real errors. + /// If DotNetNuke has been installed, then we should treat database connection errors as real errors. /// If DotNetNuke has not been installed, then we should expect to have database connection problems /// since the connection string may not have been configured yet, which can occur during the installation /// wizard. @@ -713,7 +712,7 @@ internal static bool IsInstalled() bool isInstalled = (!IsInstallationURL()) && ((installationdatefactor + dataproviderfactor + htmlmodulefactor + portaldirectoryfactor + localexecutionfactor) >= c_PassingScore); - // we need to tighten this check. We now are enforcing the existence of the InstallVersion value in web.config. If + // we need to tighten this check. We now are enforcing the existence of the InstallVersion value in web.config. If // this value exists, then DNN was previously installed, and we should never try to re-install it return isInstalled || HasInstallVersion(); } @@ -810,7 +809,7 @@ private static bool IsInstallationURL() /// if set to true [is super tab]. /// The settings. /// return the tab's culture code, if ths tab doesn't exist, it will return current culture name. - internal static string GetCultureCode(int TabID, bool IsSuperTab, IPortalSettings settings) + internal static string GetCultureCode(int TabID, bool IsSuperTab, PortalSettings settings) { string cultureCode = Null.NullString; if (settings != null) @@ -1216,14 +1215,14 @@ public static int GetLastAppliedIteration(Version version) { try { - return DataProvider.Instance().GetLastAppliedIteration(version.Major, version.Minor, version.Build); + return DataProvider.Instance().GetLastAppliedIteration(version.Major, version.Minor, version.Build); } catch (Exception) { return 0; } - + } /// @@ -1501,7 +1500,7 @@ public static PortalSettings GetPortalSettings() /// ----------------------------------------------------------------------------- /// - /// Returns the folder path under the root for the portal + /// Returns the folder path under the root for the portal /// /// The folder the absolute path /// Portal Id. @@ -1560,7 +1559,7 @@ public static void SetStatus(UpgradeStatus status) /// ----------------------------------------------------------------------------- /// - /// ImportFile - converts a file url (/Portals/0/somefile.gif) to the appropriate + /// ImportFile - converts a file url (/Portals/0/somefile.gif) to the appropriate /// FileID=xx identification for use in importing portals, tabs and modules /// /// @@ -2113,8 +2112,8 @@ public static Control FindControlRecursive(Control objControl, string strControl /// Name of control to look for /// /// - /// This differs from FindControlRecursive in that it looks down the control hierarchy, whereas, the - /// FindControlRecursive starts at the passed in control and walks the tree up. Therefore, this function is + /// This differs from FindControlRecursive in that it looks down the control hierarchy, whereas, the + /// FindControlRecursive starts at the passed in control and walks the tree up. Therefore, this function is /// more a expensive task. /// /// ----------------------------------------------------------------------------- @@ -2154,7 +2153,7 @@ public static void SetFormFocus(Control control) } else { - //Create JavaScript + //Create JavaScript var sb = new StringBuilder(); sb.Append(""); - // Register Client Script + // Register Client Script ClientAPI.RegisterClientScriptBlock(control.Page, "InitialFocus", sb.ToString()); } } @@ -2290,7 +2289,7 @@ private static void DeleteFile(string filePath) Logger.Error(ex); } } - + private static void DeleteFolder(string strRoot) { try @@ -2366,7 +2365,7 @@ public static string CleanFileName(string FileName, string BadChars, string Repl /// ----------------------------------------------------------------------------- /// /// CleanName - removes characters from Module/Tab names that are being used for file names - /// in Module/Tab Import/Export. + /// in Module/Tab Import/Export. /// /// /// @@ -2386,9 +2385,9 @@ public static string CleanName(string Name) /// ----------------------------------------------------------------------------- /// - /// CreateValidClass - removes characters from Module/Tab names which are invalid + /// CreateValidClass - removes characters from Module/Tab names which are invalid /// for use as an XHTML class attribute / CSS class selector value and optionally - /// prepends the letter 'A' if the first character is not alphabetic. This differs + /// prepends the letter 'A' if the first character is not alphabetic. This differs /// from CreateValidID which replaces invalid characters with an underscore /// and replaces the first letter with an 'A' if it is not alphabetic /// @@ -2432,7 +2431,7 @@ public static string CreateValidClass(string inputValue, bool validateFirstChar) // If we're asked to validate the first character... if ((validateFirstChar)) { - // classes should begin with a letter ([A-Za-z])' + // classes should begin with a letter ([A-Za-z])' // prepend a starting non-letter character with an A if ((InvalidCharacters.IsMatch(returnValue))) { @@ -2486,7 +2485,7 @@ public static string CreateValidID(string inputValue) // Replace all characters that aren't in the list with an underscore returnValue = InvalidCharacters.Replace(inputValue, "_"); - // identifiers '... must begin with a letter ([A-Za-z])' + // identifiers '... must begin with a letter ([A-Za-z])' // replace a starting non-letter character with an A returnValue = InvalidInitialCharacters.Replace(returnValue, "A"); @@ -2515,7 +2514,6 @@ public static string AccessDeniedURL() /// URL to access denied view public static string AccessDeniedURL(string Message) { - var navigationManager = DependencyProvider.GetRequiredService(); string strURL = ""; PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); if (HttpContext.Current.Request.IsAuthenticated) @@ -2523,14 +2521,14 @@ public static string AccessDeniedURL(string Message) if (String.IsNullOrEmpty(Message)) { //redirect to access denied page - strURL = navigationManager.NavigateURL(_portalSettings.ActiveTab.TabID, "Access Denied"); + strURL = NavigateURL(_portalSettings.ActiveTab.TabID, "Access Denied"); } else { //redirect to access denied page with custom message var messageGuid = DataProvider.Instance().AddRedirectMessage( _portalSettings.UserId, _portalSettings.ActiveTab.TabID, Message).ToString("N"); - strURL = navigationManager.NavigateURL(_portalSettings.ActiveTab.TabID, "Access Denied", "message=" + messageGuid); + strURL = NavigateURL(_portalSettings.ActiveTab.TabID, "Access Denied", "message=" + messageGuid); } } else @@ -2573,7 +2571,7 @@ public static string ApplicationURL() { return (ApplicationURL(_portalSettings.ActiveTab.TabID)); } - return (ApplicationURL(-1)); + return (ApplicationURL(-1)); } /// ----------------------------------------------------------------------------- @@ -2686,7 +2684,7 @@ public static string FriendlyUrl(TabInfo tab, string path, string pageName) /// The path to format. /// The portal settings /// The formatted (friendly) URL - public static string FriendlyUrl(TabInfo tab, string path, IPortalSettings settings) + public static string FriendlyUrl(TabInfo tab, string path, PortalSettings settings) { return FriendlyUrl(tab, path, glbDefaultPage, settings); } @@ -2695,7 +2693,7 @@ public static string FriendlyUrl(TabInfo tab, string path, IPortalSettings setti /// Generates the correctly formatted friendly URL /// /// - /// This overload includes an optional page to include in the URL, and the portal + /// This overload includes an optional page to include in the URL, and the portal /// settings for the site /// /// The current tab @@ -2703,7 +2701,7 @@ public static string FriendlyUrl(TabInfo tab, string path, IPortalSettings setti /// The page to include in the URL. /// The portal settings /// The formatted (friendly) url - public static string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings) + public static string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings settings) { return FriendlyUrlProvider.Instance().FriendlyUrl(tab, path, pageName, settings); } @@ -2712,7 +2710,7 @@ public static string FriendlyUrl(TabInfo tab, string path, string pageName, IPor /// Generates the correctly formatted friendly url /// /// - /// This overload includes an optional page to include in the url, and the portal + /// This overload includes an optional page to include in the url, and the portal /// alias for the site /// /// The current tab @@ -2758,7 +2756,7 @@ public static TabType GetURLType(string URL) /// /// Url's as internal links to Files, Tabs and Users should only be imported if /// those files, tabs and users exist. This function parses the url, and checks - /// whether the internal links exist. + /// whether the internal links exist. /// If the link does not exist, the function will return an empty string /// /// Integer @@ -2842,7 +2840,6 @@ public static string LoginURL(string returnUrl, bool overrideSetting) /// Formatted URL. public static string LoginURL(string returnUrl, bool overrideSetting, PortalSettings portalSettings) { - var navigationManager = DependencyProvider.GetRequiredService(); string loginUrl; if (!string.IsNullOrEmpty(returnUrl)) { @@ -2859,24 +2856,24 @@ public static string LoginURL(string returnUrl, bool overrideSetting, PortalSett if (ValidateLoginTabID(portalSettings.LoginTabId)) { loginUrl = string.IsNullOrEmpty(returnUrl) - ? navigationManager.NavigateURL(portalSettings.LoginTabId, "", popUpParameter) - : navigationManager.NavigateURL(portalSettings.LoginTabId, "", returnUrl, popUpParameter); + ? NavigateURL(portalSettings.LoginTabId, "", popUpParameter) + : NavigateURL(portalSettings.LoginTabId, "", returnUrl, popUpParameter); } else { string strMessage = string.Format("error={0}", Localization.GetString("NoLoginControl", Localization.GlobalResourceFile)); //No account module so use portal tab loginUrl = string.IsNullOrEmpty(returnUrl) - ? navigationManager.NavigateURL(portalSettings.ActiveTab.TabID, "Login", strMessage, popUpParameter) - : navigationManager.NavigateURL(portalSettings.ActiveTab.TabID, "Login", returnUrl, strMessage, popUpParameter); + ? NavigateURL(portalSettings.ActiveTab.TabID, "Login", strMessage, popUpParameter) + : NavigateURL(portalSettings.ActiveTab.TabID, "Login", returnUrl, strMessage, popUpParameter); } } else { //portal tab loginUrl = string.IsNullOrEmpty(returnUrl) - ? navigationManager.NavigateURL(portalSettings.ActiveTab.TabID, "Login", popUpParameter) - : navigationManager.NavigateURL(portalSettings.ActiveTab.TabID, "Login", returnUrl, popUpParameter); + ? NavigateURL(portalSettings.ActiveTab.TabID, "Login", popUpParameter) + : NavigateURL(portalSettings.ActiveTab.TabID, "Login", returnUrl, popUpParameter); } return loginUrl; } @@ -2891,7 +2888,7 @@ public static string UserProfileURL(int userId) string strURL = ""; PortalSettings portalSettings = PortalController.Instance.GetCurrentPortalSettings(); - strURL = DependencyProvider.GetRequiredService().NavigateURL(portalSettings.UserTabId, "", string.Format("userId={0}", userId)); + strURL = NavigateURL(portalSettings.UserTabId, "", string.Format("userId={0}", userId)); return strURL; } @@ -2901,10 +2898,10 @@ public static string UserProfileURL(int userId) /// /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL() { - return DependencyProvider.GetRequiredService().NavigateURL(); + PortalSettings portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + return NavigateURL(portalSettings.ActiveTab.TabID, Null.NullString); } /// @@ -2913,10 +2910,9 @@ public static string NavigateURL() /// The tab ID. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID) { - return DependencyProvider.GetRequiredService().NavigateURL(tabID); + return NavigateURL(tabID, Null.NullString); } /// @@ -2926,10 +2922,11 @@ public static string NavigateURL(int tabID) /// if set to true the page is a "super-tab," i.e. a host-level page. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, bool isSuperTab) { - return DependencyProvider.GetRequiredService().NavigateURL(tabID, isSuperTab); + PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + string cultureCode = GetCultureCode(tabID, isSuperTab, _portalSettings); + return NavigateURL(tabID, isSuperTab, _portalSettings, Null.NullString, cultureCode); } /// @@ -2938,10 +2935,17 @@ public static string NavigateURL(int tabID, bool isSuperTab) /// The control key, or or null. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(string controlKey) { - return DependencyProvider.GetRequiredService().NavigateURL(controlKey); + if (controlKey == "Access Denied") + { + return AccessDeniedURL(); + } + else + { + PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + return NavigateURL(_portalSettings.ActiveTab.TabID, controlKey); + } } /// @@ -2951,10 +2955,10 @@ public static string NavigateURL(string controlKey) /// Any additional parameters, in "key=value" format. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(string controlKey, params string[] additionalParameters) { - return DependencyProvider.GetRequiredService().NavigateURL(controlKey, additionalParameters); + PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + return NavigateURL(_portalSettings?.ActiveTab?.TabID ?? -1, controlKey, additionalParameters); } /// @@ -2964,10 +2968,10 @@ public static string NavigateURL(string controlKey, params string[] additionalPa /// The control key, or or null. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, string controlKey) { - return DependencyProvider.GetRequiredService().NavigateURL(tabID, controlKey); + PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + return NavigateURL(tabID, _portalSettings, controlKey, null); } /// @@ -2978,10 +2982,10 @@ public static string NavigateURL(int tabID, string controlKey) /// Any additional parameters. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, string controlKey, params string[] additionalParameters) { - return DependencyProvider.GetRequiredService().NavigateURL(tabID, controlKey, additionalParameters); + PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + return NavigateURL(tabID, _portalSettings, controlKey, additionalParameters); } /// @@ -2993,10 +2997,11 @@ public static string NavigateURL(int tabID, string controlKey, params string[] a /// Any additional parameters. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, PortalSettings settings, string controlKey, params string[] additionalParameters) { - return DependencyProvider.GetRequiredService().NavigateURL(tabID, settings, controlKey, additionalParameters); + bool isSuperTab = IsHostTab(tabID); + + return NavigateURL(tabID, isSuperTab, settings, controlKey, additionalParameters); } /// @@ -3009,10 +3014,10 @@ public static string NavigateURL(int tabID, PortalSettings settings, string cont /// Any additional parameters. /// Formatted URL. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, params string[] additionalParameters) { - return DependencyProvider.GetRequiredService().NavigateURL(tabID, isSuperTab, settings, controlKey, additionalParameters); + string cultureCode = GetCultureCode(tabID, isSuperTab, settings); + return NavigateURL(tabID, isSuperTab, settings, controlKey, cultureCode, additionalParameters); } /// @@ -3025,10 +3030,9 @@ public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings sett /// The language code. /// Any additional parameters. /// Formatted URL. - [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, params string[] additionalParameters) { - return DependencyProvider.GetRequiredService().NavigateURL(tabID, isSuperTab, settings, controlKey, language, additionalParameters); + return NavigateURL(tabID, isSuperTab, settings, controlKey, language, glbDefaultPage, additionalParameters); } /// @@ -3042,10 +3046,75 @@ public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings sett /// The page name to pass to . /// Any additional parameters. /// Formatted url. - [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.")] public static string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, string pageName, params string[] additionalParameters) { - return DependencyProvider.GetRequiredService().NavigateURL(tabID, isSuperTab, settings, controlKey, language, pageName, additionalParameters); + string url = tabID == Null.NullInteger ? ApplicationURL() : ApplicationURL(tabID); + if (!String.IsNullOrEmpty(controlKey)) + { + url += "&ctl=" + controlKey; + } + if (additionalParameters != null) + { + url = additionalParameters.Where(parameter => !string.IsNullOrEmpty(parameter)).Aggregate(url, (current, parameter) => current + ("&" + parameter)); + } + if (isSuperTab) + { + url += "&portalid=" + settings.PortalId; + } + + TabInfo tab = null; + + if (settings != null) + { + tab = TabController.Instance.GetTab(tabID, isSuperTab ? Null.NullInteger : settings.PortalId, false); + } + + //only add language to url if more than one locale is enabled + if (settings != null && language != null && LocaleController.Instance.GetLocales(settings.PortalId).Count > 1) + { + if (settings.ContentLocalizationEnabled) + { + if (language == "") + { + if (tab != null && !string.IsNullOrEmpty(tab.CultureCode)) + { + url += "&language=" + tab.CultureCode; + } + } + else + { + url += "&language=" + language; + } + } + else if (settings.EnableUrlLanguage) + { + //legacy pre 5.5 behavior + if (language == "") + { + url += "&language=" + Thread.CurrentThread.CurrentCulture.Name; + } + else + { + url += "&language=" + language; + } + } + } + + if (Host.UseFriendlyUrls || Config.GetFriendlyUrlProvider() == "advanced") + { + if (String.IsNullOrEmpty(pageName)) + { + pageName = glbDefaultPage; + } + + url = (settings == null) ? FriendlyUrl(tab, url, pageName) : FriendlyUrl(tab, url, pageName, settings); + } + else + { + url = ResolveUrl(url); + } + + return url; } /// @@ -3092,7 +3161,6 @@ public static string QueryStringDecode(string QueryString) /// Formatted url. public static string RegisterURL(string returnURL, string originalURL) { - var navigationManager = DependencyProvider.GetRequiredService(); string strURL; PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); string extraParams = String.Empty; @@ -3107,11 +3175,11 @@ public static string RegisterURL(string returnURL, string originalURL) if (_portalSettings.RegisterTabId != -1) { //user defined tab - strURL = navigationManager.NavigateURL(_portalSettings.RegisterTabId, "", extraParams); + strURL = NavigateURL(_portalSettings.RegisterTabId, "", extraParams); } else { - strURL = navigationManager.NavigateURL(_portalSettings.ActiveTab.TabID, "Register", extraParams); + strURL = NavigateURL(_portalSettings.ActiveTab.TabID, "Register", extraParams); } return strURL; } @@ -3321,7 +3389,7 @@ public static string LinkClick(string Link, int TabID, int ModuleID, bool TrackC strLink = ApplicationPath + "/LinkClick.aspx?fileticket=" + UrlUtils.EncryptParameter(UrlUtils.GetParameterValue(Link), portalGuid); if (PortalId == Null.NullInteger) //To track Host files { - strLink += "&hf=1"; + strLink += "&hf=1"; } } if (String.IsNullOrEmpty(strLink)) @@ -3359,7 +3427,7 @@ public static string LinkClick(string Link, int TabID, int ModuleID, bool TrackC switch (UrlType) { case TabType.Tab: - strLink = DependencyProvider.GetRequiredService().NavigateURL(int.Parse(Link)); + strLink = NavigateURL(int.Parse(Link)); break; default: strLink = Link; @@ -3701,8 +3769,8 @@ public static bool IsHostTab(int tabId) /// /// Return User Profile Picture Formatted Url. UserId, width and height can be passed to build a formatted Avatar Url. - /// - /// Formatted url, e.g. http://www.mysite.com/DnnImageHandler.ashx?mode=profilepic&userid={0}&h={1}&w={2} + /// + /// Formatted url, e.g. http://www.mysite.com/DnnImageHandler.ashx?mode=profilepic&userid={0}&h={1}&w={2} /// /// Usage: ascx - <asp:Image ID="avatar" runat="server" CssClass="SkinObject" /> /// code behind - avatar.ImageUrl = string.Format(Globals.UserProfilePicFormattedUrl(), userInfo.UserID, 32, 32) @@ -3720,14 +3788,14 @@ public static string UserProfilePicFormattedUrl() avatarUrl, !HttpContext.Current.Request.Url.IsDefaultPort && !avatarUrl.Contains(":") ? ":" + HttpContext.Current.Request.Url.Port : string.Empty); - avatarUrl += "/DnnImageHandler.ashx?mode=profilepic&userId={0}&h={1}&w={2}"; + avatarUrl += "/DnnImageHandler.ashx?mode=profilepic&userId={0}&h={1}&w={2}"; return avatarUrl; } /// /// Return User Profile Picture relative Url. UserId, width and height can be passed to build a formatted relative Avatar Url. - /// + /// /// Formatted url, e.g. /DnnImageHandler.ashx?userid={0}&h={1}&w={2} considering child portal /// /// Usage: ascx - <asp:Image ID="avatar" runat="server" CssClass="SkinObject" /> @@ -3741,7 +3809,7 @@ public static string UserProfilePicRelativeUrl() /// /// Return User Profile Picture relative Url. UserId, width and height can be passed to build a formatted relative Avatar Url. - /// + /// /// Indicates if cdv (Cache Delayed Verification) has to be included in the returned URL. /// Formatted url, e.g. /DnnImageHandler.ashx?userid={0}&h={1}&w={2} considering child portal /// @@ -3768,9 +3836,9 @@ public static string UserProfilePicRelativeUrl(bool includeCdv) return ApplicationPath + childPortalAlias + query + cdv; } - + #region "Obsolete - retained for Binary Compatability" - + // **************************************************************************************** // Constants are inlined in code and would require a rebuild of any module or skinobject // that may be using these constants. @@ -3888,4 +3956,4 @@ public static TimeSpan ElapsedSinceAppStart } } } -} +} \ No newline at end of file diff --git a/DNN Platform/Library/Common/Internal/GlobalsImpl.cs b/DNN Platform/Library/Common/Internal/GlobalsImpl.cs index 3835ea7138f..2482fab29d7 100644 --- a/DNN Platform/Library/Common/Internal/GlobalsImpl.cs +++ b/DNN Platform/Library/Common/Internal/GlobalsImpl.cs @@ -1,43 +1,35 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Text; using System.Web; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; using DotNetNuke.UI.UserControls; -using Microsoft.Extensions.DependencyInjection; namespace DotNetNuke.Common.Internal { public class GlobalsImpl : IGlobals { - protected INavigationManager NavigationManager { get; } - public GlobalsImpl() - { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); - } - public string ApplicationPath { get { return Globals.ApplicationPath; } @@ -91,7 +83,7 @@ public string GetDomainName(Uri requestedUri) public string GetDomainName(Uri requestedUri, bool parsePortNumber) { var domainName = new StringBuilder(); - + // split both URL separater, and parameter separator // We trim right of '?' so test for filename extensions can occur at END of URL-componenet. // Test: 'www.aspxforum.net' should be returned as a valid domain name. @@ -126,7 +118,7 @@ public string GetDomainName(Uri requestedUri, bool parsePortNumber) needExit = true; break; default: - // exclude filenames ENDing in ".aspx" or ".axd" --- + // exclude filenames ENDing in ".aspx" or ".axd" --- // we'll use reverse match, // - but that means we are checking position of left end of the match; // - and to do that, we need to ensure the string we test against is long enough; @@ -188,57 +180,57 @@ public string LoginURL(string returnURL, bool @override) public string NavigateURL() { - return NavigationManager.NavigateURL(); + return Globals.NavigateURL(); } public string NavigateURL(int tabID) { - return NavigationManager.NavigateURL(tabID); + return Globals.NavigateURL(tabID); } public string NavigateURL(int tabID, bool isSuperTab) { - return NavigationManager.NavigateURL(tabID, isSuperTab); + return Globals.NavigateURL(tabID, isSuperTab); } public string NavigateURL(string controlKey) { - return NavigationManager.NavigateURL(controlKey); + return Globals.NavigateURL(controlKey); } public string NavigateURL(string controlKey, params string[] additionalParameters) { - return NavigationManager.NavigateURL(controlKey, additionalParameters); + return Globals.NavigateURL(controlKey, additionalParameters); } public string NavigateURL(int tabID, string controlKey) { - return NavigationManager.NavigateURL(tabID, controlKey); + return Globals.NavigateURL(tabID, controlKey); } public string NavigateURL(int tabID, string controlKey, params string[] additionalParameters) { - return NavigationManager.NavigateURL(tabID, controlKey, additionalParameters); + return Globals.NavigateURL(tabID, controlKey, additionalParameters); } public string NavigateURL(int tabID, PortalSettings settings, string controlKey, params string[] additionalParameters) { - return NavigationManager.NavigateURL(tabID, settings, controlKey, additionalParameters); + return Globals.NavigateURL(tabID, settings, controlKey, additionalParameters); } public string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, params string[] additionalParameters) { - return NavigationManager.NavigateURL(tabID, isSuperTab, settings, controlKey, additionalParameters); + return Globals.NavigateURL(tabID, isSuperTab, settings, controlKey, additionalParameters); } public string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, params string[] additionalParameters) { - return NavigationManager.NavigateURL(tabID, isSuperTab, settings, controlKey, language, additionalParameters); + return Globals.NavigateURL(tabID, isSuperTab, settings, controlKey, language, additionalParameters); } public string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, string pageName, params string[] additionalParameters) { - return NavigationManager.NavigateURL(tabID, isSuperTab, settings, controlKey, language, pageName, additionalParameters); + return Globals.NavigateURL(tabID, isSuperTab, settings, controlKey, language, pageName, additionalParameters); } public string FriendlyUrl(TabInfo tab, string path) @@ -266,4 +258,4 @@ public string FriendlyUrl(TabInfo tab, string path, string pageName, string port return Globals.FriendlyUrl(tab, path, pageName, portalAlias); } } -} +} \ No newline at end of file diff --git a/DNN Platform/Library/Common/NavigationManager.cs b/DNN Platform/Library/Common/NavigationManager.cs deleted file mode 100644 index ddbd89d6092..00000000000 --- a/DNN Platform/Library/Common/NavigationManager.cs +++ /dev/null @@ -1,237 +0,0 @@ -using DotNetNuke.Abstractions; -using DotNetNuke.Abstractions.Portals; -using DotNetNuke.Common.Utilities; -using DotNetNuke.Entities.Host; -using DotNetNuke.Entities.Portals; -using DotNetNuke.Entities.Tabs; -using DotNetNuke.Services.Localization; -using System; -using System.Linq; -using System.Threading; - -namespace DotNetNuke.Common -{ - internal class NavigationManager : INavigationManager - { - private readonly IPortalController _portalController; - public NavigationManager(IPortalController portalController) - { - _portalController = portalController; - } - - /// - /// Gets the URL to the current page. - /// - /// Formatted URL. - public string NavigateURL() - { - PortalSettings portalSettings = _portalController.GetCurrentPortalSettings(); - return NavigateURL(portalSettings.ActiveTab.TabID, Null.NullString); - } - - /// - /// Gets the URL to the given page. - /// - /// The tab ID. - /// Formatted URL. - public string NavigateURL(int tabID) - { - return NavigateURL(tabID, Null.NullString); - } - - /// - /// Gets the URL to the given page. - /// - /// The tab ID. - /// if set to true the page is a "super-tab," i.e. a host-level page. - /// Formatted URL. - public string NavigateURL(int tabID, bool isSuperTab) - { - IPortalSettings _portalSettings = _portalController.GetCurrentSettings(); - string cultureCode = Globals.GetCultureCode(tabID, isSuperTab, _portalSettings); - return NavigateURL(tabID, isSuperTab, _portalSettings, Null.NullString, cultureCode); - } - - /// - /// Gets the URL to show the control associated with the given control key. - /// - /// The control key, or or null. - /// Formatted URL. - public string NavigateURL(string controlKey) - { - if (controlKey == "Access Denied") - { - return Globals.AccessDeniedURL(); - } - else - { - PortalSettings _portalSettings = _portalController.GetCurrentPortalSettings(); - return NavigateURL(_portalSettings.ActiveTab.TabID, controlKey); - } - } - - /// - /// Gets the URL to show the control associated with the given control key. - /// - /// The control key, or or null. - /// Any additional parameters, in "key=value" format. - /// Formatted URL. - public string NavigateURL(string controlKey, params string[] additionalParameters) - { - PortalSettings _portalSettings = _portalController.GetCurrentPortalSettings(); - return NavigateURL(_portalSettings?.ActiveTab?.TabID ?? -1, controlKey, additionalParameters); - } - - /// - /// Gets the URL to show the control associated with the given control key on the given page. - /// - /// The tab ID. - /// The control key, or or null. - /// Formatted URL. - public string NavigateURL(int tabID, string controlKey) - { - PortalSettings _portalSettings = _portalController.GetCurrentPortalSettings(); - return NavigateURL(tabID, _portalSettings, controlKey, null); - } - - /// - /// Gets the URL to show the given page. - /// - /// The tab ID. - /// The control key, or or null. - /// Any additional parameters. - /// Formatted URL. - public string NavigateURL(int tabID, string controlKey, params string[] additionalParameters) - { - PortalSettings _portalSettings = _portalController.GetCurrentPortalSettings(); - return NavigateURL(tabID, _portalSettings, controlKey, additionalParameters); - } - - /// - /// Gets the URL to show the given page. - /// - /// The tab ID. - /// The portal settings. - /// The control key, or or null. - /// Any additional parameters. - /// Formatted URL. - public string NavigateURL(int tabID, IPortalSettings settings, string controlKey, params string[] additionalParameters) - { - bool isSuperTab = Globals.IsHostTab(tabID); - - return NavigateURL(tabID, isSuperTab, settings, controlKey, additionalParameters); - } - - /// - /// Gets the URL to show the given page. - /// - /// The tab ID. - /// if set to true the page is a "super-tab," i.e. a host-level page. - /// The portal settings. - /// The control key, or or null. - /// Any additional parameters. - /// Formatted URL. - public string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, params string[] additionalParameters) - { - string cultureCode = Globals.GetCultureCode(tabID, isSuperTab, settings); - return NavigateURL(tabID, isSuperTab, settings, controlKey, cultureCode, additionalParameters); - } - - /// - /// Gets the URL to show the given page. - /// - /// The tab ID. - /// if set to true the page is a "super-tab," i.e. a host-level page. - /// The portal settings. - /// The control key, or or null. - /// The language code. - /// Any additional parameters. - /// Formatted URL. - public string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, string language, params string[] additionalParameters) - { - return NavigateURL(tabID, isSuperTab, settings, controlKey, language, Globals.glbDefaultPage, additionalParameters); - } - - /// - /// Gets the URL to show the given page. - /// - /// The tab ID. - /// if set to true the page is a "super-tab," i.e. a host-level page. - /// The portal settings. - /// The control key, or or null. - /// The language code. - /// The page name to pass to . - /// Any additional parameters. - /// Formatted url. - public string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, string language, string pageName, params string[] additionalParameters) - { - string url = tabID == Null.NullInteger ? Globals.ApplicationURL() : Globals.ApplicationURL(tabID); - if (!String.IsNullOrEmpty(controlKey)) - { - url += "&ctl=" + controlKey; - } - if (additionalParameters != null) - { - url = additionalParameters.Where(parameter => !string.IsNullOrEmpty(parameter)).Aggregate(url, (current, parameter) => current + ("&" + parameter)); - } - if (isSuperTab) - { - url += "&portalid=" + settings.PortalId; - } - - TabInfo tab = null; - - if (settings != null) - { - tab = TabController.Instance.GetTab(tabID, isSuperTab ? Null.NullInteger : settings.PortalId, false); - } - - //only add language to url if more than one locale is enabled - if (settings != null && language != null && LocaleController.Instance.GetLocales(settings.PortalId).Count > 1) - { - if (settings.ContentLocalizationEnabled) - { - if (language == "") - { - if (tab != null && !string.IsNullOrEmpty(tab.CultureCode)) - { - url += "&language=" + tab.CultureCode; - } - } - else - { - url += "&language=" + language; - } - } - else if (settings.EnableUrlLanguage) - { - //legacy pre 5.5 behavior - if (language == "") - { - url += "&language=" + Thread.CurrentThread.CurrentCulture.Name; - } - else - { - url += "&language=" + language; - } - } - } - - if (Host.UseFriendlyUrls || Config.GetFriendlyUrlProvider() == "advanced") - { - if (String.IsNullOrEmpty(pageName)) - { - pageName = Globals.glbDefaultPage; - } - - url = (settings == null) ? Globals.FriendlyUrl(tab, url, pageName) : Globals.FriendlyUrl(tab, url, pageName, settings); - } - else - { - url = Globals.ResolveUrl(url); - } - - return url; - } - } -} diff --git a/DNN Platform/Library/Common/Utilities/UrlUtils.cs b/DNN Platform/Library/Common/Utilities/UrlUtils.cs index d3620619ae7..3903d631a10 100644 --- a/DNN Platform/Library/Common/Utilities/UrlUtils.cs +++ b/DNN Platform/Library/Common/Utilities/UrlUtils.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -26,8 +26,7 @@ using System.Text.RegularExpressions; using System.Web; using System.Web.UI; -using Microsoft.Extensions.DependencyInjection; -using DotNetNuke.Abstractions; + using DotNetNuke.Entities.Controllers; using DotNetNuke.Entities.Host; using DotNetNuke.Entities.Portals; @@ -41,8 +40,6 @@ namespace DotNetNuke.Common.Utilities { public class UrlUtils { - private static readonly INavigationManager _navigationManager = Globals.DependencyProvider.GetRequiredService(); - public static string Combine(string baseUrl, string relativeUrl) { if (baseUrl.Length == 0) @@ -194,12 +191,12 @@ public static bool IsSecureConnectionOrSslOffload(HttpRequest request) { return true; } - + } } return false; } - + private static bool IsRequestSSLOffloaded(HttpRequest request) { var sslOffLoadHeader = HostController.Instance.GetString("SSLOffloadHeader", ""); @@ -223,7 +220,7 @@ public static void OpenNewWindow(Page page, Type type, string url) public static string PopUpUrl(string url, Control control, PortalSettings portalSettings, bool onClickEvent, bool responseRedirect) { return PopUpUrl(url, control, portalSettings, onClickEvent, responseRedirect, 550, 950); - } + } public static string PopUpUrl(string url, Control control, PortalSettings portalSettings, bool onClickEvent, bool responseRedirect, int windowHeight, int windowWidth) { @@ -237,7 +234,7 @@ public static string PopUpUrl(string url, PortalSettings portalSettings, bool on public static string PopUpUrl(string url, Control control, PortalSettings portalSettings, bool onClickEvent, bool responseRedirect, int windowHeight, int windowWidth, bool refresh, string closingUrl) { - + if (UrlUtils.IsSecureConnectionOrSslOffload(HttpContext.Current.Request)) { url = url.Replace("http://", "https://"); @@ -417,7 +414,7 @@ public static void Handle404Exception(HttpResponse response, PortalSettings port { if (portalSetting?.ErrorPage404 > Null.NullInteger) { - response.Redirect(_navigationManager.NavigateURL(portalSetting.ErrorPage404, string.Empty, "status=404")); + response.Redirect(Globals.NavigateURL(portalSetting.ErrorPage404, string.Empty, "status=404")); } else { diff --git a/DNN Platform/Library/ComponentModel/ComponentBase.cs b/DNN Platform/Library/ComponentModel/ComponentBase.cs index e4190d1dd12..679039dcb14 100644 --- a/DNN Platform/Library/ComponentModel/ComponentBase.cs +++ b/DNN Platform/Library/ComponentModel/ComponentBase.cs @@ -28,16 +28,10 @@ namespace DotNetNuke.ComponentModel { public abstract class ComponentBase where TType : class, TContract { - private static TContract _testableInstance; - private static bool _useTestable = false; - public static TContract Instance { get { - if (_useTestable && _testableInstance != null) - return _testableInstance; - var component = ComponentFactory.GetComponent(); if (component == null) @@ -50,27 +44,6 @@ public static TContract Instance } } - /// - /// Registers an instance to use for the Singleton - /// - /// Intended for unit testing purposes, not thread safe - /// - internal static void SetTestableInstance(TContract instance) - { - _testableInstance = instance; - _useTestable = true; - } - - /// - /// Clears the current instance, a new instance will be initialized when next requested - /// - /// Intended for unit testing purposes, not thread safe - internal static void ClearInstance() - { - _useTestable = false; - _testableInstance = default(TContract); - } - public static void RegisterInstance(TContract instance) { if ((ComponentFactory.GetComponent() == null)) diff --git a/DNN Platform/Library/DotNetNuke.Library.csproj b/DNN Platform/Library/DotNetNuke.Library.csproj index 6b779405514..bb3faf62835 100644 --- a/DNN Platform/Library/DotNetNuke.Library.csproj +++ b/DNN Platform/Library/DotNetNuke.Library.csproj @@ -189,7 +189,6 @@ - @@ -1780,10 +1779,6 @@ {ca056730-5759-41f8-a6c1-420f9c0c63e7} CountryListBox - - {6928a9b1-f88a-4581-a132-d3eb38669bb0} - DotNetNuke.Abstractions - {0fca217a-5f9a-4f5b-a31b-86d64ae65198} DotNetNuke.DependencyInjection diff --git a/DNN Platform/Library/Entities/Portals/IPortalController.cs b/DNN Platform/Library/Entities/Portals/IPortalController.cs index b5f4384a455..79c23ee7f1c 100644 --- a/DNN Platform/Library/Entities/Portals/IPortalController.cs +++ b/DNN Platform/Library/Entities/Portals/IPortalController.cs @@ -24,7 +24,6 @@ using System; using System.Collections; using System.Collections.Generic; -using DotNetNuke.Abstractions.Portals; using DotNetNuke.Entities.Users; namespace DotNetNuke.Entities.Portals @@ -95,15 +94,8 @@ int CreatePortal(string portalName, UserInfo adminUser, string description, stri /// Gets the current portal settings. /// /// portal settings. - [Obsolete("Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0. Use GetCurrentSettings instead.")] PortalSettings GetCurrentPortalSettings(); - /// - /// Gets the current portal settings. - /// - /// portal settings. - IPortalSettings GetCurrentSettings(); - /// /// Gets information of a portal /// diff --git a/DNN Platform/Library/Entities/Portals/PortalController.cs b/DNN Platform/Library/Entities/Portals/PortalController.cs index 4914c689a8f..2702fc625ed 100644 --- a/DNN Platform/Library/Entities/Portals/PortalController.cs +++ b/DNN Platform/Library/Entities/Portals/PortalController.cs @@ -63,7 +63,6 @@ using DotNetNuke.Web.Client; using ICSharpCode.SharpZipLib.Zip; using FileInfo = DotNetNuke.Services.FileSystem.FileInfo; -using IAbPortalSettings = DotNetNuke.Abstractions.Portals.IPortalSettings; #endregion @@ -2336,11 +2335,6 @@ PortalSettings IPortalController.GetCurrentPortalSettings() return GetCurrentPortalSettingsInternal(); } - IAbPortalSettings IPortalController.GetCurrentSettings() - { - return GetCurrentPortalSettingsInternal(); - } - /// /// Gets information of a portal /// diff --git a/DNN Platform/Library/Entities/Portals/PortalSettings.cs b/DNN Platform/Library/Entities/Portals/PortalSettings.cs index e9676735071..454d4690c21 100644 --- a/DNN Platform/Library/Entities/Portals/PortalSettings.cs +++ b/DNN Platform/Library/Entities/Portals/PortalSettings.cs @@ -34,7 +34,6 @@ using DotNetNuke.Services.Personalization; using DotNetNuke.Services.Tokens; using DotNetNuke.Common; -using DotNetNuke.Abstractions.Portals; #endregion @@ -48,7 +47,7 @@ namespace DotNetNuke.Entities.Portals /// /// ----------------------------------------------------------------------------- [Serializable] - public partial class PortalSettings : BaseEntityInfo, IPropertyAccess, IPortalSettings + public partial class PortalSettings : BaseEntityInfo, IPropertyAccess { #region ControlPanelPermission enum diff --git a/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs b/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs index 25bf5bb51da..c0ac90af887 100644 --- a/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs +++ b/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs @@ -31,7 +31,7 @@ using System.Text; using System.Text.RegularExpressions; using System.Web; -using DotNetNuke.Abstractions.Portals; + using DotNetNuke.Common; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Portals; @@ -72,13 +72,13 @@ internal override string FriendlyUrl(TabInfo tab, string path, string pageName) return FriendlyUrl(tab, path, pageName, PortalController.Instance.GetCurrentPortalSettings()); } - internal override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings portalSettings) + internal override string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings portalSettings) { if (portalSettings == null) { throw new ArgumentNullException("portalSettings"); } - return FriendlyUrlInternal(tab, path, pageName, String.Empty, (PortalSettings)portalSettings); + return FriendlyUrlInternal(tab, path, pageName, String.Empty, portalSettings); } internal override string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias) diff --git a/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs b/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs index 13faef5af0a..d528caefdc6 100644 --- a/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs +++ b/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs @@ -28,7 +28,7 @@ using System.Collections.Specialized; using System.Text.RegularExpressions; using System.Web; -using DotNetNuke.Abstractions.Portals; + using DotNetNuke.Common; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; @@ -324,9 +324,9 @@ internal override string FriendlyUrl(TabInfo tab, string path, string pageName) return FriendlyUrl(tab, path, pageName, _portalSettings); } - internal override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings) + internal override string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings settings) { - return FriendlyUrl(tab, path, pageName, ((PortalSettings)settings)?.PortalAlias.HTTPAlias, settings); + return FriendlyUrl(tab, path, pageName, settings.PortalAlias.HTTPAlias, settings); } internal override string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias) @@ -334,7 +334,7 @@ internal override string FriendlyUrl(TabInfo tab, string path, string pageName, return FriendlyUrl(tab, path, pageName, portalAlias, null); } - private string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias, IPortalSettings portalSettings) + private string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias, PortalSettings portalSettings) { string friendlyPath = path; bool isPagePath = (tab != null); diff --git a/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs b/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs index 79df757019c..17ab55c27ae 100644 --- a/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs +++ b/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs @@ -25,7 +25,7 @@ using System; using System.Collections.Specialized; -using DotNetNuke.Abstractions.Portals; + using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; @@ -64,7 +64,7 @@ internal FriendlyUrlProviderBase(NameValueCollection attributes) internal abstract string FriendlyUrl(TabInfo tab, string path, string pageName); - internal abstract string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings portalSettings); + internal abstract string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings portalSettings); internal abstract string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias); } diff --git a/DNN Platform/Library/Properties/AssemblyInfo.cs b/DNN Platform/Library/Properties/AssemblyInfo.cs index 1d4cb3576d3..e45941bb5cd 100644 --- a/DNN Platform/Library/Properties/AssemblyInfo.cs +++ b/DNN Platform/Library/Properties/AssemblyInfo.cs @@ -56,14 +56,4 @@ [assembly: InternalsVisibleTo("DotNetNuke.Tests.Web.Mvc")] [assembly: InternalsVisibleTo("DotNetNuke.Tests.Urls")] [assembly: InternalsVisibleTo("DotNetNuke.Tests.Professional")] -[assembly: InternalsVisibleTo("DotNetNuke.SiteExportImport")] -[assembly: InternalsVisibleTo("DotNetNuke.Web.DDRMenu")] // Once Globals is refactored to Dependency Injection we should be able to remove this -[assembly: InternalsVisibleTo("Dnn.PersonaBar.Extensions")] // Once Globals is refactored to Dependency Injection we should be able to remove this -[assembly: InternalsVisibleTo("DotNetNuke.Modules.Html")] // Once Globals is refactored to Dependency Injection we should be able to remove this -[assembly: InternalsVisibleTo("DotNetNuke.Website.Deprecated")] // Once Globals is refactored to Dependency Injection we should be able to remove this -[assembly: InternalsVisibleTo("Dnn.PersonaBar.UI")] // Once Globals is refactored to Dependency Injection we should be able to remove this -[assembly: InternalsVisibleTo("Dnn.PersonaBar.Library")] // Once Globals is refactored to Dependency Injection we should be able to remove this -[assembly: InternalsVisibleTo("DotNetNuke.Modules.Groups")] // Once Globals is refactored to Dependency Injection we should be able to remove this -[assembly: InternalsVisibleTo("DotNetNuke.Modules.Journal")] // Once Globals is refactored to Dependency Injection we should be able to remove this -[assembly: InternalsVisibleTo("DotNetNuke.Modules.RazorHost")] // Once Globals is refactored to Dependency Injection we should be able to remove this -[assembly: InternalsVisibleTo("DotNetNuke.Website")] // Once Globals is refactored to Dependency Injection we should be able to remove this +[assembly: InternalsVisibleTo("DotNetNuke.SiteExportImport")] \ No newline at end of file diff --git a/DNN Platform/Library/Services/Url/FriendlyUrl/FriendlyUrlProvider.cs b/DNN Platform/Library/Services/Url/FriendlyUrl/FriendlyUrlProvider.cs index 50401affca8..8367f0ed3a3 100644 --- a/DNN Platform/Library/Services/Url/FriendlyUrl/FriendlyUrlProvider.cs +++ b/DNN Platform/Library/Services/Url/FriendlyUrl/FriendlyUrlProvider.cs @@ -20,7 +20,6 @@ #endregion #region Usings -using DotNetNuke.Abstractions.Portals; using DotNetNuke.ComponentModel; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; @@ -47,7 +46,7 @@ public static FriendlyUrlProvider Instance() public abstract string FriendlyUrl(TabInfo tab, string path, string pageName); - public abstract string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings); + public abstract string FriendlyUrl(TabInfo tab, string path, string pageName, PortalSettings settings); public abstract string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias); diff --git a/DNN Platform/Library/Startup.cs b/DNN Platform/Library/Startup.cs index c411541f521..004d633f122 100644 --- a/DNN Platform/Library/Startup.cs +++ b/DNN Platform/Library/Startup.cs @@ -1,7 +1,4 @@ -using DotNetNuke.Common; -using DotNetNuke.Abstractions; -using DotNetNuke.DependencyInjection; -using DotNetNuke.Entities.Portals; +using DotNetNuke.DependencyInjection; using DotNetNuke.UI.Modules; using DotNetNuke.UI.Modules.Html5; using Microsoft.Extensions.DependencyInjection; @@ -15,8 +12,6 @@ public void ConfigureServices(IServiceCollection services) services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); - services.AddTransient(x => PortalController.Instance); - services.AddTransient(); } } } diff --git a/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs b/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs index c777300f23f..9a5af7ba9d4 100644 --- a/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs +++ b/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -23,10 +23,8 @@ using System; using System.Globalization; using System.Threading; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Internal; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Portals; @@ -38,12 +36,6 @@ namespace DotNetNuke.UI.Modules { public abstract class ProfileModuleUserControlBase : ModuleUserControlBase, IProfileModule { - protected INavigationManager NavigationManager { get; } - public ProfileModuleUserControlBase() - { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); - } - #region IProfileModule Members public abstract bool DisplayModule { get; } @@ -104,15 +96,15 @@ private string GetRedirectUrl() protected override void OnInit(EventArgs e) { - if (string.IsNullOrEmpty(Request.Params["UserId"]) && - (ModuleContext.PortalSettings.ActiveTab.TabID == ModuleContext.PortalSettings.UserTabId + if (string.IsNullOrEmpty(Request.Params["UserId"]) && + (ModuleContext.PortalSettings.ActiveTab.TabID == ModuleContext.PortalSettings.UserTabId || ModuleContext.PortalSettings.ActiveTab.ParentId == ModuleContext.PortalSettings.UserTabId)) { try { //Clicked on breadcrumb - don't know which user Response.Redirect(Request.IsAuthenticated - ? NavigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "", "UserId=" + ModuleContext.PortalSettings.UserId.ToString(CultureInfo.InvariantCulture)) + ? Globals.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "", "UserId=" + ModuleContext.PortalSettings.UserId.ToString(CultureInfo.InvariantCulture)) : GetRedirectUrl(), true); } catch (ThreadAbortException) @@ -126,4 +118,4 @@ protected override void OnInit(EventArgs e) #endregion } -} +} \ No newline at end of file diff --git a/DNN Platform/Library/UI/Skins/Skin.cs b/DNN Platform/Library/UI/Skins/Skin.cs index d19eac71597..a797f0fcf6f 100644 --- a/DNN Platform/Library/UI/Skins/Skin.cs +++ b/DNN Platform/Library/UI/Skins/Skin.cs @@ -35,7 +35,6 @@ using DotNetNuke.Application; using DotNetNuke.Collections.Internal; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Controllers; using DotNetNuke.Entities.Host; @@ -106,7 +105,6 @@ public class Skin : UserControlBase public Skin() { ModuleControlPipeline = Globals.DependencyProvider.GetRequiredService(); - NavigationManager = Globals.DependencyProvider.GetRequiredService(); } #region Protected Properties @@ -127,7 +125,6 @@ internal Control ControlPanel } protected IModuleControlPipeline ModuleControlPipeline { get; } - protected INavigationManager NavigationManager { get; } #endregion #region Friend Properties @@ -467,7 +464,7 @@ private bool ProcessMasterModules() if (TabVersionController.Instance.GetTabVersions(TabController.CurrentPage.TabID).All(tabVersion => tabVersion.Version != urlVersion)) { - Response.Redirect(NavigationManager.NavigateURL(PortalSettings.ErrorPage404, string.Empty, "status=404")); + Response.Redirect(Globals.NavigateURL(PortalSettings.ErrorPage404, string.Empty, "status=404")); } } diff --git a/DNN Platform/Modules/DDRMenu/DNNAbstract.cs b/DNN Platform/Modules/DDRMenu/DNNAbstract.cs index da69ab1c024..5ea3923373d 100644 --- a/DNN Platform/Modules/DDRMenu/DNNAbstract.cs +++ b/DNN Platform/Modules/DDRMenu/DNNAbstract.cs @@ -3,8 +3,7 @@ using System; using System.Collections.Generic; using System.Web; -using Microsoft.Extensions.DependencyInjection; -using DotNetNuke.Abstractions; +using DotNetNuke.Framework; using DotNetNuke.UI; using DotNetNuke.UI.WebControls; using DotNetNuke.Web.DDRMenu.DNNCommon; @@ -16,6 +15,8 @@ namespace DotNetNuke.Web.DDRMenu { + using DotNetNuke.Framework.JavaScriptLibraries; + internal static class DNNAbstract { public static string GetLoginUrl() @@ -24,7 +25,7 @@ public static string GetLoginUrl() if (request.IsAuthenticated) { - return Globals.DependencyProvider.GetRequiredService().NavigateURL(PortalSettings.Current.ActiveTab.TabID, "Logoff"); + return Globals.NavigateURL(PortalSettings.Current.ActiveTab.TabID, "Logoff"); } var returnUrl = HttpContext.Current.Request.RawUrl; @@ -45,7 +46,7 @@ public static string GetUserUrl() { if (portalSettings.UserRegistration != (int)Globals.PortalRegistrationType.NoRegistration) { - return Globals.RegisterURL(HttpUtility.UrlEncode(Globals.DependencyProvider.GetRequiredService().NavigateURL()), Null.NullString); + return Globals.RegisterURL(HttpUtility.UrlEncode(Globals.NavigateURL()), Null.NullString); } } else @@ -85,4 +86,4 @@ public static void DNNNodeToMenuNode(DNNNode dnnNode, MenuNode menuNode) menuNode.LargeImage = dnnNode.LargeImage; } } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj b/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj index eb3c5ee360f..89c99396841 100644 --- a/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj +++ b/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj @@ -83,12 +83,6 @@ _dependencies\Ealo\05.05.00\effority.ealo.dll False - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - @@ -193,17 +187,12 @@ Designer - - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - {03e3afa5-ddc9-48fb-a839-ad4282ce237e} DotNetNuke.Web.Client diff --git a/DNN Platform/Modules/DDRMenu/packages.config b/DNN Platform/Modules/DDRMenu/packages.config deleted file mode 100644 index 015e7e36813..00000000000 --- a/DNN Platform/Modules/DDRMenu/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj b/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj index eab5609f596..513ee51d14a 100644 --- a/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj +++ b/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj @@ -81,12 +81,6 @@ False ..\..\DotNetNuke.WebUtility\bin\DotNetNuke.WebUtility.dll - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - ..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll True @@ -297,10 +291,6 @@ - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - {9ba59b3d-9ffb-4a9e-bd7d-8b58d08b3a33} DotNetNuke.Web.Deprecated diff --git a/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs b/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs index 87dbece2f5b..1d66802548f 100644 --- a/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs @@ -1,29 +1,27 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Linq; -using Microsoft.Extensions.DependencyInjection; -using DotNetNuke.Abstractions; using DotNetNuke.Common; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; @@ -37,12 +35,6 @@ namespace DotNetNuke.Modules.DigitalAssets { public partial class EditFolderMapping : PortalModuleBase { - private readonly INavigationManager _navigationManager; - public EditFolderMapping() - { - _navigationManager = DependencyProvider.GetRequiredService(); - } - #region Private Variables private readonly IFolderMappingController _folderMappingController = FolderMappingController.Instance; @@ -135,7 +127,7 @@ protected override void OnLoad(EventArgs e) private void cmdUpdate_Click(object sender, EventArgs e) { Page.Validate("vgEditFolderMapping"); - + if (!Page.IsValid) return; try @@ -208,8 +200,8 @@ private void cmdUpdate_Click(object sender, EventArgs e) return; } - if (!Response.IsRequestBeingRedirected) - Response.Redirect(_navigationManager.NavigateURL(TabId, "FolderMappings", "mid=" + ModuleId, "popUp=true")); + if (!Response.IsRequestBeingRedirected) + Response.Redirect(Globals.NavigateURL(TabId, "FolderMappings", "mid=" + ModuleId, "popUp=true")); } catch (Exception exc) { @@ -262,7 +254,7 @@ private void BindFolderMappingSettings() } if (string.IsNullOrEmpty(folderProviderType)) return; - + var settingsControlVirtualPath = FolderProvider.Instance(folderProviderType).GetSettingsControlVirtualPath(); if (String.IsNullOrEmpty(settingsControlVirtualPath)) return; @@ -281,5 +273,5 @@ private void BindFolderMappingSettings() } #endregion - } -} + } +} \ No newline at end of file diff --git a/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs b/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs index fdf5c30031c..34598bbf176 100644 --- a/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs @@ -1,30 +1,28 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Collections.Generic; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Application; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Framework.JavaScriptLibraries; @@ -40,12 +38,6 @@ namespace DotNetNuke.Modules.DigitalAssets { public partial class FolderMappings : PortalModuleBase { - private readonly INavigationManager _navigationManager; - public FolderMappings() - { - _navigationManager = DependencyProvider.GetRequiredService(); - } - #region Private Variables private readonly IFolderMappingController _folderMappingController = FolderMappingController.Instance; @@ -110,7 +102,7 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); JavaScript.RegisterClientReference(Page, ClientAPI.ClientNamespaceReferences.dnn); - CancelButton.NavigateUrl = _navigationManager.NavigateURL(); + CancelButton.NavigateUrl = Globals.NavigateURL(); NewMappingButton.Click += OnNewMappingClick; if (!IsPostBack) @@ -128,7 +120,7 @@ protected void MappingsGrid_OnItemCommand(object source, GridCommandEventArgs e) { if (e.CommandName == "Edit") { - Response.Redirect(_navigationManager.NavigateURL(TabId, "EditFolderMapping", "mid=" + ModuleId, "popUp=true", "ItemID=" + e.CommandArgument.ToString())); + Response.Redirect(Globals.NavigateURL(TabId, "EditFolderMapping", "mid=" + ModuleId, "popUp=true", "ItemID=" + e.CommandArgument.ToString())); } else { @@ -181,7 +173,7 @@ protected void OnNewMappingClick(object sender, EventArgs e) { try { - Response.Redirect(_navigationManager.NavigateURL(TabId, "EditFolderMapping", "mid=" + ModuleId, "popUp=true")); + Response.Redirect(Globals.NavigateURL(TabId, "EditFolderMapping", "mid=" + ModuleId, "popUp=true")); } catch (Exception exc) { @@ -205,4 +197,4 @@ private void UpdateFolderMappings(IList folderMappingsList) #endregion } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/DigitalAssets/View.ascx.cs b/DNN Platform/Modules/DigitalAssets/View.ascx.cs index 5c9a59b8868..48f7831540b 100644 --- a/DNN Platform/Modules/DigitalAssets/View.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/View.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -27,10 +27,8 @@ using System.Text; using System.Text.RegularExpressions; using System.Web; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Icons; using DotNetNuke.Entities.Modules; @@ -66,11 +64,9 @@ public partial class View : PortalModuleBase, IActionable private readonly ExtensionPointManager epm = new ExtensionPointManager(); private NameValueCollection damState; - private readonly INavigationManager _navigationManager; public View() { controller = new Factory().DigitalAssetsController; - _navigationManager = DependencyProvider.GetRequiredService(); } private IExtensionPointFilter Filter @@ -143,7 +139,7 @@ protected string NavigateUrl { get { - var url = _navigationManager.NavigateURL(TabId, "ControlKey", "mid=" + ModuleId, "ReturnUrl=" + Server.UrlEncode(_navigationManager.NavigateURL())); + var url = Globals.NavigateURL(TabId, "ControlKey", "mid=" + ModuleId, "ReturnUrl=" + Server.UrlEncode(Globals.NavigateURL())); //append popUp parameter var delimiter = url.Contains("?") ? "&" : "?"; @@ -154,7 +150,7 @@ protected string NavigateUrl } protected IEnumerable DefaultFolderProviderValues - { + { get { return this.controller.GetDefaultFolderProviderValues(this.ModuleId).Select(f => f.FolderMappingID.ToString(CultureInfo.InvariantCulture)).ToList(); @@ -226,7 +222,7 @@ private void InitializeGrid() var index = Math.Min(columnExtension.ColumnAt, Grid.Columns.Count - 1); Grid.Columns.AddAt(index, column); - } + } } private void LoadSubfolders(DnnTreeNode node, int folderId, string nextFolderName, out DnnTreeNode nextNode, out int nextFolderId) @@ -246,7 +242,7 @@ private void LoadSubfolders(DnnTreeNode node, int folderId, string nextFolderNam { newNode.Expanded = true; nextNode = newNode; - nextFolderId = folder.FolderID; + nextFolderId = folder.FolderID; } } } @@ -280,9 +276,9 @@ private void InitializeTreeViews(string initialPath) if (rootNode.Nodes.Count == 0) { - this.SetExpandable(rootNode, false); + this.SetExpandable(rootNode, false); } - + SetupNodeAttributes(rootNode, GetPermissionsForRootFolder(rootFolder.Permissions), rootFolder); FolderTreeView.Nodes.Clear(); @@ -331,21 +327,21 @@ private void InitializeTreeViewContextMenu() Value = "NewFolder", CssClass = "permission_ADD disabledIfFiltered", ImageUrl = IconController.IconURL("FolderCreate", "16x16", "Gray") - }, + }, new DnnMenuItem { Text = Localization.GetString("RefreshFolder", LocalResourceFile), Value = "RefreshFolder", CssClass = "permission_BROWSE permission_READ", ImageUrl = IconController.IconURL("FolderRefreshSync", "16x16", "Gray") - }, + }, new DnnMenuItem { Text = Localization.GetString("RenameFolder", LocalResourceFile), Value = "RenameFolder", CssClass = "permission_MANAGE", ImageUrl = IconController.IconURL("FileRename", "16x16", "Black") - }, + }, new DnnMenuItem { Text = Localization.GetString("Move", LocalResourceFile), @@ -375,7 +371,7 @@ private void InitializeTreeViewContextMenu() ImageUrl = IconController.IconURL("ViewProperties", "16x16", "CtxtMn") }, }); - + // Dnn Menu Item Extension Point foreach (var menuItem in epm.GetMenuItemExtensionPoints("DigitalAssets", "TreeViewContextMenu", Filter)) { @@ -409,42 +405,42 @@ private void InitializeGridContextMenu() Value = "Download", CssClass = "permission_READ", ImageUrl = IconController.IconURL("FileDownload", "16x16", "Black") - }, + }, new DnnMenuItem { Text = Localization.GetString("Rename", LocalResourceFile), Value = "Rename", CssClass = "permission_MANAGE singleItem", ImageUrl = IconController.IconURL("FileRename", "16x16", "Black") - }, + }, new DnnMenuItem { Text = Localization.GetString("Copy", LocalResourceFile), Value = "Copy", CssClass = "permission_COPY onlyFiles", ImageUrl = IconController.IconURL("FileCopy", "16x16", "Black") - }, + }, new DnnMenuItem { Text = Localization.GetString("Move", LocalResourceFile), Value = "Move", CssClass = "permission_COPY disabledIfFiltered", ImageUrl = IconController.IconURL("FileMove", "16x16", "Black") - }, + }, new DnnMenuItem { Text = Localization.GetString("Delete", LocalResourceFile), Value = "Delete", CssClass = "permission_DELETE", ImageUrl = IconController.IconURL("FileDelete", "16x16", "Black") - }, + }, new DnnMenuItem { Text = Localization.GetString("Unlink", LocalResourceFile), Value = "Unlink", CssClass = "permission_DELETE singleItem onlyFolders", ImageUrl = IconController.IconURL("UnLink", "16x16", "Black") - }, + }, new DnnMenuItem { Text = Localization.GetString("UnzipFile", LocalResourceFile), @@ -458,7 +454,7 @@ private void InitializeGridContextMenu() Value = "Properties", CssClass = "permission_READ singleItem", ImageUrl = IconController.IconURL("ViewProperties", "16x16", "CtxtMn") - }, + }, new DnnMenuItem { Text = Localization.GetString("GetUrl", LocalResourceFile), @@ -491,21 +487,21 @@ private void InitializeEmptySpaceContextMenu() Value = "NewFolder", CssClass = "permission_ADD disabledIfFiltered", ImageUrl = IconController.IconURL("FolderCreate", "16x16", "Gray") - }, + }, new DnnMenuItem { Text = Localization.GetString("RefreshFolder", LocalResourceFile), Value = "RefreshFolder", CssClass = "permission_READ permission_BROWSE", ImageUrl = IconController.IconURL("FolderRefreshSync", "16x16", "Gray") - }, + }, new DnnMenuItem { Text = Localization.GetString("UploadFiles.Title", LocalResourceFile), Value = "UploadFiles", CssClass = "permission_ADD", ImageUrl = IconController.IconURL("UploadFiles", "16x16", "Gray") - }, + }, new DnnMenuItem { Text = Localization.GetString("ViewFolderProperties", LocalResourceFile), @@ -580,8 +576,8 @@ protected override void OnLoad(EventArgs e) Skin.AddModuleMessage(this, Localization.GetString("InvalidUser.Error", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); return; } - - this.RootFolderViewModel = this.controller.GetUserFolder(this.PortalSettings.UserInfo); + + this.RootFolderViewModel = this.controller.GetUserFolder(this.PortalSettings.UserInfo); break; default: @@ -590,7 +586,7 @@ protected override void OnLoad(EventArgs e) this.RootFolderViewModel = this.controller.GetRootFolder(ModuleId); break; } - + var initialPath = ""; int folderId; if (int.TryParse(Request["folderId"] ?? DAMState["folderId"], out folderId)) @@ -697,10 +693,10 @@ protected void GridOnItemCreated(object sender, GridItemEventArgs e) new RadComboBoxItem { Text = "25", Value = "25" }, new RadComboBoxItem { Text = "50", Value = "50" }, new RadComboBoxItem { Text = "100", Value = "100" }, - new RadComboBoxItem - { - Text = Localization.GetString("All", LocalResourceFile), - Value = int.MaxValue.ToString(CultureInfo.InvariantCulture) + new RadComboBoxItem + { + Text = Localization.GetString("All", LocalResourceFile), + Value = int.MaxValue.ToString(CultureInfo.InvariantCulture) } }; @@ -713,4 +709,4 @@ protected void GridOnItemCreated(object sender, GridItemEventArgs e) } } } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/DigitalAssets/packages.config b/DNN Platform/Modules/DigitalAssets/packages.config index 4073d3c4617..4a4092b618b 100644 --- a/DNN Platform/Modules/DigitalAssets/packages.config +++ b/DNN Platform/Modules/DigitalAssets/packages.config @@ -4,7 +4,5 @@ - - \ No newline at end of file diff --git a/DNN Platform/Modules/Groups/Components/GroupViewParser.cs b/DNN Platform/Modules/Groups/Components/GroupViewParser.cs index d8da3f3ae4c..85f50836fd3 100644 --- a/DNN Platform/Modules/Groups/Components/GroupViewParser.cs +++ b/DNN Platform/Modules/Groups/Components/GroupViewParser.cs @@ -2,19 +2,17 @@ using System.Collections.Generic; using System.Linq; using System.Web; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Entities.Portals; using DotNetNuke.Security.Roles; using DotNetNuke.Entities.Users; using DotNetNuke.Common; using DotNetNuke.Services.Localization; -using DotNetNuke.Abstractions; namespace DotNetNuke.Modules.Groups.Components { public class GroupViewParser { - protected INavigationManager NavigationManager { get; } + PortalSettings PortalSettings { get; set; } RoleInfo RoleInfo { get; set; } UserInfo CurrentUser { get; set; } @@ -29,7 +27,6 @@ public GroupViewParser(PortalSettings portalSettings, RoleInfo roleInfo, UserInf CurrentUser = currentUser; Template = template; GroupViewTabId = groupViewTabId; - NavigationManager = Globals.DependencyProvider.GetRequiredService(); } public string ParseView() @@ -90,8 +87,8 @@ public string ParseView() Template = Template.Replace("[GROUPEDITBUTTON]", String.Empty); - var url = NavigationManager.NavigateURL(GroupViewTabId, "", new String[] { "groupid=" + RoleInfo.RoleID.ToString() }); - + var url = Globals.NavigateURL(GroupViewTabId, "", new String[] { "groupid=" + RoleInfo.RoleID.ToString() }); + Template = Utilities.ParseTokenWrapper(Template, "IsPendingMember", membershipPending); Template = Template.Replace("[groupviewurl]", url); Components.GroupItemTokenReplace tokenReplace = new Components.GroupItemTokenReplace(RoleInfo); @@ -99,4 +96,4 @@ public string ParseView() return Template; } } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/Groups/Components/Utilities.cs b/DNN Platform/Modules/Groups/Components/Utilities.cs index 66c243ebcaa..74b097a55f8 100644 --- a/DNN Platform/Modules/Groups/Components/Utilities.cs +++ b/DNN Platform/Modules/Groups/Components/Utilities.cs @@ -1,8 +1,5 @@ using System; using System.Text.RegularExpressions; -using Microsoft.Extensions.DependencyInjection; -using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; namespace DotNetNuke.Modules.Groups { @@ -19,7 +16,7 @@ internal static string ParseTokenWrapper(string Template, string Token, bool Con } public static string NavigateUrl(int TabId, string[] @params) { - return Globals.DependencyProvider.GetRequiredService()?.NavigateURL(TabId, "", @params); + return Common.Globals.NavigateURL(TabId, "", @params); } public static string[] AddParams(string param, string[] currParams) { @@ -31,4 +28,4 @@ public static string[] AddParams(string param, string[] currParams) return tmpParams; } } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/Groups/Create.ascx.cs b/DNN Platform/Modules/Groups/Create.ascx.cs index e1c79c7cffb..9ca2005c3fd 100644 --- a/DNN Platform/Modules/Groups/Create.ascx.cs +++ b/DNN Platform/Modules/Groups/Create.ascx.cs @@ -10,19 +10,13 @@ using System.IO; using DotNetNuke.Security.Permissions; using DotNetNuke.Modules.Groups.Components; -using DotNetNuke.Abstractions; -using Microsoft.Extensions.DependencyInjection; namespace DotNetNuke.Modules.Groups { public partial class Create : GroupsModuleBase { - private readonly INavigationManager _navigationManager; - public Create() - { - _navigationManager = DependencyProvider.GetRequiredService(); - } + protected override void OnInit(EventArgs e) { InitializeComponent(); @@ -115,7 +109,7 @@ private void Create_Click(object sender, EventArgs e) roleInfo.RoleID = RoleController.Instance.AddRole(roleInfo); roleInfo = RoleController.Instance.GetRoleById(PortalId, roleInfo.RoleID); - var groupUrl = _navigationManager.NavigateURL(GroupViewTabId, "", new String[] {"groupid=" + roleInfo.RoleID.ToString()}); + var groupUrl = Globals.NavigateURL(GroupViewTabId, "", new String[] {"groupid=" + roleInfo.RoleID.ToString()}); if (groupUrl.StartsWith("http://") || groupUrl.StartsWith("https://")) { const int startIndex = 8; // length of https:// @@ -165,7 +159,7 @@ private void Create_Click(object sender, EventArgs e) GroupUtilities.CreateJournalEntry(roleInfo, UserInfo); } - Response.Redirect(_navigationManager.NavigateURL(GroupViewTabId, "", new String[] { "groupid=" + roleInfo.RoleID.ToString() })); + Response.Redirect(Globals.NavigateURL(GroupViewTabId, "", new String[] { "groupid=" + roleInfo.RoleID.ToString() })); } } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/Groups/DotNetNuke.Modules.Groups.csproj b/DNN Platform/Modules/Groups/DotNetNuke.Modules.Groups.csproj index 3a9179c47d5..5e1ed5d57c0 100644 --- a/DNN Platform/Modules/Groups/DotNetNuke.Modules.Groups.csproj +++ b/DNN Platform/Modules/Groups/DotNetNuke.Modules.Groups.csproj @@ -51,12 +51,6 @@ False ..\..\DotNetNuke.Web.Client\bin\DotNetNuke.Web.Client.dll - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - False ..\..\..\Packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll @@ -235,10 +229,6 @@ - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - {ee1329fe-fd88-4e1a-968c-345e394ef080} DotNetNuke.Web diff --git a/DNN Platform/Modules/Groups/GroupEdit.ascx.cs b/DNN Platform/Modules/Groups/GroupEdit.ascx.cs index 213e5ce99c1..31a38ca914d 100644 --- a/DNN Platform/Modules/Groups/GroupEdit.ascx.cs +++ b/DNN Platform/Modules/Groups/GroupEdit.ascx.cs @@ -5,19 +5,11 @@ using DotNetNuke.Common.Utilities; using System.IO; using DotNetNuke.Common; -using DotNetNuke.Abstractions; -using Microsoft.Extensions.DependencyInjection; namespace DotNetNuke.Modules.Groups { public partial class GroupEdit : GroupsModuleBase { - private readonly INavigationManager _navigationManager; - public GroupEdit() - { - _navigationManager = DependencyProvider.GetRequiredService(); - } - protected override void OnInit(EventArgs e) { InitializeComponent(); @@ -58,11 +50,11 @@ protected void Page_Load(object sender, EventArgs e) txtGroupName.Text = roleInfo.RoleName; else litGroupName.Text = roleInfo.RoleName; - + txtDescription.Text = roleInfo.Description; rdAccessTypePrivate.Checked = !roleInfo.IsPublic; rdAccessTypePublic.Checked = roleInfo.IsPublic; - + if (roleInfo.Settings.ContainsKey("ReviewMembers")) { @@ -112,7 +104,7 @@ private void Save_Click(object sender, EventArgs e) { roleInfo.RoleName = txtGroupName.Text; } - + roleInfo.Description = txtDescription.Text; roleInfo.IsPublic = rdAccessTypePublic.Checked; @@ -149,8 +141,8 @@ private void Save_Click(object sender, EventArgs e) } - Response.Redirect(_navigationManager.NavigateURL(TabId, "", new String[] { "groupid=" + GroupId.ToString() })); + Response.Redirect(Globals.NavigateURL(TabId, "", new String[] { "groupid=" + GroupId.ToString() })); } } } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/Groups/GroupsModuleBase.cs b/DNN Platform/Modules/Groups/GroupsModuleBase.cs index 1721d929f5f..2897562fd05 100644 --- a/DNN Platform/Modules/Groups/GroupsModuleBase.cs +++ b/DNN Platform/Modules/Groups/GroupsModuleBase.cs @@ -1,22 +1,22 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -28,9 +28,7 @@ using DotNetNuke.Entities.Modules; using DotNetNuke.Modules.Groups.Components; using System; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Security.Permissions; -using DotNetNuke.Abstractions; #endregion @@ -38,12 +36,6 @@ namespace DotNetNuke.Modules.Groups { public class GroupsModuleBase : PortalModuleBase { - protected INavigationManager NavigationManager { get; } - public GroupsModuleBase() - { - NavigationManager = DependencyProvider.GetRequiredService(); - } - public enum GroupMode { Setup = 0, @@ -275,7 +267,7 @@ public string GetCreateUrl() public string GetClearFilterUrl() { - return NavigationManager.NavigateURL(TabId, ""); + return Globals.NavigateURL(TabId, ""); } public string GetEditUrl() @@ -284,4 +276,4 @@ public string GetEditUrl() } #endregion } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/Groups/List.ascx.cs b/DNN Platform/Modules/Groups/List.ascx.cs index ddc0db3b85e..0d723d8fa08 100644 --- a/DNN Platform/Modules/Groups/List.ascx.cs +++ b/DNN Platform/Modules/Groups/List.ascx.cs @@ -1,18 +1,12 @@ using System; -using Microsoft.Extensions.DependencyInjection; + using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Framework; namespace DotNetNuke.Modules.Groups { public partial class List : GroupsModuleBase { - public INavigationManager _navigationManager { get; } - public List() - { - _navigationManager = DependencyProvider.GetRequiredService(); - } protected void Page_Load(object sender, EventArgs e) { ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); @@ -55,7 +49,7 @@ protected void btnSearch_Click(object sender, EventArgs e) { if(!Page.IsValid) return; - Response.Redirect(_navigationManager.NavigateURL(TabId, "", "filter=" + txtFilter.Text.Trim())); + Response.Redirect(Globals.NavigateURL(TabId, "", "filter=" + txtFilter.Text.Trim())); } } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/Groups/ModerationServiceController.cs b/DNN Platform/Modules/Groups/ModerationServiceController.cs index 05c5e919d43..51afa6695c8 100644 --- a/DNN Platform/Modules/Groups/ModerationServiceController.cs +++ b/DNN Platform/Modules/Groups/ModerationServiceController.cs @@ -39,14 +39,12 @@ using DotNetNuke.Services.Social.Notifications; using DotNetNuke.Web.Api; using DotNetNuke.Security; -using DotNetNuke.Abstractions; namespace DotNetNuke.Modules.Groups { [DnnAuthorize] public class ModerationServiceController : DnnApiController { - protected INavigationManager NavigationManager { get; } private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof (ModerationServiceController)); private int _tabId; private int _moduleId; @@ -54,11 +52,6 @@ public class ModerationServiceController : DnnApiController private int _memberId; private RoleInfo _roleInfo; - public ModerationServiceController(INavigationManager navigationManager) - { - NavigationManager = navigationManager; - } - public class NotificationDTO { public int NotificationId { get; set; } @@ -165,7 +158,7 @@ public HttpResponseMessage JoinGroup(RoleDTO postData) RoleController.Instance.AddUserRole(PortalSettings.PortalId, UserInfo.UserID, _roleInfo.RoleID, RoleStatus.Approved, false, Null.NullDate, Null.NullDate); RoleController.Instance.UpdateRole(_roleInfo); - var url = NavigationManager.NavigateURL(postData.GroupViewTabId, "", new[] { "groupid=" + _roleInfo.RoleID }); + var url = Globals.NavigateURL(postData.GroupViewTabId, "", new[] { "groupid=" + _roleInfo.RoleID }); return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", URL = url }); } diff --git a/DNN Platform/Modules/Groups/View.ascx.cs b/DNN Platform/Modules/Groups/View.ascx.cs index 3670b90c70a..7e7cd9f5704 100644 --- a/DNN Platform/Modules/Groups/View.ascx.cs +++ b/DNN Platform/Modules/Groups/View.ascx.cs @@ -1,22 +1,22 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -24,7 +24,6 @@ #region Usings using System; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Modules.Actions; @@ -35,7 +34,6 @@ using DotNetNuke.Modules.Groups.Components; using DotNetNuke.Common; using DotNetNuke.Framework; -using DotNetNuke.Abstractions; #endregion @@ -48,12 +46,6 @@ namespace DotNetNuke.Modules.Groups /// ----------------------------------------------------------------------------- public partial class View : GroupsModuleBase { - private readonly INavigationManager _navigationManager; - public View() - { - _navigationManager = DependencyProvider.GetRequiredService(); - } - #region Event Handlers protected override void OnInit(EventArgs e) @@ -80,14 +72,14 @@ private void Page_Load(object sender, EventArgs e) JavaScript.RequestRegistration(CommonJs.DnnPlugins); if (GroupId < 0) { if (TabId != GroupListTabId && !UserInfo.IsInRole(PortalSettings.AdministratorRoleName)) { - Response.Redirect(_navigationManager.NavigateURL(GroupListTabId)); + Response.Redirect(Globals.NavigateURL(GroupListTabId)); } } GroupsModuleBase ctl = (GroupsModuleBase)LoadControl(ControlPath); ctl.ModuleConfiguration = this.ModuleConfiguration; plhContent.Controls.Clear(); plhContent.Controls.Add(ctl); - + } catch (Exception exc) //Module failed to load { @@ -96,7 +88,7 @@ private void Page_Load(object sender, EventArgs e) } #endregion - - + + } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/Groups/packages.config b/DNN Platform/Modules/Groups/packages.config index 4073d3c4617..4a4092b618b 100644 --- a/DNN Platform/Modules/Groups/packages.config +++ b/DNN Platform/Modules/Groups/packages.config @@ -4,7 +4,5 @@ - - \ No newline at end of file diff --git a/DNN Platform/Modules/Groups/web.config b/DNN Platform/Modules/Groups/web.config index 27ab2d72e82..1b3cf4537a7 100644 --- a/DNN Platform/Modules/Groups/web.config +++ b/DNN Platform/Modules/Groups/web.config @@ -1,10 +1,10 @@ - + - - + + diff --git a/DNN Platform/Modules/HTML/Components/HtmlTextController.cs b/DNN Platform/Modules/HTML/Components/HtmlTextController.cs index b1d86cd9737..50596e9f316 100644 --- a/DNN Platform/Modules/HTML/Components/HtmlTextController.cs +++ b/DNN Platform/Modules/HTML/Components/HtmlTextController.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; @@ -26,7 +26,6 @@ using System.Web; using System.Web.UI; using System.Xml; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; using DotNetNuke.Common.Utilities; @@ -44,7 +43,6 @@ using DotNetNuke.Services.Social.Notifications; using DotNetNuke.Services.Tokens; using DotNetNuke.Services.Exceptions; -using DotNetNuke.Abstractions; namespace DotNetNuke.Modules.Html { @@ -62,11 +60,6 @@ public class HtmlTextController : ModuleSearchBase, IPortable, IUpgradeable { public const int MAX_DESCRIPTION_LENGTH = 100; private const string PortalRootToken = "{{PortalRoot}}"; - protected INavigationManager NavigationManager { get; } - public HtmlTextController() - { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); - } #region Private Methods @@ -114,7 +107,7 @@ private void CreateUserNotifications(HtmlTextInfo objHtmlText) // if not published if (objHtmlText.IsPublished == false) { - arrUsers.Add(objHtmlText.CreatedByUserID); // include content owner + arrUsers.Add(objHtmlText.CreatedByUserID); // include content owner } // if not draft and not published @@ -154,7 +147,7 @@ private void CreateUserNotifications(HtmlTextInfo objHtmlText) // process notifications if (arrUsers.Count > 0 || (objHtmlText.IsPublished && objHtmlText.Notify)) { - // get tabid from module + // get tabid from module ModuleInfo objModule = ModuleController.Instance.GetModule(objHtmlText.ModuleID, Null.NullInteger, true); PortalSettings objPortalSettings = PortalController.Instance.GetCurrentPortalSettings(); @@ -167,14 +160,14 @@ private void CreateUserNotifications(HtmlTextInfo objHtmlText) Localization.LocalSharedResourceFile); string strSubject = Localization.GetString("NotificationSubject", strResourceFile); string strBody = Localization.GetString("NotificationBody", strResourceFile); - strBody = strBody.Replace("[URL]", NavigationManager.NavigateURL(objModule.TabID)); + strBody = strBody.Replace("[URL]", Globals.NavigateURL(objModule.TabID)); strBody = strBody.Replace("[STATE]", objHtmlText.StateName); // process user notification collection foreach (int intUserID in arrUsers) { - // create user notification record + // create user notification record _htmlTextUser = new HtmlTextUserInfo(); _htmlTextUser.ItemID = objHtmlText.ItemID; _htmlTextUser.StateID = objHtmlText.StateID; @@ -271,7 +264,7 @@ public string ReplaceWithRootToken(Match m) var aliases = PortalAliasController.Instance.GetPortalAliases(); if (!aliases.Contains(domain)) { - // this is no not a portal url so even if it contains /portals/.. + // this is no not a portal url so even if it contains /portals/.. // we do not need to replace it with a token return m.ToString(); } @@ -386,8 +379,8 @@ public HtmlTextInfo GetTopHtmlText(int moduleId, bool isPublished, int workflowI htmlText.WorkflowName = "[REPAIR_WORKFLOW]"; var workflowStateController = new WorkflowStateController(); - htmlText.StateID = htmlText.IsPublished - ? workflowStateController.GetLastWorkflowStateID(workflowId) + htmlText.StateID = htmlText.IsPublished + ? workflowStateController.GetLastWorkflowStateID(workflowId) : workflowStateController.GetFirstWorkflowStateID(workflowId); // update object UpdateHtmlText(htmlText, GetMaximumVersionHistory(htmlText.PortalID)); @@ -522,7 +515,7 @@ public static string ManageRelativePaths(string strHTML, string strUploadDirecto strURL = strURL.Substring(strURL.IndexOf(strDirectory) + strDirectory.Length); } // add upload directory - if (!strURL.StartsWith("/") + if (!strURL.StartsWith("/") && !String.IsNullOrEmpty(strURL.Trim())) //We don't write the UploadDirectory if the token/attribute has not value. Therefore we will avoid an unnecessary request { sbBuff.Append(uploadDirectory); @@ -843,7 +836,7 @@ private static List CollectHierarchicalTags(List terms) return collectTagsFunc(terms, new List()); } - + #endregion #region IUpgradeable Members @@ -888,4 +881,4 @@ private void AddNotificationTypes() #endregion } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj b/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj index 241991b2144..c3ec4dba567 100644 --- a/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj +++ b/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj @@ -90,12 +90,6 @@ False ..\..\DotNetNuke.WebUtility\bin\DotNetNuke.WebUtility.dll - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - @@ -189,7 +183,6 @@ - @@ -211,10 +204,6 @@ - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - {ee1329fe-fd88-4e1a-968c-345e394ef080} DotNetNuke.Web diff --git a/DNN Platform/Modules/HTML/EditHtml.ascx.cs b/DNN Platform/Modules/HTML/EditHtml.ascx.cs index 72029ba0bb9..2caca693804 100644 --- a/DNN Platform/Modules/HTML/EditHtml.ascx.cs +++ b/DNN Platform/Modules/HTML/EditHtml.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -26,7 +26,6 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Users; @@ -39,7 +38,6 @@ using DotNetNuke.Common.Utilities; using Telerik.Web.UI; using DotNetNuke.Modules.Html.Components; -using DotNetNuke.Abstractions; #endregion @@ -53,11 +51,6 @@ namespace DotNetNuke.Modules.Html /// public partial class EditHtml : HtmlModuleBase { - private readonly INavigationManager _navigationManager; - public EditHtml() - { - _navigationManager = DependencyProvider.GetRequiredService(); - } #region Private Members @@ -243,11 +236,11 @@ private void DisplayMasterContentButton() { cmdMasterContent.Visible = true; cmdMasterContent.Text = Localization.GetString("cmdShowMasterContent", LocalResourceFile); - + cmdMasterContent.Text = phMasterContent.Visible ? Localization.GetString("cmdHideMasterContent", LocalResourceFile) : Localization.GetString("cmdShowMasterContent", LocalResourceFile); - + } } @@ -306,7 +299,7 @@ private void DisplayEdit(string htmlContent) cmdHistory.Enabled = true; DisplayMasterContentButton(); ddlRender.Visible = true; - + } /// @@ -441,8 +434,8 @@ private HtmlTextInfo GetLastPublishedVersion(int publishedStateID) protected override void OnInit(EventArgs e) { base.OnInit(e); - - hlCancel.NavigateUrl = _navigationManager.NavigateURL(); + + hlCancel.NavigateUrl = Globals.NavigateURL(); cmdEdit.Click += OnEditClick; cmdPreview.Click += OnPreviewClick; @@ -465,7 +458,7 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); try - { + { var htmlContentItemID = -1; var htmlContent = _htmlTextController.GetTopHtmlText(ModuleId, false, WorkflowID); @@ -512,7 +505,7 @@ protected override void OnLoad(EventArgs e) BindRenderItems(); ddlRender.SelectedValue = txtContent.Mode; } - + } catch (Exception exc) { @@ -529,7 +522,7 @@ protected void OnSaveClick(object sender, EventArgs e) // get content var htmlContent = GetLatestHTMLContent(); - var aliases = from PortalAliasInfo pa in PortalAliasController.Instance.GetPortalAliasesByPortalId(PortalSettings.PortalId) + var aliases = from PortalAliasInfo pa in PortalAliasController.Instance.GetPortalAliasesByPortalId(PortalSettings.PortalId) select pa.HTTPAlias; string content; if (phEdit.Visible) @@ -590,7 +583,7 @@ protected void OnSaveClick(object sender, EventArgs e) // redirect back to portal if (redirect) { - Response.Redirect(_navigationManager.NavigateURL(), true); + Response.Redirect(Globals.NavigateURL(), true); } } protected void OnEditClick(object sender, EventArgs e) @@ -634,7 +627,7 @@ private void OnHistoryClick(object sender, EventArgs e) } } - + private void OnMasterContentClick(object sender, EventArgs e) { try @@ -643,7 +636,7 @@ private void OnMasterContentClick(object sender, EventArgs e) cmdMasterContent.Text = phMasterContent.Visible ? Localization.GetString("cmdHideMasterContent", LocalResourceFile) : Localization.GetString("cmdShowMasterContent", LocalResourceFile); - + if (phMasterContent.Visible) DisplayMasterLanguageContent(); } @@ -733,7 +726,7 @@ protected void OnVersionsGridItemDataBound(object sender, GridViewRowEventArgs e if (createdByByUser != null) { createdBy = createdByByUser.DisplayName; - } + } } foreach (TableCell cell in e.Row.Cells) @@ -801,4 +794,4 @@ private void BindRenderItems() #endregion } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/HTML/HtmlModule.ascx.cs b/DNN Platform/Modules/HTML/HtmlModule.ascx.cs index 43e7a09df8b..ab5d62d855a 100644 --- a/DNN Platform/Modules/HTML/HtmlModule.ascx.cs +++ b/DNN Platform/Modules/HTML/HtmlModule.ascx.cs @@ -1,28 +1,27 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings using System; using System.Web.UI; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; using DotNetNuke.Entities.Modules; @@ -35,7 +34,6 @@ using DotNetNuke.Services.Localization; using DotNetNuke.UI.WebControls; using DotNetNuke.Modules.Html.Components; -using DotNetNuke.Abstractions; #endregion @@ -54,12 +52,6 @@ public partial class HtmlModule : HtmlModuleBase, IActionable private bool EditorEnabled; private int WorkflowID; - private readonly INavigationManager _navigationManager; - public HtmlModule() - { - _navigationManager = DependencyProvider.GetRequiredService(); - } - #region "Private Methods" #endregion @@ -203,7 +195,7 @@ private void lblContent_UpdateLabel(object source, DNNLabelEditEventArgs e) { try { - // verify security + // verify security if ((!PortalSecurity.Instance.InputFilter(e.Text, PortalSecurity.FilterFlag.NoScripting).Equals(e.Text))) { throw new SecurityException(); @@ -253,7 +245,7 @@ private void ModuleAction_Click(object sender, ActionEventArgs e) { if (e.Action.CommandArgument == "publish") { - // verify security + // verify security if (IsEditable && PortalSettings.UserMode == PortalSettings.Mode.Edit) { // get content @@ -270,7 +262,7 @@ private void ModuleAction_Click(object sender, ActionEventArgs e) objHTML.UpdateHtmlText(objContent, objHTML.GetMaximumVersionHistory(PortalId)); // refresh page - Response.Redirect(_navigationManager.NavigateURL(), true); + Response.Redirect(Globals.NavigateURL(), true); } } } @@ -388,4 +380,4 @@ public ModuleActionCollection ModuleActions #endregion } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/HTML/MyWork.ascx.cs b/DNN Platform/Modules/HTML/MyWork.ascx.cs index b801ccef5ff..e9e298d03ca 100644 --- a/DNN Platform/Modules/HTML/MyWork.ascx.cs +++ b/DNN Platform/Modules/HTML/MyWork.ascx.cs @@ -1,29 +1,27 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings using System; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Entities.Modules; using DotNetNuke.Services.Exceptions; @@ -39,18 +37,13 @@ namespace DotNetNuke.Modules.Html /// public partial class MyWork : PortalModuleBase { - private readonly INavigationManager _navigationManager; - public MyWork() - { - _navigationManager = DependencyProvider.GetRequiredService(); - } #region Protected Methods public string FormatURL(object dataItem) { var objHtmlTextUser = (HtmlTextUserInfo) dataItem; - return "" + objHtmlTextUser.ModuleTitle + " ( " + objHtmlTextUser.StateName + " )"; + return "" + objHtmlTextUser.ModuleTitle + " ( " + objHtmlTextUser.StateName + " )"; } #endregion @@ -65,7 +58,7 @@ public string FormatURL(object dataItem) protected override void OnLoad(EventArgs e) { base.OnLoad(e); - hlCancel.NavigateUrl = _navigationManager.NavigateURL(); + hlCancel.NavigateUrl = Globals.NavigateURL(); try { @@ -85,4 +78,4 @@ protected override void OnLoad(EventArgs e) #endregion } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/HTML/packages.config b/DNN Platform/Modules/HTML/packages.config deleted file mode 100644 index 015e7e36813..00000000000 --- a/DNN Platform/Modules/HTML/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/DNN Platform/Modules/Journal/Components/FeatureController.cs b/DNN Platform/Modules/Journal/Components/FeatureController.cs index bd52f5c5a10..0f466c80ff2 100644 --- a/DNN Platform/Modules/Journal/Components/FeatureController.cs +++ b/DNN Platform/Modules/Journal/Components/FeatureController.cs @@ -1,22 +1,21 @@ /* ' Copyright (c) 2011 DotNetNuke Corporation ' All rights reserved. -' +' ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF ' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ' DEALINGS IN THE SOFTWARE. -' +' */ using System; using System.Collections.Generic; +//using System.Xml; using System.Linq; using System.Web; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Data; using DotNetNuke.Entities.Modules; @@ -40,12 +39,6 @@ namespace DotNetNuke.Modules.Journal.Components { //uncomment the interfaces to add the support. public class FeatureController : ModuleSearchBase, IModuleSearchResultController { - protected INavigationManager NavigationManager { get; } - public FeatureController() - { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); - } - #region Optional Interfaces /// ----------------------------------------------------------------------------- @@ -224,7 +217,7 @@ public bool HasViewPermission(SearchResult searchResult) var securityKeys = searchResult.UniqueKey.Split('_')[2].Split(','); var userInfo = UserController.Instance.GetCurrentUserInfo(); - + var selfKey = string.Format("U{0}", userInfo.UserID); if (securityKeys.Contains("E") || securityKeys.Contains(selfKey)) @@ -275,15 +268,15 @@ public string GetDocUrl(SearchResult searchResult) if (groupId > 0 && tabId > 0) { - url = NavigationManager.NavigateURL(tabId, string.Empty, "GroupId=" + groupId, "jid=" + journalId); + url = Globals.NavigateURL(tabId, string.Empty, "GroupId=" + groupId, "jid=" + journalId); } else if (tabId == portalSettings.UserTabId) { - url = NavigationManager.NavigateURL(portalSettings.UserTabId, string.Empty, string.Format("userId={0}", profileId), "jid=" + journalId); + url = Globals.NavigateURL(portalSettings.UserTabId, string.Empty, string.Format("userId={0}", profileId), "jid=" + journalId); } else { - url = NavigationManager.NavigateURL(tabId, string.Empty, "jid=" + journalId); + url = Globals.NavigateURL(tabId, string.Empty, "jid=" + journalId); } return url; diff --git a/DNN Platform/Modules/Journal/Components/JournalParser.cs b/DNN Platform/Modules/Journal/Components/JournalParser.cs index 1cf050b695d..afb457efc8d 100644 --- a/DNN Platform/Modules/Journal/Components/JournalParser.cs +++ b/DNN Platform/Modules/Journal/Components/JournalParser.cs @@ -10,19 +10,16 @@ using System.Text; using DotNetNuke.Entities.Portals; using System.Text.RegularExpressions; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Services.Journal.Internal; using DotNetNuke.Services.Localization; using System.Xml; using DotNetNuke.Entities.Modules; -using DotNetNuke.Abstractions; -namespace DotNetNuke.Modules.Journal.Components +namespace DotNetNuke.Modules.Journal.Components { - public class JournalParser + public class JournalParser { - protected INavigationManager NavigationManager { get; } PortalSettings PortalSettings { get; set; } int ProfileId { get; set; } int SocialGroupId { get; set; } @@ -39,9 +36,8 @@ public class JournalParser private static readonly Regex TemplateRegex = new Regex("{CanComment}(.*?){/CanComment}", RegexOptions.IgnoreCase | RegexOptions.Compiled); - public JournalParser(PortalSettings portalSettings, int moduleId, int profileId, int socialGroupId, UserInfo userInfo) + public JournalParser(PortalSettings portalSettings, int moduleId, int profileId, int socialGroupId, UserInfo userInfo) { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); PortalSettings = portalSettings; ModuleId = moduleId; ProfileId = profileId; @@ -66,7 +62,7 @@ public JournalParser(PortalSettings portalSettings, int moduleId, int profileId, private static readonly Regex BaseUrlRegex = new Regex("\\[BaseUrl\\]", RegexOptions.Compiled | RegexOptions.IgnoreCase); - public string GetList(int currentIndex, int rows) + public string GetList(int currentIndex, int rows) { if (CurrentUser.UserID > 0) { isAdmin = CurrentUser.IsInRole(PortalSettings.AdministratorRoleName); @@ -74,7 +70,7 @@ public string GetList(int currentIndex, int rows) isUnverifiedUser = !CurrentUser.IsSuperUser && CurrentUser.IsInRole("Unverified Users"); var journalControllerInternal = InternalJournalController.Instance; - var sb = new StringBuilder(); + var sb = new StringBuilder(); string statusTemplate = Localization.GetString("journal_status", ResxPath); string linkTemplate = Localization.GetString("journal_link", ResxPath); @@ -87,7 +83,7 @@ public string GetList(int currentIndex, int rows) fileTemplate = BaseUrlRegex.Replace(fileTemplate, url); string comment = Localization.GetString("comment", ResxPath); - + IList journalList; if (JournalId > 0) { @@ -99,15 +95,15 @@ public string GetList(int currentIndex, int rows) journalList.Add(journal); } } - else if (ProfileId > 0) + else if (ProfileId > 0) { journalList = journalControllerInternal.GetJournalItemsByProfile(OwnerPortalId, ModuleId, CurrentUser.UserID, ProfileId, currentIndex, rows); - } - else if (SocialGroupId > 0) + } + else if (SocialGroupId > 0) { journalList = journalControllerInternal.GetJournalItemsByGroup(OwnerPortalId, ModuleId, CurrentUser.UserID, SocialGroupId, currentIndex, rows); - } - else + } + else { journalList = journalControllerInternal.GetJournalItems(OwnerPortalId, ModuleId, CurrentUser.UserID, currentIndex, rows); } @@ -134,41 +130,41 @@ public string GetList(int currentIndex, int rows) } else { rowTemplate = GetJournalTemplate(ji.JournalType, ji); } - + var ctl = new JournalControl(); - + bool isLiked = false; ctl.LikeList = GetLikeListHTML(ji, ref isLiked); ctl.LikeLink = String.Empty; ctl.CommentLink = String.Empty; - - ctl.AuthorNameLink = "" + ji.JournalAuthor.Name + ""; - if (CurrentUser.UserID > 0 && !isUnverifiedUser) + + ctl.AuthorNameLink = "" + ji.JournalAuthor.Name + ""; + if (CurrentUser.UserID > 0 && !isUnverifiedUser) { if (!ji.CommentsDisabled) { ctl.CommentLink = "" + comment + ""; } - if (isLiked) + if (isLiked) { ctl.LikeLink = "{resx:unlike}"; - } - else + } + else { ctl.LikeLink = "{resx:like}"; } } - + ctl.CommentArea = GetCommentAreaHTML(ji, comments); ji.TimeFrame = DateUtils.CalculateDateForDisplay(ji.DateCreated); ji.DateCreated = CurrentUser.LocalTime(ji.DateCreated); - + if (ji.Summary != null) { ji.Summary = ji.Summary.Replace("\n", "
"); } - + if (ji.Body != null) { ji.Body = ji.Body.Replace(Environment.NewLine, "
"); @@ -184,11 +180,11 @@ public string GetList(int currentIndex, int rows) sb.Append(tmp); sb.Append(""); } - + return Utilities.LocalizeControl(sb.ToString()); } - internal string GetJournalTemplate(string journalType, JournalItem ji) + internal string GetJournalTemplate(string journalType, JournalItem ji) { string template = Localization.GetString("journal_" + journalType, ResxPath); if (String.IsNullOrEmpty(template)) @@ -203,7 +199,7 @@ internal string GetJournalTemplate(string journalType, JournalItem ji) return TemplateRegex.Replace(template, replacement); } - internal string GetLikeListHTML(JournalItem ji, ref bool isLiked) + internal string GetLikeListHTML(JournalItem ji, ref bool isLiked) { var sb = new StringBuilder(); isLiked = false; @@ -247,7 +243,7 @@ internal string GetLikeListHTML(JournalItem ji, ref bool isLiked) } else { sb.Append(" {resx:other}"); } - break; + break; } sb.AppendFormat("{1}", userId, name); xc += 1; @@ -278,7 +274,7 @@ internal string GetLikeListHTML(JournalItem ji, ref bool isLiked) } } - + sb.Append(""); return sb.ToString(); } @@ -304,7 +300,7 @@ internal string GetCommentAreaHTML(JournalItem journal, IList comme sb.Append("
  • "); sb.Append("{resx:comment}
  • "); } - + sb.Append(""); return sb.ToString(); } @@ -318,16 +314,16 @@ internal string GetCommentRow(JournalItem journal, CommentInfo comment) { } sb.AppendFormat("", pic); sb.Append("

    "); - string userUrl = NavigationManager.NavigateURL(PortalSettings.UserTabId, string.Empty, new[] { "userId=" + comment.UserId }); + string userUrl = Globals.NavigateURL(PortalSettings.UserTabId, string.Empty, new[] { "userId=" + comment.UserId }); sb.AppendFormat("{0}", comment.DisplayName, userUrl); - + if (comment.CommentXML != null && comment.CommentXML.SelectSingleNode("/root/comment") != null) { string text; if (CdataRegex.IsMatch(comment.CommentXML.SelectSingleNode("/root/comment").InnerText)) { var match = CdataRegex.Match(comment.CommentXML.SelectSingleNode("/root/comment").InnerText); - text = match.Groups["text"].Value; + text = match.Groups["text"].Value; } else { @@ -338,12 +334,12 @@ internal string GetCommentRow(JournalItem journal, CommentInfo comment) { else { sb.Append(comment.Comment.Replace("\n", "
    ")); - } + } var timeFrame = DateUtils.CalculateDateForDisplay(comment.DateCreated); comment.DateCreated = CurrentUser.LocalTime(comment.DateCreated); sb.AppendFormat("{1}", comment.DateCreated, timeFrame); - + sb.Append("

    "); sb.Append(""); return sb.ToString(); @@ -365,4 +361,4 @@ private string GetStringReplacement(JournalItem journalItem) } #endregion } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj b/DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj index 3922bdfe195..3e721cc9247 100644 --- a/DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj +++ b/DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj @@ -57,12 +57,6 @@ False ..\..\DotNetNuke.Web.Client\bin\DotNetNuke.Web.Client.dll - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - False ..\..\..\Packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll @@ -228,10 +222,6 @@ - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - {ee1329fe-fd88-4e1a-968c-345e394ef080} DotNetNuke.Web diff --git a/DNN Platform/Modules/Journal/View.ascx.cs b/DNN Platform/Modules/Journal/View.ascx.cs index b2770de2740..65984534df1 100644 --- a/DNN Platform/Modules/Journal/View.ascx.cs +++ b/DNN Platform/Modules/Journal/View.ascx.cs @@ -1,17 +1,16 @@ /* ' Copyright (c) 2011 DotNetNuke Corporation ' All rights reserved. -' +' ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF ' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ' DEALINGS IN THE SOFTWARE. -' +' */ using System; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Users; @@ -23,7 +22,6 @@ using DotNetNuke.Web.Client.ClientResourceManagement; using DotNetNuke.Modules.Journal.Components; using DotNetNuke.Security.Roles; -using DotNetNuke.Abstractions; namespace DotNetNuke.Modules.Journal { @@ -34,7 +32,6 @@ namespace DotNetNuke.Modules.Journal { /// ----------------------------------------------------------------------------- public partial class View : JournalModuleBase { - private readonly INavigationManager _navigationManager; public int PageSize = 20; public bool AllowPhotos = true; public bool AllowFiles = true; @@ -50,20 +47,15 @@ public partial class View : JournalModuleBase { public long MaxUploadSize = Config.GetMaxUploadSize(); public bool IsPublicGroup = false; - public View() - { - _navigationManager = DependencyProvider.GetRequiredService(); - } - #region Event Handlers - override protected void OnInit(EventArgs e) + override protected void OnInit(EventArgs e) { JavaScript.RequestRegistration(CommonJs.DnnPlugins); JavaScript.RequestRegistration(CommonJs.jQueryFileUpload); ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); JavaScript.RequestRegistration(CommonJs.Knockout); - + ClientResourceManager.RegisterScript(Page, "~/DesktopModules/Journal/Scripts/journal.js"); ClientResourceManager.RegisterScript(Page, "~/DesktopModules/Journal/Scripts/journalcomments.js"); ClientResourceManager.RegisterScript(Page, "~/DesktopModules/Journal/Scripts/mentionsInput.js"); @@ -73,7 +65,7 @@ override protected void OnInit(EventArgs e) if (!Request.IsAuthenticated || (!UserInfo.IsSuperUser && !isAdmin && UserInfo.IsInRole("Unverified Users"))) { ShowEditor = false; - } + } else { ShowEditor = EditorEnabled; @@ -99,44 +91,44 @@ override protected void OnInit(EventArgs e) ctlJournalList.ProfileId = -1; ctlJournalList.PageSize = PageSize; ctlJournalList.ModuleId = ModuleId; - + ModuleInfo moduleInfo = ModuleContext.Configuration; - foreach (var module in ModuleController.Instance.GetTabModules(TabId).Values) + foreach (var module in ModuleController.Instance.GetTabModules(TabId).Values) { - if (module.ModuleDefinition.FriendlyName == "Social Groups") + if (module.ModuleDefinition.FriendlyName == "Social Groups") { - if (GroupId == -1 && FilterMode == JournalMode.Auto) + if (GroupId == -1 && FilterMode == JournalMode.Auto) { ShowEditor = false; ctlJournalList.Enabled = false; } - if (GroupId > 0) + if (GroupId > 0) { RoleInfo roleInfo = RoleController.Instance.GetRoleById(moduleInfo.OwnerPortalID, GroupId); - if (roleInfo != null) + if (roleInfo != null) { - if (UserInfo.IsInRole(roleInfo.RoleName)) + if (UserInfo.IsInRole(roleInfo.RoleName)) { ShowEditor = true; CanComment = true; IsGroup = true; - } else + } else { ShowEditor = false; CanComment = false; } - - if (!roleInfo.IsPublic && !ShowEditor) + + if (!roleInfo.IsPublic && !ShowEditor) { - ctlJournalList.Enabled = false; + ctlJournalList.Enabled = false; } - if (roleInfo.IsPublic && !ShowEditor) + if (roleInfo.IsPublic && !ShowEditor) { ctlJournalList.Enabled = true; } - if (roleInfo.IsPublic && ShowEditor) + if (roleInfo.IsPublic && ShowEditor) { ctlJournalList.Enabled = true; } @@ -144,30 +136,30 @@ override protected void OnInit(EventArgs e) { IsPublicGroup = true; } - } - else + } + else { ShowEditor = false; ctlJournalList.Enabled = false; } } - + } } - if (!String.IsNullOrEmpty(Request.QueryString["userId"])) + if (!String.IsNullOrEmpty(Request.QueryString["userId"])) { ctlJournalList.ProfileId = Convert.ToInt32(Request.QueryString["userId"]); if (!UserInfo.IsSuperUser && !isAdmin && ctlJournalList.ProfileId != UserId) { - ShowEditor = ShowEditor && Utilities.AreFriends(UserController.GetUserById(PortalId, ctlJournalList.ProfileId), UserInfo); + ShowEditor = ShowEditor && Utilities.AreFriends(UserController.GetUserById(PortalId, ctlJournalList.ProfileId), UserInfo); } - } - else if (GroupId > 0) + } + else if (GroupId > 0) { ctlJournalList.SocialGroupId = Convert.ToInt32(Request.QueryString["groupId"]); } - + InitializeComponent(); base.OnInit(e); } @@ -175,33 +167,33 @@ override protected void OnInit(EventArgs e) private void InitializeComponent() { Load += Page_Load; } - + /// ----------------------------------------------------------------------------- /// /// Page_Load runs when the control is loaded /// /// ----------------------------------------------------------------------------- private void Page_Load(object sender, EventArgs e) { - try + try { BaseUrl = Globals.ApplicationPath; BaseUrl = BaseUrl.EndsWith("/") ? BaseUrl : BaseUrl + "/"; BaseUrl += "DesktopModules/Journal/"; - ProfilePage = _navigationManager.NavigateURL(PortalSettings.UserTabId, string.Empty, new[] {"userId=xxx"}); + ProfilePage = Common.Globals.NavigateURL(PortalSettings.UserTabId, string.Empty, new[] {"userId=xxx"}); - if (!String.IsNullOrEmpty(Request.QueryString["userId"])) + if (!String.IsNullOrEmpty(Request.QueryString["userId"])) { Pid = Convert.ToInt32(Request.QueryString["userId"]); - ctlJournalList.ProfileId = Pid; - } - else if (GroupId > 0) + ctlJournalList.ProfileId = Pid; + } + else if (GroupId > 0) { Gid = GroupId; - ctlJournalList.SocialGroupId = GroupId; + ctlJournalList.SocialGroupId = GroupId; } ctlJournalList.PageSize = PageSize; - } + } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); diff --git a/DNN Platform/Modules/Journal/packages.config b/DNN Platform/Modules/Journal/packages.config index 4073d3c4617..4a4092b618b 100644 --- a/DNN Platform/Modules/Journal/packages.config +++ b/DNN Platform/Modules/Journal/packages.config @@ -4,7 +4,5 @@ - - \ No newline at end of file diff --git a/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj b/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj index 3af02580ee1..4e3f6ff4d25 100644 --- a/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj +++ b/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj @@ -166,10 +166,6 @@ - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - {ee1329fe-fd88-4e1a-968c-345e394ef080} DotNetNuke.Web diff --git a/DNN Platform/Modules/MemberDirectory/View.ascx.cs b/DNN Platform/Modules/MemberDirectory/View.ascx.cs index d38c189b0e8..be192c793e4 100644 --- a/DNN Platform/Modules/MemberDirectory/View.ascx.cs +++ b/DNN Platform/Modules/MemberDirectory/View.ascx.cs @@ -163,7 +163,7 @@ protected string ViewProfileUrl { get { - return NavigationManager.NavigateURL(ModuleContext.PortalSettings.UserTabId, "", "userId=PROFILEUSER"); + return Globals.NavigateURL(ModuleContext.PortalSettings.UserTabId, "", "userId=PROFILEUSER"); } } diff --git a/DNN Platform/Modules/RazorHost/AddScript.ascx.cs b/DNN Platform/Modules/RazorHost/AddScript.ascx.cs index df1f1769c79..d00f135bddd 100644 --- a/DNN Platform/Modules/RazorHost/AddScript.ascx.cs +++ b/DNN Platform/Modules/RazorHost/AddScript.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -24,11 +24,9 @@ using System.IO; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Services.Exceptions; using DotNetNuke.Services.Localization; using DotNetNuke.UI.Modules; -using Microsoft.Extensions.DependencyInjection; #endregion @@ -38,13 +36,7 @@ namespace DotNetNuke.Modules.RazorHost public partial class AddScript : ModuleUserControlBase { private string razorScriptFileFormatString = "~/DesktopModules/RazorModules/RazorHost/Scripts/{0}"; - private readonly INavigationManager _navigationManager; - - public AddScript() - { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); - } - + private void DisplayExtension() { fileExtension.Text = "." + scriptFileType.SelectedValue.ToLowerInvariant(); @@ -54,7 +46,7 @@ private void DisplayExtension() protected override void OnInit(EventArgs e) { base.OnInit(e); - + cmdCancel.Click += cmdCancel_Click; cmdAdd.Click += cmdAdd_Click; scriptFileType.SelectedIndexChanged += scriptFileType_SelectedIndexChanged; @@ -64,7 +56,7 @@ protected override void OnInit(EventArgs e) protected override void OnLoad(EventArgs e) { base.OnLoad(e); - + DisplayExtension(); } @@ -88,7 +80,7 @@ protected void cmdAdd_Click(object sender, EventArgs e) { if (!ModuleContext.PortalSettings.UserInfo.IsSuperUser) { - Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); + Response.Redirect(Globals.NavigateURL("Access Denied"), true); } if (Page.IsValid) @@ -117,4 +109,4 @@ private void scriptFileType_SelectedIndexChanged(object sender, EventArgs e) DisplayExtension(); } } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs b/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs index 35fdefa25ab..da20d3a0a00 100644 --- a/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs +++ b/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -24,10 +24,8 @@ using System.Collections.Generic; using System.IO; using System.Web.UI.WebControls; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Modules.Definitions; @@ -48,16 +46,10 @@ namespace DotNetNuke.Modules.RazorHost public partial class CreateModule : ModuleUserControlBase { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(CreateModule)); - private readonly INavigationManager _navigationManager; private string razorScriptFileFormatString = "~/DesktopModules/RazorModules/RazorHost/Scripts/{0}"; private string razorScriptFolder = "~/DesktopModules/RazorModules/RazorHost/Scripts/"; - public CreateModule() - { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); - } - [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] protected string ModuleControl { @@ -159,7 +151,7 @@ private void Create() { Logger.Error(ex); } - + //Optionally goto new Page if (chkAddPage.Checked) @@ -191,7 +183,7 @@ private void Create() objModule.AllTabs = false; ModuleController.Instance.AddModule(objModule); - Response.Redirect(_navigationManager.NavigateURL(newTab.TabID), true); + Response.Redirect(Globals.NavigateURL(newTab.TabID), true); } else { @@ -201,7 +193,7 @@ private void Create() else { //Redirect to main extensions page - Response.Redirect(_navigationManager.NavigateURL(), true); + Response.Redirect(Globals.NavigateURL(), true); } } @@ -295,7 +287,7 @@ protected override void OnLoad(EventArgs e) if (! ModuleContext.PortalSettings.UserInfo.IsSuperUser) { - Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); + Response.Redirect(Globals.NavigateURL("Access Denied"), true); } if (! Page.IsPostBack) @@ -309,7 +301,7 @@ private void cmdCancel_Click(object sender, EventArgs e) { try { - Response.Redirect(_navigationManager.NavigateURL(), true); + Response.Redirect(Globals.NavigateURL(), true); } catch (Exception exc) //Module failed to load { @@ -323,7 +315,7 @@ private void cmdCreate_Click(object sender, EventArgs e) { if (! ModuleContext.PortalSettings.UserInfo.IsSuperUser) { - Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); + Response.Redirect(Globals.NavigateURL("Access Denied"), true); } if (Page.IsValid) @@ -342,4 +334,4 @@ private void scriptList_SelectedIndexChanged(object sender, EventArgs e) DisplayFile(); } } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj b/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj index 7f61d63974f..052bf564d94 100644 --- a/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj +++ b/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj @@ -61,12 +61,6 @@ False ..\..\DotNetNuke.Instrumentation\bin\DotNetNuke.Instrumentation.dll - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - @@ -161,7 +155,6 @@ Designer - Designer @@ -188,10 +181,6 @@ - - {6928a9b1-f88a-4581-a132-d3eb38669bb0} - DotNetNuke.Abstractions - {9806c125-8ca9-48cc-940a-ccd0442c5993} DotNetNuke.Web.Razor diff --git a/DNN Platform/Modules/RazorHost/EditScript.ascx.cs b/DNN Platform/Modules/RazorHost/EditScript.ascx.cs index 2be14921210..e0307417ffb 100644 --- a/DNN Platform/Modules/RazorHost/EditScript.ascx.cs +++ b/DNN Platform/Modules/RazorHost/EditScript.ascx.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings @@ -23,10 +23,8 @@ using System; using System.IO; using System.Web.UI.WebControls; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Services.Exceptions; @@ -40,15 +38,9 @@ namespace DotNetNuke.Modules.RazorHost [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public partial class EditScript : ModuleUserControlBase { - private readonly INavigationManager _navigationManager; private string razorScriptFileFormatString = "~/DesktopModules/RazorModules/RazorHost/Scripts/{0}"; private string razorScriptFolder = "~/DesktopModules/RazorModules/RazorHost/Scripts/"; - public EditScript() - { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); - } - [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] protected string RazorScriptFile { @@ -145,7 +137,7 @@ private void cmdCancel_Click(object sender, EventArgs e) { try { - Response.Redirect(_navigationManager.NavigateURL(), true); + Response.Redirect(Globals.NavigateURL(), true); } catch (Exception exc) //Module failed to load { @@ -170,14 +162,14 @@ private void cmdSaveClose_Click(object sender, EventArgs e) try { SaveScript(); - Response.Redirect(_navigationManager.NavigateURL(), true); + Response.Redirect(Globals.NavigateURL(), true); } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } } - + private void cmdAdd_Click(object sender, EventArgs e) { try @@ -197,4 +189,4 @@ private void scriptList_SelectedIndexChanged(object sender, EventArgs e) } -} +} \ No newline at end of file diff --git a/DNN Platform/Modules/RazorHost/packages.config b/DNN Platform/Modules/RazorHost/packages.config deleted file mode 100644 index 015e7e36813..00000000000 --- a/DNN Platform/Modules/RazorHost/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs deleted file mode 100644 index 49daf861b39..00000000000 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs +++ /dev/null @@ -1,394 +0,0 @@ -using DotNetNuke.Abstractions; -using DotNetNuke.Abstractions.Portals; -using DotNetNuke.Common; -using DotNetNuke.Common.Utilities; -using DotNetNuke.Entities.Portals; -using DotNetNuke.Entities.Tabs; -using DotNetNuke.Services.Localization; -using Moq; -using NUnit.Framework; -using System.Collections.Generic; -using System.Linq; - -namespace DotNetNuke.Tests.Core.Common -{ - [TestFixture] - public class NavigationManagerTests - { - private INavigationManager _navigationManager; - private const int TabID = 100; - private const int PortalID = 7; - private const string DefaultURLPattern = "/Default.aspx?tabid={0}"; - private const string DefaultSuperTabPattern = "&portalid={0}"; - private const string ControlKeyPattern = "&ctl={0}"; - private const string LanguagePattern = "&language={0}"; - - [TestFixtureSetUp] - public void Setup() - { - - _navigationManager = new NavigationManager(PortalControllerMock()); - TabController.SetTestableInstance(TabControllerMock()); - LocaleController.SetTestableInstance(LocaleControllerMock()); - - IPortalController PortalControllerMock() - { - var mockPortalController = new Mock(); - mockPortalController - .Setup(x => x.GetCurrentPortalSettings()) - .Returns(PortalSettingsMock()); - mockPortalController - .Setup(x => x.GetCurrentSettings()) - .Returns(PortalSettingsMock()); - - return mockPortalController.Object; - - PortalSettings PortalSettingsMock() - { - var portalSettings = new PortalSettings - { - PortalId = PortalID, - ActiveTab = new TabInfo - { - TabID = TabID - } - }; - - return portalSettings; - } - } - ITabController TabControllerMock() - { - var mockTabController = new Mock(); - mockTabController - .Setup(x => x.GetTabsByPortal(Null.NullInteger)) - .Returns(default(TabCollection)); - mockTabController - .Setup(x => x.GetTab(It.IsAny(), It.IsAny(), It.IsAny())) - .Returns(new TabInfo - { - CultureCode = "en-US" - }); - - return mockTabController.Object; - } - ILocaleController LocaleControllerMock() - { - var mockLocaleController = new Mock(); - mockLocaleController - .Setup(x => x.GetLocales(It.IsAny())) - .Returns(new Dictionary - { - { "en-US", new Locale() }, - { "TEST", new Locale() } - }); - - return mockLocaleController.Object; - } - } - - [TestFixtureTearDown] - public void TearDown() - { - _navigationManager = null; - TabController.ClearInstance(); - LocaleController.ClearInstance(); - } - - [Test] - public void NavigateUrlTest() - { - var expected = string.Format(DefaultURLPattern, TabID); - var actual = _navigationManager.NavigateURL(); - - Assert.IsNotNull(actual); - Assert.AreEqual(expected, actual); - } - - [TestCase(1)] - [TestCase(2)] - [TestCase(3)] - [TestCase(4)] - [TestCase(5)] - [TestCase(6)] - [TestCase(7)] - [TestCase(8)] - [TestCase(9)] - [TestCase(10)] - [TestCase(11)] - public void NavigateUrl_CustomTabID(int tabId) - { - var expected = string.Format(DefaultURLPattern, tabId); - var actual = _navigationManager.NavigateURL(tabId); - - Assert.IsNotNull(actual); - Assert.AreEqual(expected, actual); - } - - [Test] - public void NavigateUrl_CustomTab_NotSuperTab() - { - var customTabId = 55; - var expected = string.Format(DefaultURLPattern, customTabId); - var actual = _navigationManager.NavigateURL(customTabId, false); - - Assert.IsNotNull(actual); - Assert.AreEqual(expected, actual); - } - - [TestCase(1)] - [TestCase(2)] - [TestCase(3)] - [TestCase(4)] - [TestCase(5)] - [TestCase(6)] - [TestCase(7)] - [TestCase(8)] - [TestCase(9)] - [TestCase(10)] - [TestCase(11)] - public void NavigateUrl_CustomTab_IsSuperTab(int tabId) - { - var expected = string.Format(DefaultURLPattern, tabId) + string.Format(DefaultSuperTabPattern, PortalID); - var actual = _navigationManager.NavigateURL(tabId, true); - - Assert.IsNotNull(actual); - Assert.AreEqual(expected, actual); - } - - [Test] - [Ignore] - public void NavigateUrl_ControlKey_AccessDenied() - { - // TODO - We can't properly test this until we migrate - // Globals.AccessDeniedURL to an interface in the abstraction - // project. The dependencies go very deep and make it very - // difficult to properly test just the NavigationManager logic. - var actual = _navigationManager.NavigateURL("Access Denied"); - } - - [Test] - public void NavigateUrl_ControlKey() - { - var controlKey = "My-Control-Key"; - var expected = string.Format(DefaultURLPattern, TabID) + string.Format(ControlKeyPattern, controlKey); - var actual = _navigationManager.NavigateURL(controlKey); - - Assert.IsNotNull(actual); - Assert.AreEqual(expected, actual); - } - - [Test] - public void NavigateUrl_ControlKey_EmptyAdditionalParameter() - { - var controlKey = "My-Control-Key"; - var expected = string.Format(DefaultURLPattern, TabID) + string.Format(ControlKeyPattern, controlKey); - var actual = _navigationManager.NavigateURL(controlKey, new string[0]); - - Assert.IsNotNull(actual); - Assert.AreEqual(expected, actual); - } - - [Test] - public void NavigateUrl_ControlKey_SingleAdditionalParameter() - { - var controlKey = "My-Control-Key"; - var parameters = new string[] { "My-Parameter" }; - var expected = string.Format(DefaultURLPattern, TabID) + - string.Format(ControlKeyPattern, controlKey) + - $"&{parameters[0]}"; - var actual = _navigationManager.NavigateURL(controlKey, parameters); - - Assert.IsNotNull(actual); - Assert.AreEqual(expected, actual); - } - - [TestCase(2)] - [TestCase(3)] - [TestCase(4)] - [TestCase(5)] - [TestCase(6)] - [TestCase(7)] - [TestCase(8)] - [TestCase(9)] - [TestCase(10)] - public void NavigateUrl_ControlKey_MultipleAdditionalParameter(int count) - { - string[] parameters = new string[count]; - for (int index = 0; index < count; index++) - parameters[index] = $"My-Parameter{index}"; - - var controlKey = "My-Control-Key"; - var expected = string.Format(DefaultURLPattern, TabID) + - string.Format(ControlKeyPattern, controlKey) + - parameters.Select(s => $"&{s}").Aggregate((x, y) => $"{x}{y}"); - var actual = _navigationManager.NavigateURL(controlKey, parameters); - - Assert.IsNotNull(actual); - Assert.AreEqual(expected, actual); - } - - [TestCase(1)] - [TestCase(2)] - [TestCase(3)] - [TestCase(4)] - [TestCase(5)] - [TestCase(6)] - [TestCase(7)] - [TestCase(8)] - [TestCase(9)] - [TestCase(10)] - [TestCase(11)] - public void NavigateUrl_TabID_ControlKey(int tabId) - { - var controlKey = "My-Control-Key"; - var expected = string.Format(DefaultURLPattern, tabId) + string.Format(ControlKeyPattern, controlKey); - var actual = _navigationManager.NavigateURL(tabId, controlKey); - - Assert.IsNotNull(actual); - Assert.AreEqual(expected, actual); - } - - [TestCase(1)] - [TestCase(2)] - [TestCase(3)] - [TestCase(4)] - [TestCase(5)] - [TestCase(6)] - [TestCase(7)] - [TestCase(8)] - [TestCase(9)] - [TestCase(10)] - [TestCase(11)] - public void NavigateUrl_TabID_EmptyControlKey(int tabId) - { - var expected = string.Format(DefaultURLPattern, tabId); - var actual = _navigationManager.NavigateURL(tabId, string.Empty); - - Assert.IsNotNull(actual); - Assert.AreEqual(expected, actual); - } - - [TestCase(1)] - [TestCase(2)] - [TestCase(3)] - [TestCase(4)] - [TestCase(5)] - [TestCase(6)] - [TestCase(7)] - [TestCase(8)] - [TestCase(9)] - [TestCase(10)] - [TestCase(11)] - public void NavigateUrl_TabID_NullControlKey(int tabId) - { - var expected = string.Format(DefaultURLPattern, tabId); - var actual = _navigationManager.NavigateURL(tabId, string.Empty); - - Assert.IsNotNull(actual); - Assert.AreEqual(expected, actual); - } - - [TestCase(0, "My-Control-Key-0")] - [TestCase(1, "My-Control-Key-1")] - [TestCase(2, "My-Control-Key-2")] - [TestCase(3, "My-Control-Key-3")] - [TestCase(4, "My-Control-Key-4")] - [TestCase(5, "My-Control-Key-5")] - [TestCase(6, "My-Control-Key-6")] - [TestCase(7, "My-Control-Key-7")] - [TestCase(8, "My-Control-Key-8")] - [TestCase(9, "My-Control-Key-9")] - [TestCase(10, "My-Control-Key-10")] - public void NavigateUrl_TabID_ControlKey_Parameter(int count, string controlKey) - { - string[] parameters = new string[count]; - for (int index = 0; index < count; index++) - parameters[index] = $"My-Parameter{index}"; - - var customTabId = 51; - var expected = string.Format(DefaultURLPattern, customTabId) + - string.Format(ControlKeyPattern, controlKey); - - if (parameters.Length > 0) - expected += parameters.Select(s => $"&{s}").Aggregate((x, y) => $"{x}{y}"); - - var actual = _navigationManager.NavigateURL(customTabId, controlKey, parameters); - - Assert.IsNotNull(actual); - Assert.AreEqual(expected, actual); - } - - [TestCase(0, "My-Control-Key-0")] - [TestCase(1, "My-Control-Key-1")] - [TestCase(2, "My-Control-Key-2")] - [TestCase(3, "My-Control-Key-3")] - [TestCase(4, "My-Control-Key-4")] - [TestCase(5, "My-Control-Key-5")] - [TestCase(6, "My-Control-Key-6")] - [TestCase(7, "My-Control-Key-7")] - [TestCase(8, "My-Control-Key-8")] - [TestCase(9, "My-Control-Key-9")] - [TestCase(10, "My-Control-Key-10")] - public void NavigateUrl_TabID_ControlKey_NullParameter(int tabId, string controlKey) - { - var expected = string.Format(DefaultURLPattern, tabId) + - string.Format(ControlKeyPattern, controlKey); - - var actual = _navigationManager.NavigateURL(tabId, controlKey, null); - - Assert.IsNotNull(actual); - Assert.AreEqual(expected, actual); - } - - [TestCase(0, "My-Control-Key-0")] - [TestCase(1, "My-Control-Key-1")] - [TestCase(2, "My-Control-Key-2")] - [TestCase(3, "My-Control-Key-3")] - [TestCase(4, "My-Control-Key-4")] - [TestCase(5, "My-Control-Key-5")] - [TestCase(6, "My-Control-Key-6")] - [TestCase(7, "My-Control-Key-7")] - [TestCase(8, "My-Control-Key-8")] - [TestCase(9, "My-Control-Key-9")] - [TestCase(10, "My-Control-Key-10")] - public void NavigateUrl_TabId_NullSettings_ControlKey(int tabId, string controlKey) - { - var expected = string.Format(DefaultURLPattern, tabId) + - string.Format(ControlKeyPattern, controlKey); - - var actual = _navigationManager.NavigateURL(tabId, default(IPortalSettings), controlKey, null); - - Assert.IsNotNull(actual); - Assert.AreEqual(expected, actual); - } - - [TestCase(0, "My-Control-Key-0")] - [TestCase(1, "My-Control-Key-1")] - [TestCase(2, "My-Control-Key-2")] - [TestCase(3, "My-Control-Key-3")] - [TestCase(4, "My-Control-Key-4")] - [TestCase(5, "My-Control-Key-5")] - [TestCase(6, "My-Control-Key-6")] - [TestCase(7, "My-Control-Key-7")] - [TestCase(8, "My-Control-Key-8")] - [TestCase(9, "My-Control-Key-9")] - [TestCase(10, "My-Control-Key-10")] - public void NavigateUrl_TabId_Settings_ControlKey(int tabId, string controlKey) - { - var mockSettings = new Mock(); - mockSettings - .Setup(x => x.ContentLocalizationEnabled) - .Returns(true); - - var expected = string.Format(DefaultURLPattern, tabId) + - string.Format(ControlKeyPattern, controlKey) + - string.Format(LanguagePattern, "en-US"); - - var actual = _navigationManager.NavigateURL(tabId, mockSettings.Object, controlKey, null); - - Assert.IsNotNull(actual); - Assert.AreEqual(expected, actual); - } - } -} diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/DotNetNuke.Tests.Core.csproj b/DNN Platform/Tests/DotNetNuke.Tests.Core/DotNetNuke.Tests.Core.csproj index 42993e219e9..671b84cd537 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/DotNetNuke.Tests.Core.csproj +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/DotNetNuke.Tests.Core.csproj @@ -125,7 +125,6 @@ - @@ -207,10 +206,6 @@ - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - {03e3afa5-ddc9-48fb-a839-ad4282ce237e} DotNetNuke.Web.Client diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs index 8c5063a00b1..01db024c58c 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs @@ -22,9 +22,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using DotNetNuke.Abstractions; -using DotNetNuke.Common; -using DotNetNuke.Common.Internal; using DotNetNuke.Common.Utilities; using DotNetNuke.ComponentModel; using DotNetNuke.Entities.Portals; @@ -60,14 +57,6 @@ public class StandardFolderProviderTests #endregion #region Setup - [TestFixtureSetUp] - public void FixtureSetup() - { - var navigationManagerMock = new Mock(); - var containerMock = new Mock(); - containerMock.Setup(x => x.GetService(typeof(INavigationManager))).Returns(navigationManagerMock.Object); - Globals.DependencyProvider = containerMock.Object; - } [SetUp] public void Setup() @@ -126,8 +115,6 @@ private PortalSettings GetPortalSettingsMock() public void TearDown() { MockComponentProvider.ResetContainer(); - TestableGlobals.ClearInstance(); - PortalController.ClearInstance(); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs index c98e779687e..413561e37ab 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs @@ -25,17 +25,17 @@ using System.Data; using System.Reflection; using System.Web; -using DotNetNuke.Abstractions; -using DotNetNuke.Common; + using DotNetNuke.Common.Internal; +using DotNetNuke.Common.Utilities; using DotNetNuke.ComponentModel; using DotNetNuke.Data; using DotNetNuke.Entities.Controllers; -using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; using DotNetNuke.Security.Roles; using DotNetNuke.Services.Cache; using DotNetNuke.Services.ClientCapability; +using DotNetNuke.Services.Localization; using DotNetNuke.Services.Mobile; using DotNetNuke.Tests.Core.Services.ClientCapability; using DotNetNuke.Tests.Instance.Utilities; @@ -51,11 +51,11 @@ namespace DotNetNuke.Tests.Core.Services.Mobile /// Summary description for RedirectionControllerTests ///
    [TestFixture] - public class RedirectionControllerTests + public class RedirectionControllerTests { - #region Private Properties + #region Private Properties - private Mock _dataProvider; + private Mock _dataProvider; private RedirectionController _redirectionController; private Mock _clientCapabilityProvider; private Mock _mockHostController; @@ -107,11 +107,11 @@ public class RedirectionControllerTests #endregion #region Set Up + [SetUp] public void SetUp() { - SetupContianer(); - ComponentFactory.Container = new SimpleContainer(); + ComponentFactory.Container = new SimpleContainer(); UnitTestHelper.ClearHttpContext(); _dataProvider = MockComponentProvider.CreateDataProvider(); MockComponentProvider.CreateDataCacheProvider(); @@ -137,8 +137,6 @@ public void SetUp() [TearDown] public void TearDown() { - TestableGlobals.ClearInstance(); - PortalController.ClearInstance(); CachingProvider.Instance().PurgeCache(); MockComponentProvider.ResetContainer(); UnitTestHelper.ClearHttpContext(); @@ -155,22 +153,13 @@ public void TearDown() ComponentFactory.Container = null; } - private void SetupContianer() - { - var navigationManagerMock = new Mock(); - navigationManagerMock.Setup(x => x.NavigateURL(It.IsAny())).Returns(x => NavigateUrl(x)); - var containerMock = new Mock(); - containerMock.Setup(x => x.GetService(typeof(INavigationManager))).Returns(navigationManagerMock.Object); - Globals.DependencyProvider = containerMock.Object; - } - #endregion - - #region Tests + #endregion - #region CURD API Tests + #region Tests + #region CURD API Tests - [Test] + [Test] public void RedirectionController_Save_Valid_Redirection() { var redirection = new Redirection { Name = "Test R", PortalId = Portal0, SortOrder = 1, SourceTabId = -1, Type = RedirectionType.MobilePhone, TargetType = TargetType.Portal, TargetValue = Portal1 }; diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/PortalAliasRouteManagerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/PortalAliasRouteManagerTests.cs index 1620835869e..00862e2e78b 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/PortalAliasRouteManagerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/PortalAliasRouteManagerTests.cs @@ -25,8 +25,6 @@ using System.Collections; using System.Collections.Generic; using System.Linq; -using DotNetNuke.Abstractions; -using DotNetNuke.Common; using DotNetNuke.Common.Internal; using DotNetNuke.Entities.Portals; using DotNetNuke.Web.Api; @@ -38,14 +36,6 @@ namespace DotNetNuke.Tests.Web.Api [TestFixture] public class PortalAliasRouteManagerTests { - [SetUp] - public void SetUp() - { - var navigationManagerMock = new Mock(); - var containerMock = new Mock(); - containerMock.Setup(x => x.GetService(typeof(INavigationManager))).Returns(navigationManagerMock.Object); - Globals.DependencyProvider = containerMock.Object; - } [TearDown] public void TearDown() diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/ServiceRoutingManagerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/ServiceRoutingManagerTests.cs index 1fcbcd3c083..04199d731a2 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/ServiceRoutingManagerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/ServiceRoutingManagerTests.cs @@ -23,8 +23,6 @@ using System.Collections.Generic; using System.Linq; using System.Web.Routing; -using DotNetNuke.Abstractions; -using DotNetNuke.Common; using DotNetNuke.Entities.Portals; using DotNetNuke.Framework.Internal.Reflection; using DotNetNuke.Framework.Reflections; @@ -53,11 +51,6 @@ public void Setup() _mockPortalController = new Mock(); _portalController = _mockPortalController.Object; PortalController.SetTestableInstance(_portalController); - - var navigationManagerMock = new Mock(); - var containerMock = new Mock(); - containerMock.Setup(x => x.GetService(typeof(INavigationManager))).Returns(navigationManagerMock.Object); - Globals.DependencyProvider = containerMock.Object; } [TearDown] diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj b/DNN Platform/Tests/DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj index 7101d59a1ef..61cf89bcfd5 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj @@ -114,10 +114,6 @@ {3b2fa1d9-ec7d-4cec-8ff5-a7700cf5cb40} Dnn.AuthServices.Jwt
    - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - {04f77171-0634-46e0-a95e-d7477c88712e} DotNetNuke.Log4Net diff --git a/DNN_Platform.sln b/DNN_Platform.sln index a1f33341453..ae808b735eb 100644 --- a/DNN_Platform.sln +++ b/DNN_Platform.sln @@ -440,10 +440,8 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{F4AAB2C9-8B8B-441B-8623-9347B62884A1}" ProjectSection(SolutionItems) = preProject Build\Tools\NuGet\Dnn.PersonaBar.Library.nuspec = Build\Tools\NuGet\Dnn.PersonaBar.Library.nuspec - Build\Tools\NuGet\DotNetNuke.Abstractions.nuspec = Build\Tools\NuGet\DotNetNuke.Abstractions.nuspec Build\Tools\NuGet\DotNetNuke.Bundle.nuspec = Build\Tools\NuGet\DotNetNuke.Bundle.nuspec Build\Tools\NuGet\DotNetNuke.Core.nuspec = Build\Tools\NuGet\DotNetNuke.Core.nuspec - Build\Tools\NuGet\DotNetNuke.DependencyInjection.nuspec = Build\Tools\NuGet\DotNetNuke.DependencyInjection.nuspec Build\Tools\NuGet\DotNetNuke.Instrumentation.nuspec = Build\Tools\NuGet\DotNetNuke.Instrumentation.nuspec Build\Tools\NuGet\DotNetNuke.Providers.FolderProviders.nuspec = Build\Tools\NuGet\DotNetNuke.Providers.FolderProviders.nuspec Build\Tools\NuGet\DotNetNuke.SiteExportImport.nuspec = Build\Tools\NuGet\DotNetNuke.SiteExportImport.nuspec @@ -530,8 +528,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Symbols", "Symbols", "{8D99 Dnn.AdminExperience\Build\Symbols\Symbols.dnn = Dnn.AdminExperience\Build\Symbols\Symbols.dnn EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetNuke.Abstractions", "DNN Platform\DotNetNuke.Abstractions\DotNetNuke.Abstractions.csproj", "{6928A9B1-F88A-4581-A132-D3EB38669BB0}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Cloud_Debug|Any CPU = Cloud_Debug|Any CPU @@ -1898,30 +1894,6 @@ Global {15506C01-A730-46B9-8571-99C20226AAE6}.Release-Net45|Any CPU.Build.0 = Release|Any CPU {15506C01-A730-46B9-8571-99C20226AAE6}.Release-Net45|x86.ActiveCfg = Release|Any CPU {15506C01-A730-46B9-8571-99C20226AAE6}.Release-Net45|x86.Build.0 = Release|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Cloud_Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Cloud_Debug|Any CPU.Build.0 = Debug|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Cloud_Debug|x86.ActiveCfg = Debug|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Cloud_Debug|x86.Build.0 = Debug|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Cloud_Release|Any CPU.ActiveCfg = Release|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Cloud_Release|Any CPU.Build.0 = Release|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Cloud_Release|x86.ActiveCfg = Release|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Cloud_Release|x86.Build.0 = Release|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Debug|x86.ActiveCfg = Debug|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Debug|x86.Build.0 = Debug|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Debug-Net45|Any CPU.ActiveCfg = Debug|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Debug-Net45|Any CPU.Build.0 = Debug|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Debug-Net45|x86.ActiveCfg = Debug|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Debug-Net45|x86.Build.0 = Debug|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Release|Any CPU.Build.0 = Release|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Release|x86.ActiveCfg = Release|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Release|x86.Build.0 = Release|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Release-Net45|Any CPU.ActiveCfg = Release|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Release-Net45|Any CPU.Build.0 = Release|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Release-Net45|x86.ActiveCfg = Release|Any CPU - {6928A9B1-F88A-4581-A132-D3EB38669BB0}.Release-Net45|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2028,7 +2000,6 @@ Global {10D11155-ED05-40CB-9644-AD861A6D7096} = {392B91E8-C85D-4475-A169-1D4E33B06A4A} {622791DE-3AE7-4D54-9E66-2FED9686AA9E} = {10D11155-ED05-40CB-9644-AD861A6D7096} {8D99B9CD-004B-4237-8CFE-77CD327B4370} = {10D11155-ED05-40CB-9644-AD861A6D7096} - {6928A9B1-F88A-4581-A132-D3EB38669BB0} = {29273BE6-1AA8-4970-98A0-41BFFEEDA67B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {46B6A641-57EB-4B19-B199-23E6FC2AB40B} diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs index 3527741cec5..04403016fb0 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs @@ -2,10 +2,8 @@ using System.IO; using System.Text; using System.Text.RegularExpressions; -using Microsoft.Extensions.DependencyInjection; using Dnn.PersonaBar.Extensions.Components.Dto; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Modules.Definitions; @@ -21,12 +19,6 @@ namespace Dnn.PersonaBar.Extensions.Components { public class CreateModuleController : ServiceLocator, ICreateModuleController { - protected INavigationManager NavigationManager { get; } - public CreateModuleController() - { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); - } - protected override Func GetFactory() { return () => new CreateModuleController(); @@ -102,7 +94,7 @@ private int CreateNewModule(CreateModuleDto createModuleDto, out string newPageU var uniqueName = true; foreach (var package in PackageController.Instance.GetExtensionPackages(Null.NullInteger)) { - if (package.Name.Equals(createModuleDto.ModuleName, StringComparison.OrdinalIgnoreCase) + if (package.Name.Equals(createModuleDto.ModuleName, StringComparison.OrdinalIgnoreCase) || package.FriendlyName.Equals(createModuleDto.ModuleName, StringComparison.OrdinalIgnoreCase)) { uniqueName = false; @@ -322,7 +314,7 @@ private string CreateNewPage(ModuleDefinitionInfo moduleDefinition) objModule.AllTabs = false; ModuleController.Instance.AddModule(objModule); - return NavigationManager.NavigateURL(newTab.TabID); + return Globals.NavigateURL(newTab.TabID); } return string.Empty; @@ -394,4 +386,4 @@ private string GetClassName(CreateModuleDto createModuleDto) return className.Replace(" ", ""); } } -} +} \ No newline at end of file diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoDto.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoDto.cs index ffdf17eb6e3..7896f50e5eb 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoDto.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoDto.cs @@ -1,29 +1,27 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion #region Usings using System.Linq; -using Microsoft.Extensions.DependencyInjection; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; @@ -97,17 +95,13 @@ public class PackageInfoDto [JsonProperty("siteSettingsLink", DefaultValueHandling = DefaultValueHandling.Ignore)] public string SiteSettingsLink { get; set; } - protected INavigationManager NavigationManager { get; } - public PackageInfoDto() { - + } public PackageInfoDto(int portalId, PackageInfo package) { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); - PackageType = package.PackageType; FriendlyName = package.FriendlyName; Name = package.Name; @@ -133,7 +127,7 @@ public PackageInfoDto(int portalId, PackageInfo package) var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); var tabId = portalSettings.ActiveTab.TabID; - SiteSettingsLink = NavigationManager.NavigateURL(tabId, "EditExtension", + SiteSettingsLink = Globals.NavigateURL(tabId, "EditExtension", new[] { $"packageid={PackageId}", @@ -165,4 +159,4 @@ public PackageInfo ToPackageInfo() }; } } -} +} \ No newline at end of file diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/AuthSystemPackageEditor.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/AuthSystemPackageEditor.cs index 301e390e606..d8be3f372f0 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/AuthSystemPackageEditor.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/AuthSystemPackageEditor.cs @@ -1,10 +1,12 @@ using System; -using Microsoft.Extensions.DependencyInjection; +using System.Linq; +using System.Web.UI.WebControls; using Dnn.PersonaBar.Extensions.Components.Dto; using Dnn.PersonaBar.Extensions.Components.Dto.Editors; using DotNetNuke.Common; -using DotNetNuke.Abstractions; +using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Portals; +using DotNetNuke.Entities.Tabs; using DotNetNuke.Entities.Users; using DotNetNuke.Instrumentation; using DotNetNuke.Services.Authentication; @@ -16,7 +18,7 @@ namespace Dnn.PersonaBar.Extensions.Components.Editors public class AuthSystemPackageEditor : IPackageEditor { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(AuthSystemPackageEditor)); - private static readonly INavigationManager NavigationManager = Globals.DependencyProvider.GetRequiredService(); + #region IPackageEditor Implementation public PackageInfoDto GetPackageDetail(int portalId, PackageInfo package) @@ -97,7 +99,7 @@ public bool SavePackageSettings(PackageSettingsDto packageSettings, out string e private static string GetSettingUrl(int portalId, int authSystemPackageId) { - return NavigationManager.NavigateURL(PortalSettings.Current.ActiveTab.TabID, PortalSettings.Current, "EditExtension", + return Globals.NavigateURL(PortalSettings.Current.ActiveTab.TabID, PortalSettings.Current, "EditExtension", "packageid=" + authSystemPackageId, "popUp=true", "mode=settings"); @@ -174,4 +176,4 @@ private static void SaveCustomSettings(PackageSettingsDto packageSettings) #endregion } -} +} \ No newline at end of file diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/CoreLanguagePackageEditor.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/CoreLanguagePackageEditor.cs index 8cb4a537ce7..05a4f37b107 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/CoreLanguagePackageEditor.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/CoreLanguagePackageEditor.cs @@ -1,9 +1,7 @@ using System; -using Microsoft.Extensions.DependencyInjection; using Dnn.PersonaBar.Extensions.Components.Dto; using Dnn.PersonaBar.Extensions.Components.Dto.Editors; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Tabs; using DotNetNuke.Instrumentation; @@ -15,11 +13,6 @@ namespace Dnn.PersonaBar.Extensions.Components.Editors public class CoreLanguagePackageEditor : IPackageEditor { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(JsLibraryPackageEditor)); - protected INavigationManager NavigationManager { get; } - public CoreLanguagePackageEditor() - { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); - } public PackageInfoDto GetPackageDetail(int portalId, PackageInfo package) { @@ -30,7 +23,7 @@ public PackageInfoDto GetPackageDetail(int portalId, PackageInfo package) { Locales = Utility.GetAllLanguagesList(), LanguageId = languagePack.LanguageID, - EditUrlFormat = NavigationManager.NavigateURL(languagesTab, "", "Locale={0}") + EditUrlFormat = Globals.NavigateURL(languagesTab, "", "Locale={0}") }; if (languagePack.PackageType == LanguagePackType.Extension) @@ -69,4 +62,4 @@ public bool SavePackageSettings(PackageSettingsDto packageSettings, out string e } } } -} +} \ No newline at end of file diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ExtensionLanguagePackageEditor.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ExtensionLanguagePackageEditor.cs index 0caf20ba631..cc45dbbbdc0 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ExtensionLanguagePackageEditor.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ExtensionLanguagePackageEditor.cs @@ -2,25 +2,17 @@ using Dnn.PersonaBar.Extensions.Components.Dto; using Dnn.PersonaBar.Extensions.Components.Dto.Editors; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Tabs; using DotNetNuke.Instrumentation; using DotNetNuke.Services.Installer.Packages; using DotNetNuke.Services.Localization; -using Microsoft.Extensions.DependencyInjection; namespace Dnn.PersonaBar.Extensions.Components.Editors { public class ExtensionLanguagePackageEditor : IPackageEditor { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(JsLibraryPackageEditor)); - protected INavigationManager NavigationManager { get; } - - public ExtensionLanguagePackageEditor() - { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); - } public PackageInfoDto GetPackageDetail(int portalId, PackageInfo package) { @@ -32,7 +24,7 @@ public PackageInfoDto GetPackageDetail(int portalId, PackageInfo package) Locales = Utility.GetAllLanguagesList(), LanguageId = languagePack.LanguageID, DependentPackageId = languagePack.DependentPackageID, - EditUrlFormat = NavigationManager.NavigateURL(languagesTab, "", "Locale={0}") + EditUrlFormat = Globals.NavigateURL(languagesTab, "", "Locale={0}") }; if (languagePack.PackageType == LanguagePackType.Extension) @@ -78,4 +70,4 @@ public bool SavePackageSettings(PackageSettingsDto packageSettings, out string e } } } -} +} \ No newline at end of file diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/ExtensionsController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/ExtensionsController.cs index e8f8fc8dc6e..9c5f51f94fe 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/ExtensionsController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Extensions/ExtensionsController.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -29,10 +29,8 @@ using System.Text; using System.Web; using System.Xml; -using Microsoft.Extensions.DependencyInjection; using Dnn.PersonaBar.Extensions.Components.Dto; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Portals; @@ -49,11 +47,6 @@ namespace Dnn.PersonaBar.Extensions.Components public class ExtensionsController { private const string OwnerUpdateService = "DotNetNuke Update Service"; - protected INavigationManager NavigationManager { get; } - public ExtensionsController() - { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); - } public IDictionary GetPackageTypes() { @@ -277,7 +270,7 @@ public string GetFormattedTabLink(int portalId, TabInfo tab) : PortalAliasController.Instance.GetPortalAliasesByPortalId(t.PortalID) .OrderBy(pa => pa.IsPrimary ? 0 : 1) .First(); - var url = NavigationManager.NavigateURL(t.TabID, new PortalSettings(t.PortalID, alias), string.Empty); + var url = Globals.NavigateURL(t.TabID, new PortalSettings(t.PortalID, alias), string.Empty); returnValue.AppendFormat("{1}", url, t.LocalizedTabName); } index = index + 1; @@ -425,4 +418,4 @@ private static bool IconExists(string imagePath) #endregion } -} +} \ No newline at end of file diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs index e51df588bcd..8fcc2c79766 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Pages/Converters.cs @@ -3,13 +3,11 @@ using System.Data; using System.Globalization; using System.Linq; -using Microsoft.Extensions.DependencyInjection; using Dnn.PersonaBar.Pages.Components.Security; using Dnn.PersonaBar.Pages.Services.Dto; using Dnn.PersonaBar.Themes.Components; using Dnn.PersonaBar.Themes.Components.DTO; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Portals; @@ -22,7 +20,6 @@ namespace Dnn.PersonaBar.Pages.Components { public static class Converters { - private static readonly INavigationManager _navigationManager = Globals.DependencyProvider.GetRequiredService(); public static T ConvertToPageItem(TabInfo tab, IEnumerable portalTabs) where T : PageItem, new() { return new T @@ -68,7 +65,7 @@ public static class Converters private static string GetModuleEditSettingUrl(ModuleInfo module) { var parameters = new List { "ModuleId=" + module.ModuleID, "popUp=true" }; - return _navigationManager.NavigateURL(module.TabID, PortalSettings.Current, "Module", parameters.ToArray()); + return Globals.NavigateURL(module.TabID, PortalSettings.Current, "Module", parameters.ToArray()); } private static string GetModuleEditContentUrl(ModuleInfo module) @@ -82,7 +79,7 @@ private static string GetModuleEditContentUrl(ModuleInfo module) parameters.Add("popUp=true"); } - return _navigationManager.NavigateURL(module.TabID, PortalSettings.Current, moduleControl.ControlKey, parameters.ToArray()); + return Globals.NavigateURL(module.TabID, PortalSettings.Current, moduleControl.ControlKey, parameters.ToArray()); } return string.Empty; @@ -250,4 +247,4 @@ private static string GetTabPublishStatus(TabInfo tab) : Localization.GetString("lblDraft"); } } -} +} \ No newline at end of file diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/SiteSettings/SiteSettingsController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/SiteSettings/SiteSettingsController.cs index df6ce7ddfe1..c4e29ac849a 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/SiteSettings/SiteSettingsController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/SiteSettings/SiteSettingsController.cs @@ -41,7 +41,6 @@ using DotNetNuke.Services.Installer.Packages; using DotNetNuke.Services.Installer.Writers; using DotNetNuke.Services.Localization; -using Constants = Dnn.PersonaBar.Library.Constants; namespace Dnn.PersonaBar.SiteSettings.Components { diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserDetailDto.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserDetailDto.cs index 37930a6351b..9176d2bcb73 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserDetailDto.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Components/Users/Dto/UserDetailDto.cs @@ -1,28 +1,27 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion using System; using System.Linq; using System.Runtime.Serialization; -using Microsoft.Extensions.DependencyInjection; using Dnn.PersonaBar.Library.Common; using DotNetNuke.Entities.Users; using DotNetNuke.Services.FileSystem; @@ -31,7 +30,6 @@ using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Tabs; -using DotNetNuke.Abstractions; namespace Dnn.PersonaBar.Users.Components.Dto { @@ -81,10 +79,9 @@ public class UserDetailDto : UserBasicDto [DataMember(Name = "hasAgreedToTermsOn")] public DateTime HasAgreedToTermsOn { get; set; } - private static readonly INavigationManager _navigationManager = Globals.DependencyProvider.GetRequiredService(); - public UserDetailDto() { + } public UserDetailDto(UserInfo user) : base(user) @@ -125,11 +122,11 @@ private static string GetSettingUrl(int portalId, int userId) return string.Empty; } //ctl/Edit/mid/345/packageid/52 - return _navigationManager.NavigateURL(tabId, PortalSettings.Current, "Edit", + return Globals.NavigateURL(tabId, PortalSettings.Current, "Edit", "mid=" + module.ModuleID, "popUp=true", "UserId=" + userId, "editprofile=true"); } } -} +} \ No newline at end of file diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj index d4e781dcf9c..1b845503ffb 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Dnn.PersonaBar.Extensions.csproj @@ -580,10 +580,6 @@
    - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - {3cd5f6b8-8360-4862-80b6-f402892db7dd} DotNetNuke.Instrumentation @@ -685,12 +681,6 @@ ..\..\..\..\Packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll
    - - ..\..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - False diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ExtensionMenuController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ExtensionMenuController.cs index 766005801ae..a2ee5053ef9 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ExtensionMenuController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ExtensionMenuController.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -using Microsoft.Extensions.DependencyInjection; using Dnn.PersonaBar.Library.Controllers; using Dnn.PersonaBar.Library.Model; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Users; @@ -11,12 +9,6 @@ namespace Dnn.PersonaBar.Extensions.MenuControllers { public class ExtensionMenuController : IMenuItemController { - protected INavigationManager NavigationManager { get; } - public ExtensionMenuController() - { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); - } - public void UpdateParameters(MenuItem menuItem) { } @@ -31,8 +23,8 @@ public IDictionary GetSettings(MenuItem menuItem) { var settings = new Dictionary(); settings.Add("portalId", PortalSettings.Current.PortalId); - settings.Add("installUrl", NavigationManager.NavigateURL(PortalSettings.Current.ActiveTab.TabID, PortalSettings.Current, "Install", "popUp=true")); + settings.Add("installUrl", Globals.NavigateURL(PortalSettings.Current.ActiveTab.TabID, PortalSettings.Current, "Install", "popUp=true")); return settings; } } -} +} \ No newline at end of file diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ThemeMenuController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ThemeMenuController.cs index 3df6150582f..2cec7920ebf 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ThemeMenuController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/MenuControllers/ThemeMenuController.cs @@ -2,11 +2,9 @@ using System.Collections.Generic; using System.Linq; using System.Web; -using Microsoft.Extensions.DependencyInjection; using Dnn.PersonaBar.Library.Controllers; using Dnn.PersonaBar.Library.Model; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Users; @@ -27,8 +25,8 @@ public IDictionary GetSettings(MenuItem menuItem) { return new Dictionary { - {"previewUrl", Globals.DependencyProvider.GetRequiredService().NavigateURL()}, + {"previewUrl", Globals.NavigateURL()}, }; } } -} +} \ No newline at end of file diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/LanguagesController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/LanguagesController.cs index 6231c3e28c8..007645a0084 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/LanguagesController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/LanguagesController.cs @@ -24,7 +24,6 @@ using DotNetNuke.Services.Localization; using DotNetNuke.Services.Log.EventLog; using DotNetNuke.Web.Api; -using DotNetNuke.Abstractions; namespace Dnn.PersonaBar.SiteSettings.Services { @@ -34,11 +33,6 @@ public class LanguagesController : PersonaBarApiController private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(LanguagesController)); private const string LocalResourcesFile = "~/DesktopModules/admin/Dnn.PersonaBar/Modules/Dnn.SiteSettings/App_LocalResources/SiteSettings.resx"; private const string AuthFailureMessage = "Authorization has been denied for this request."; - protected INavigationManager NavigationManager { get; } - public LanguagesController(INavigationManager navigationManager) - { - NavigationManager = navigationManager; - } // Sample matches: // MyResources.ascx.en-US.resx @@ -977,7 +971,7 @@ private IList GetTabsForTranslationInternal(int portalId, string { PageId = page.TabID, PageName = page.TabName, - ViewUrl = NavigationManager.NavigateURL(page.TabID), + ViewUrl = Globals.NavigateURL(page.TabID), })); } return pages; diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/PagesController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/PagesController.cs index 15ffcbe94cd..0d6a812fc4b 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/PagesController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/PagesController.cs @@ -54,7 +54,6 @@ using DotNetNuke.Services.Localization; using DotNetNuke.Services.Social.Notifications; using Localization = Dnn.PersonaBar.Pages.Components.Localization; -using DotNetNuke.Abstractions; namespace Dnn.PersonaBar.Pages.Services { @@ -64,7 +63,6 @@ public class PagesController : PersonaBarApiController { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(PagesController)); private const string LocalResourceFile = Library.Constants.PersonaBarRelativePath + "Modules/Dnn.Pages/App_LocalResources/Pages.resx"; - protected INavigationManager NavigationManager { get; } private readonly IPagesController _pagesController; private readonly IBulkPagesController _bulkPagesController; @@ -76,10 +74,8 @@ public class PagesController : PersonaBarApiController private readonly ILocaleController _localeController; private readonly ISecurityService _securityService; - public PagesController(INavigationManager navigationManager) + public PagesController() { - NavigationManager = navigationManager; - _pagesController = Components.PagesController.Instance; _themesController = ThemesController.Instance; _bulkPagesController = BulkPagesController.Instance; @@ -994,7 +990,7 @@ where TabPermissionController.CanViewPage(localizedTab.Value) dnnPage.CanAdminPage = TabPermissionController.CanAdminPage(tabInfo); dnnPage.CanViewPage = TabPermissionController.CanViewPage(tabInfo); dnnPage.LocalResourceFile = LocalResourceFile; - dnnPage.PageUrl = NavigationManager.NavigateURL(localTabInfo.TabID, false, PortalSettings, "", localTabInfo.CultureCode); + dnnPage.PageUrl = Globals.NavigateURL(localTabInfo.TabID, false, PortalSettings, "", localTabInfo.CultureCode); // calculate position in the form of 1.3.2... var siblingTabs = tabInfos.Where(t => t.ParentId == localTabInfo.ParentId && t.CultureCode == localTabInfo.CultureCode || t.CultureCode == null).OrderBy(t => t.TabOrder).ToList(); @@ -1281,7 +1277,7 @@ private void AddTranslationSubmittedNotification(TabInfo tabInfo, UserInfo trans var subject = LocalizeString("NewContentMessage.Subject"); var body = string.Format(LocalizeString("NewContentMessage.Body"), tabInfo.TabName, - NavigationManager.NavigateURL(tabInfo.TabID, false, PortalSettings, Null.NullString, tabInfo.CultureCode), + Globals.NavigateURL(tabInfo.TabID, false, PortalSettings, Null.NullString, tabInfo.CultureCode), comment); var sender = UserController.GetUserById(PortalSettings.PortalId, PortalSettings.AdministratorId); diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SeoController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SeoController.cs index 9cb240a819b..d2378032176 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SeoController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SeoController.cs @@ -36,7 +36,6 @@ using Dnn.PersonaBar.Seo.Components; using Dnn.PersonaBar.Seo.Services.Dto; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Controllers; using DotNetNuke.Entities.Modules; @@ -57,12 +56,6 @@ public class SeoController : PersonaBarApiController private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(SeoController)); private readonly Components.SeoController _controller = new Components.SeoController(); private static readonly string LocalResourcesFile = Path.Combine("~/DesktopModules/admin/Dnn.PersonaBar/Modules/Dnn.Seo/App_LocalResources/Seo.resx"); - protected INavigationManager NavigationManager { get; } - - public SeoController(INavigationManager navigationManager) - { - NavigationManager = navigationManager; - } /// GET: api/SEO/GetGeneralSettings /// @@ -554,7 +547,7 @@ public HttpResponseMessage GetExtensionUrlProviders() p.ExtensionUrlProviderId, p.ProviderName, p.IsActive, - SettingUrl = NavigationManager.NavigateURL(PortalSettings.AdminTabId, "UrlProviderSettings", "Display=settings&popUp=true&ProviderId=" + p.ExtensionUrlProviderId) + SettingUrl = Globals.NavigateURL(PortalSettings.AdminTabId, "UrlProviderSettings", "Display=settings&popUp=true&ProviderId=" + p.ExtensionUrlProviderId) }).ToList(); var response = new diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/ServerController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/ServerController.cs index 6b69ceeaaf9..f7c1d87ca53 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/ServerController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/ServerController.cs @@ -28,7 +28,6 @@ using Dnn.PersonaBar.Library; using Dnn.PersonaBar.Library.Attributes; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Utilities; using DotNetNuke.Instrumentation; using DotNetNuke.Services.Localization; @@ -42,13 +41,8 @@ namespace Dnn.PersonaBar.Servers.Services public class ServerController : PersonaBarApiController { private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(ServerController)); - protected INavigationManager NavigationManager { get; } - internal static string LocalResourceFile => Path.Combine("~/DesktopModules/admin/Dnn.PersonaBar/Modules/Dnn.Servers/App_LocalResources/Servers.resx"); - public ServerController(INavigationManager navigationManager) - { - NavigationManager = navigationManager; - } + internal static string LocalResourceFile => Path.Combine("~/DesktopModules/admin/Dnn.PersonaBar/Modules/Dnn.Servers/App_LocalResources/Servers.resx"); [HttpPost] [ValidateAntiForgeryToken] @@ -60,7 +54,7 @@ public HttpResponseMessage RestartApplication() log.AddProperty("Message", Localization.GetString("UserRestart", LocalResourceFile)); LogController.Instance.AddLog(log); Config.Touch(); - return Request.CreateResponse(HttpStatusCode.OK, new {url = NavigationManager.NavigateURL()}); + return Request.CreateResponse(HttpStatusCode.OK, new {url = Globals.NavigateURL()}); } catch (Exception exc) { @@ -77,7 +71,7 @@ public HttpResponseMessage ClearCache() { DataCache.ClearCache(); ClientResourceManager.ClearCache(); - return Request.CreateResponse(HttpStatusCode.OK, new {url = NavigationManager.NavigateURL() }); + return Request.CreateResponse(HttpStatusCode.OK, new {url = Globals.NavigateURL() }); } catch (Exception exc) { @@ -86,4 +80,4 @@ public HttpResponseMessage ClearCache() } } } -} +} \ No newline at end of file diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs index 2b4017b5e19..437ac918e20 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/Services/SiteSettingsController.cs @@ -23,7 +23,6 @@ using Dnn.PersonaBar.Library.Attributes; using Dnn.PersonaBar.SiteSettings.Services.Dto; using DotNetNuke.Common; -using DotNetNuke.Abstractions; using DotNetNuke.Common.Lists; using DotNetNuke.Common.Utilities; using DotNetNuke.Entities.Controllers; @@ -61,7 +60,6 @@ using System.Web; using System.Web.Http; using FileInfo = System.IO.FileInfo; -using Constants = Dnn.PersonaBar.Library.Constants; namespace Dnn.PersonaBar.SiteSettings.Services { @@ -88,12 +86,6 @@ public class SiteSettingsController : PersonaBarApiController private const double DefaultMessagingThrottlingInterval = 0.5; // set default MessagingThrottlingInterval value to 30 seconds. - protected INavigationManager NavigationManager { get; } - public SiteSettingsController(INavigationManager navigationManager) - { - NavigationManager = navigationManager; - } - #region Site Info API /// GET: api/SiteSettings/GetPortalSettings @@ -2735,7 +2727,7 @@ public HttpResponseMessage UpdateLanguage(UpdateLanguageRequest request) if (LocaleController.Instance.GetLocales(pid).Count == 2) { - redirectUrl = NavigationManager.NavigateURL(); + redirectUrl = Globals.NavigateURL(); } } else @@ -2749,7 +2741,7 @@ public HttpResponseMessage UpdateLanguage(UpdateLanguageRequest request) StringComparison.OrdinalIgnoreCase) || LocaleController.Instance.GetLocales(pid).Count == 1) { - redirectUrl = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, + redirectUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, PortalSettings.ActiveTab.IsSuperTab, PortalSettings, "", defaultLocale.Code); } diff --git a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/packages.config b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/packages.config index 94f1e523e42..229c9a1b661 100644 --- a/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/packages.config +++ b/Dnn.AdminExperience/Extensions/Content/Dnn.PersonaBar.Extensions/packages.config @@ -1,6 +1,4 @@  - - \ No newline at end of file diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs index 643741d95a1..d22add16e9c 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Containers/PersonaBarContainer.cs @@ -1,21 +1,21 @@ #region Copyright -// +// // DotNetNuke® - https://www.dnnsoftware.com // Copyright (c) 2002-2018 // by DotNetNuke Corporation -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -// documentation files (the "Software"), to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +// documentation files (the "Software"), to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and // to permit persons to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial portions +// +// The above copyright notice and this permission notice shall be included in all copies or substantial portions // of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. #endregion @@ -24,13 +24,11 @@ using System.Threading; using System.Web; using System.Web.UI; -using Microsoft.Extensions.DependencyInjection; using Dnn.PersonaBar.Library.Common; using Dnn.PersonaBar.Library.Controllers; using Dnn.PersonaBar.Library.Helper; using Dnn.PersonaBar.Library.Model; using DotNetNuke.Application; -using DotNetNuke.Abstractions; using DotNetNuke.Entities.Host; using DotNetNuke.Entities.Portals; using DotNetNuke.Entities.Users; @@ -42,12 +40,6 @@ namespace Dnn.PersonaBar.Library.Containers { public class PersonaBarContainer : IPersonaBarContainer { - protected INavigationManager NavigationManager { get; } - public PersonaBarContainer(INavigationManager navigationManager) - { - NavigationManager = navigationManager; - } - #region Instance Methods private static IPersonaBarContainer _instance; @@ -58,7 +50,7 @@ public static IPersonaBarContainer Instance { if (_instance == null) { - _instance = new PersonaBarContainer(Globals.DependencyProvider.GetRequiredService()); + _instance = new PersonaBarContainer(); } return _instance; @@ -82,13 +74,13 @@ public static void ClearInstance() #region IPersonaBarContainer Implements - public virtual IList RootItems => new List {"Content", "Manage", "Settings", "Edit"}; + public virtual IList RootItems => new List {"Content", "Manage", "Settings", "Edit"}; public virtual bool Visible => true; public virtual void Initialize(UserControl personaBarControl) { - + } public virtual IDictionary GetConfiguration() @@ -100,7 +92,7 @@ public virtual IDictionary GetConfiguration() public virtual void FilterMenu(PersonaBarMenu menu) { - + } #endregion @@ -121,7 +113,7 @@ private IDictionary GetConfigration(PortalSettings portalSetting settings.Add("userId", user.UserID); settings.Add("avatarUrl", Globals.ResolveUrl(Utilities.GetProfileAvatar(user))); settings.Add("culture", Thread.CurrentThread.CurrentUICulture.Name); - settings.Add("logOff", NavigationManager.NavigateURL("Logoff")); + settings.Add("logOff", Globals.NavigateURL("Logoff")); settings.Add("visible", Visible); settings.Add("userMode", portalSettings.UserMode.ToString()); settings.Add("userSettings", PersonaBarUserSettingsController.Instance.GetPersonaBarUserSettings()); diff --git a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Dnn.PersonaBar.Library.csproj b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Dnn.PersonaBar.Library.csproj index 4b8c62f8626..52b87e53314 100644 --- a/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Dnn.PersonaBar.Library.csproj +++ b/Dnn.AdminExperience/Library/Dnn.PersonaBar.Library/Dnn.PersonaBar.Library.csproj @@ -111,10 +111,6 @@ - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - {3cd5f6b8-8360-4862-80b6-f402892db7dd} DotNetNuke.Instrumentation @@ -134,12 +130,6 @@ - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - False ..\..\..\Packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll @@ -160,9 +150,6 @@ - - -