Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created INavigationManager to replace Globals.NavigateURL #3160

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
535b0b5
Added INavigationManager and updated Globals to reference new INaviga…
SkyeHoefling Oct 16, 2019
acf48d0
Updated CreateModule to use new INavigationManager
SkyeHoefling Oct 16, 2019
be20b2c
Deprecated NavigateURL for v11.0
SkyeHoefling Oct 16, 2019
786680c
Updated viewsource to use INavigationManager
SkyeHoefling Oct 16, 2019
920d2d3
Migrated Globals.NavigateUrl to use INavigationManager
SkyeHoefling Oct 16, 2019
06dfe45
Updated persona bar controllers to use NavigateUrl
SkyeHoefling Oct 16, 2019
84a62ca
Refactored NavigateURL to use new INavigationManager
SkyeHoefling Oct 16, 2019
6c5dacf
Refactored Globals.NavigateURL -> INavigationManager
SkyeHoefling Oct 16, 2019
369b0cf
Refactored more NavigationManager usages
SkyeHoefling Oct 16, 2019
cf60be8
Updated more references to Globals.NavigateURL to use INavigationManager
SkyeHoefling Oct 16, 2019
c4fb6d1
Cleaned up mistakes that happened in config files in csproj files. Th…
SkyeHoefling Oct 17, 2019
a28c45e
removed generated nodes from csproj
SkyeHoefling Oct 17, 2019
f16b926
Fixed spacing in web.config
SkyeHoefling Oct 17, 2019
1df11ed
Updated old Globals.NavigateURL methods to use registered INavigation…
SkyeHoefling Oct 17, 2019
b541e14
Updated INavigationManager reference to be static readonly instead of…
SkyeHoefling Oct 17, 2019
171667a
Aliased Constants to 'Dnn.PersonaBar.Libary.Constants' to handle ambi…
SkyeHoefling Oct 17, 2019
fe4ba9b
Added DependencyInjection to website project and updated RazorHost an…
SkyeHoefling Oct 17, 2019
c8d41d1
Updated DotNetNuke.Website Globals.NavigateURL references to use the …
SkyeHoefling Oct 17, 2019
0c3a4ad
Added missing using statement
SkyeHoefling Oct 17, 2019
20969ba
Fixing typo
SkyeHoefling Oct 17, 2019
af0dc25
Removing whitespace
SkyeHoefling Oct 17, 2019
adfc7ba
Fix typo
SkyeHoefling Oct 17, 2019
990d5ba
Use GetRequiredService for INavigationManager
SkyeHoefling Oct 17, 2019
87e5a69
Added new DotNetNuke.Abstractions project for storing different commo…
SkyeHoefling Oct 17, 2019
35b14ae
Updated all (non website project) classes to use INavigationManager f…
SkyeHoefling Oct 18, 2019
ec10808
Updated Website Project to use the INavigationManager from the new Do…
SkyeHoefling Oct 18, 2019
cadd83b
Removed unnecessary attributes from NavigationManager
SkyeHoefling Oct 18, 2019
7d22dae
Updated redirection controller tests to mock out the DependencyProvid…
SkyeHoefling Oct 18, 2019
ea2b32a
Fixed failing unit tests with mocking out INavigationManager
SkyeHoefling Oct 18, 2019
df2ba4d
Removed private fields for DependencyProvider
SkyeHoefling Oct 18, 2019
e808def
Added singleton clear statements to prevent the INavigationManager fr…
SkyeHoefling Oct 18, 2019
4d82510
Reset singleton state for PortalController to reduce side-effects fro…
SkyeHoefling Oct 18, 2019
855edc3
Moved state cleanup code to teardown routine
SkyeHoefling Oct 18, 2019
716f974
Fixed failing unit tests in tests.web project. Added mocks for INavig…
SkyeHoefling Oct 18, 2019
57c4c75
Added new DotNetNuke.Abstractions.nuspec to create NuGets during build
SkyeHoefling Oct 18, 2019
1b93ce4
Added missing nuspec files to the solution file
SkyeHoefling Oct 18, 2019
68ab5fd
Updated copyright on all nuget files
SkyeHoefling Oct 18, 2019
6bdaff1
Added .NET Foundation file headers to new Abstraction files
SkyeHoefling Oct 18, 2019
94d277f
Resolved duplicate addition of DotNetNuke.Abstractions to sln file
SkyeHoefling Oct 19, 2019
85b5553
Added SetTestableInstance and Clear methods to make it easier to test…
SkyeHoefling Oct 20, 2019
4c0262a
Added happy path test for Navigation Manager
SkyeHoefling Oct 20, 2019
326c80e
Added NavigationManager tests
SkyeHoefling Oct 20, 2019
5791d46
Updated all INavigationManager references in .ascx.cs files to use pr…
SkyeHoefling Oct 20, 2019
c3923c0
Merge branch 'release/9.4.x' into globals_navigation_manager
SkyeHoefling Oct 20, 2019
1420e3e
Removed extra's added by visual studio to .csproj files
SkyeHoefling Oct 20, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Build/Tools/NuGet/DotNetNuke.Abstractions.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>DotNetNuke.Abstractions</id>
<version>$version$</version>
<title>DNN Platform (Abstractions)</title>
<authors>DNN Corp</authors>
<owners>DNN Corp</owners>
<license type="expression">MIT</license>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<iconUrl>http://www.dnnsoftware.com/favicon.ico</iconUrl>
<projectUrl>https://github.com/dnnsoftware/Dnn.Platform</projectUrl>
<description>
Provides common abstraction API references for the DNN Platform.
</description>
<copyright>Copyright (c) .NET Foundation and Contributors, All Rights Reserved.</copyright>
</metadata>
<files>
<file src="..\..\..\Website\bin\DotNetNuke.Abstractions.dll" target="lib\netstandard2.0" />
<file src="..\..\..\Website\bin\DotNetNuke.Abstractions.pdb" target="lib\netstandard2.0" />
</files>
</package>
2 changes: 1 addition & 1 deletion Build/Tools/NuGet/DotNetNuke.Bundle.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<description>
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.
</description>
<copyright>DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved.</copyright>
<copyright>Copyright (c) .NET Foundation and Contributors, All Rights Reserved.</copyright>
<dependencies>
<dependency id="DotNetNuke.Core" version="$version$" />
<dependency id="DotNetNuke.Instrumentation" version="$version$" />
Expand Down
2 changes: 1 addition & 1 deletion Build/Tools/NuGet/DotNetNuke.Core.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<description>
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
</description>
<copyright>DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved.</copyright>
<copyright>Copyright (c) .NET Foundation and Contributors, All Rights Reserved.</copyright>
<dependencies>
<dependency id="DotNetNuke.DependencyInjection" version="$version$" />
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion Build/Tools/NuGet/DotNetNuke.DependencyInjection.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<description>
Provides API references needed to use Dependency Injection for the DNN Platform.
</description>
<copyright>DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved.</copyright>
<copyright>Copyright (c) .NET Foundation and Contributors, All Rights Reserved.</copyright>
<dependencies>
<dependency id="Microsoft.Extensions.DependencyInjection" version="2.1.1" />
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion Build/Tools/NuGet/DotNetNuke.Instrumentation.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<description>
Provides references to enhanced logging and instrumentation available within DNN Platform for extension developers. Including access to Log4Net
</description>
<copyright>DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved.</copyright>
<copyright>Copyright (c) .NET Foundation and Contributors, All Rights Reserved.</copyright>
<dependencies>
<dependency id="DotNetNuke.Core" version="$version$" />
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<description>
Provides API references needed to develop custom folder providers, or to consume folder providers
</description>
<copyright>DotNetNuke is copyright 2002-2019 by DNN Corp. All Rights Reserved.</copyright>
<copyright>Copyright (c) .NET Foundation and Contributors, All Rights Reserved.</copyright>
<dependencies>
<dependency id="DotNetNuke.Core" version="$version$" />
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion Build/Tools/NuGet/DotNetNuke.SiteExportImport.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<description>
This package contains components required for developing extensiong to utilize site export/import features.
</description>
<copyright>DNN and DotNetNuke are copyright 2002-2018 by DNN Corp. All Rights Reserved.</copyright>
<copyright>Copyright (c) .NET Foundation and Contributors, All Rights Reserved.</copyright>
<dependencies>
<dependency id="DotNetNuke.Core" version="$version$" />
<dependency id="DotNetNuke.Instrumentation" version="$version$" />
Expand Down
2 changes: 1 addition & 1 deletion Build/Tools/NuGet/DotNetNuke.Web.Client.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<description>
Provides API references for usage of the Client Dependency Framework (CDF) for the inclusion of CSS and JS files within DNN Platform
</description>
<copyright>DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved.</copyright>
<copyright>Copyright (c) .NET Foundation and Contributors, All Rights Reserved.</copyright>
<dependencies>
<dependency id="DotNetNuke.Core" version="$version$" />
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion Build/Tools/NuGet/DotNetNuke.Web.Deprecated.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<description>
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
</description>
<copyright>DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved.</copyright>
<copyright>Copyright (c) .NET Foundation and Contributors, All Rights Reserved.</copyright>
<dependencies>
<dependency id="DotNetNuke.Web" version="$version$" />
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion Build/Tools/NuGet/DotNetNuke.Web.Mvc.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<description>
Provides API references needed to develop ASP.MVC extensions for DNN Platform
</description>
<copyright>DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved.</copyright>
<copyright>Copyright (c) .NET Foundation and Contributors, All Rights Reserved.</copyright>
<dependencies>
<dependency id="DotNetNuke.Web" version="$version$" />
<dependency id="DotNetNuke.Web.Client" version="$version$" />
Expand Down
2 changes: 1 addition & 1 deletion Build/Tools/NuGet/DotNetNuke.Web.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<description>
Provides references to core components such as Caching, Security and other security-related items for DNN Platform
</description>
<copyright>DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved.</copyright>
<copyright>Copyright (c) .NET Foundation and Contributors, All Rights Reserved.</copyright>
<dependencies>
<dependency id="DotNetNuke.Core" version="$version$" />
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion Build/Tools/NuGet/DotNetNuke.WebApi.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<description>
This package contains components required for developing WebAPI based services for DNN Platform.
</description>
<copyright>DNN and DotNetNuke are copyright 2002-2019 by DNN Corp. All Rights Reserved.</copyright>
<copyright>Copyright (c) .NET Foundation and Contributors, All Rights Reserved.</copyright>
<dependencies>
<dependency id="Microsoft.AspNet.WebApi.Core" version="5.2.3" />
<dependency id="Microsoft.AspNet.WebApi.Client" version="5.2.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
<HintPath>..\..\DotNetNuke.WebUtility\bin\DotNetNuke.WebUtility.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
</Reference>
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
Expand Down Expand Up @@ -103,6 +109,10 @@
<Content Include="ViewConsole.ascx" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\DotNetNuke.Abstractions\DotNetNuke.Abstractions.csproj">
<Project>{6928A9B1-F88A-4581-A132-D3EB38669BB0}</Project>
<Name>DotNetNuke.Abstractions</Name>
</ProjectReference>
<ProjectReference Include="..\..\DotNetNuke.Instrumentation\DotNetNuke.Instrumentation.csproj">
<Project>{3cd5f6b8-8360-4862-80b6-f402892db7dd}</Project>
<Name>DotNetNuke.Instrumentation</Name>
Expand Down Expand Up @@ -134,6 +144,9 @@
<ItemGroup>
<Content Include="web.config" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down
47 changes: 26 additions & 21 deletions DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -29,15 +29,14 @@
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.Common;
using DotNetNuke.Abstractions;
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;
Expand All @@ -53,12 +52,18 @@ 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<TabInfo> _tabs;
private IList<TabInfo> _tabs;

public ViewConsole()
{
_navigationManager = DependencyProvider.GetRequiredService<INavigationManager>();
}

#region Public Properties

Expand All @@ -74,7 +79,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
Expand Down Expand Up @@ -377,7 +382,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);
Expand Down Expand Up @@ -414,7 +419,7 @@ protected override void OnLoad(EventArgs e)
{
tabIdList.Add(tab.TabID);
}
_tabs.Add(tab);
_tabs.Add(tab);
}
}

Expand Down Expand Up @@ -503,12 +508,12 @@ protected string GetHtml(TabInfo tab)
var tabUrl = tab.FullUrl;
if (ProfileUserId > -1)
{
tabUrl = Globals.NavigateURL(tab.TabID, "", "UserId=" + ProfileUserId.ToString(CultureInfo.InvariantCulture));
tabUrl = _navigationManager.NavigateURL(tab.TabID, "", "UserId=" + ProfileUserId.ToString(CultureInfo.InvariantCulture));
}

if (GroupId > -1)
{
tabUrl = Globals.NavigateURL(tab.TabID, "", "GroupId=" + GroupId.ToString(CultureInfo.InvariantCulture));
tabUrl = _navigationManager.NavigateURL(tab.TabID, "", "GroupId=" + GroupId.ToString(CultureInfo.InvariantCulture));
}

returnValue += string.Format(sb.ToString(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Extensions.DependencyInjection" version="2.1.1" targetFramework="net472" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="2.1.1" targetFramework="net472" />
</packages>
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -40,14 +40,20 @@
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
{

public partial class CreateModule : PortalModuleBase
{
private readonly INavigationManager _navigationManager;
public CreateModule()
{
_navigationManager = DependencyProvider.GetRequiredService<INavigationManager>();
}

#region Private Methods

Expand Down Expand Up @@ -147,7 +153,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());
Expand Down Expand Up @@ -325,7 +331,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();
Expand Down Expand Up @@ -438,7 +444,7 @@ protected void cmdCreate_Click(object sender, EventArgs e)
HostController.Instance.Update("Owner", txtOwner.Text, false);
if (CreateModuleDefinition())
{
Response.Redirect(Globals.NavigateURL(), true);
Response.Redirect(_navigationManager.NavigateURL(), true);
}
}
else
Expand Down
Loading