Skip to content

Commit

Permalink
Merges latest changes from 9.4.x into development (dnnsoftware#3189)
Browse files Browse the repository at this point in the history
* Remove disposal of MemoryStream for email attachments sent using SendtokenizedBuilkEmail

* Corrected references to older site URL (dnnsoftware#3056)

* Corrected references to older site URL

* corrected typo from replacement of registered character

* Made the BuildAll task default + docs

* Fixed a typo

* Update .github/BUILD.md

Co-Authored-By: Brian Dukes <bdukes@engagesoftware.com>

* Update .github/BUILD.md

Co-Authored-By: Brian Dukes <bdukes@engagesoftware.com>

* Remove reference to empty fs npm package (dnnsoftware#3094)

fs is a core package, and the version on the npm registry is just an
empty package; this was almost certainly added accidentally

Fixes dnnsoftware#3091

* Added defensive coding to prevent memory leaks

* Updates .Net 4.7.2 warning for NL and DE languages (dnnsoftware#3032)

* Updated de-DE text

As per Sebastian Leupold translation

* Updated nl-NL warning about .Net 4.7.2

As per Timo Breumelhof translation

* DNN-29557 - Infinite while loop fix (dnnsoftware#3123)

* Update Pages.resx

SEO tip for creating a title

(cherry picked from commit 04d1ee6)

* DNN-31121 - Fix the non alphanumeric character regex (dnnsoftware#3059)

* DNN-7818: add send verification mail link in unverified message.

* Add 'fileName' to condition when checking request for logo file.

* Permissions for default folders (dnnsoftware#3024)

(cherry picked from commit e77a281)

* DNN-32978 Copying pro html module don't modify the permission

* Fixes errors with previous build scripts following PB merge

* Updates issue templates and build docs (dnnsoftware#3165)

* Updates documentation as per recent changes

* Added version information

* Removed unneeded BuildAll parameter

* Added back how to clean

* Was already clearer

* Documentation action cleanup (dnnsoftware#3171)

* Add validation method with IsNullOrWhiteSpace check.  Use method to validate RoleGroup Name. closes dnnsoftware#2927 (dnnsoftware#3170)

* OAuthClientBase now returns the correct RequestingCode instead of aborting the thread (dnnsoftware#3152)

* Created INavigationManager to replace Globals.NavigateURL (dnnsoftware#3160)

* Added INavigationManager and updated Globals to reference new INavigationManager

* Updated CreateModule to use new INavigationManager

* Deprecated NavigateURL for v11.0

* Updated viewsource to use INavigationManager

* Migrated Globals.NavigateUrl to use INavigationManager

* Updated persona bar controllers to use NavigateUrl

* Refactored NavigateURL to use new INavigationManager

* Refactored Globals.NavigateURL -> INavigationManager

* Refactored more NavigationManager usages

* Updated more references to Globals.NavigateURL to use INavigationManager

* Cleaned up mistakes that happened in config files in csproj files. These changes were auto-generated by visual studio and shouldn't have been made

* removed generated nodes from csproj

* Fixed spacing in web.config

* Updated old Globals.NavigateURL methods to use registered INavigationManager so everything will execute the same code path

* Updated INavigationManager reference to be static readonly instead of an instance property

* Aliased Constants to 'Dnn.PersonaBar.Libary.Constants' to handle ambiguity

* Added DependencyInjection to website project and updated RazorHost and Export

* Updated DotNetNuke.Website Globals.NavigateURL references to use the new INavigationManager

* Added missing using statement

* Fixing typo

Co-Authored-By: Brian Dukes <bdukes@engagesoftware.com>

* Removing whitespace

Co-Authored-By: Brian Dukes <bdukes@engagesoftware.com>

* Fix typo

* Use GetRequiredService for INavigationManager

Rather than waiting for a null reference later when it's used, there's
never a scenario where this dependency is expected to be missing, so we
want to indicate that it's expected and recieve an error right away if
there's an issue

* Added new DotNetNuke.Abstractions project for storing different common abstractions for the platform

* Updated all (non website project) classes to use INavigationManager from the new DotNetNuke.Abstractions project

* Updated Website Project to use the INavigationManager from the new DotNetNuke.Abstractions project

* Removed unnecessary attributes from NavigationManager

* Updated redirection controller tests to mock out the DependencyProvider and the INavigationManager to fix failing unit tests

* Fixed failing unit tests with mocking out INavigationManager

* Removed private fields for DependencyProvider

* Added singleton clear statements to prevent the INavigationManager from remaining in memory and conflicts between unit tests

* Reset singleton state for PortalController to reduce side-effects from other tests and stale object state from Dependency Injection

* Moved state cleanup code to teardown routine

* Fixed failing unit tests in tests.web project. Added mocks for INavigationManager so the DepenencyProvider can resolve

* Added new DotNetNuke.Abstractions.nuspec to create NuGets during build

* Added missing nuspec files to the solution file

* Updated copyright on all nuget files

* Added .NET Foundation file headers to new Abstraction files

* Resolved duplicate addition of DotNetNuke.Abstractions to sln file

* Added SetTestableInstance and Clear methods to make it easier to test Components. The new methods are internal

* Added happy path test for Navigation Manager

* Added NavigationManager tests

* Updated all INavigationManager references in .ascx.cs files to use private readonly since there should never be a child class

* Removed extra's added by visual studio to .csproj files
  • Loading branch information
valadas authored and mitchelsellers committed Oct 22, 2019
1 parent 1772aa5 commit 697a54e
Show file tree
Hide file tree
Showing 161 changed files with 3,295 additions and 1,655 deletions.
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

0 comments on commit 697a54e

Please sign in to comment.