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

No longer adding a Host page & removing existing ones #241

Merged
Merged
Changes from all commits
Commits
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
28 changes: 17 additions & 11 deletions Website/DesktopModules/Hotcakes/Core/HotcakesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
using DotNetNuke.Entities.Portals;
using DotNetNuke.Entities.Tabs;
using DotNetNuke.Framework;
using DotNetNuke.Instrumentation;
using DotNetNuke.Services.Exceptions;
using DotNetNuke.Services.Installer;
using DotNetNuke.Services.Installer.Packages;
Expand All @@ -65,6 +66,8 @@ namespace Hotcakes.Modules.Core
[Serializable]
public class HotcakesController : IUpgradeable
{
private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(HotcakesController));

private bool IsGenericCodeExecuted { get; set; }

public string UpgradeModule(string Version)
Expand All @@ -75,7 +78,6 @@ public string UpgradeModule(string Version)
{
case "01.00.00":
DnnEventLog.InstallLogTypes();
AddHostPage();
break;

case "01.00.07":
Expand Down Expand Up @@ -108,6 +110,10 @@ public string UpgradeModule(string Version)
RevertHotcakesCloudConfig();
break;

case "03.03.00":
DeleteHostPage();
break;

default:
break;
}
Expand Down Expand Up @@ -400,17 +406,17 @@ private static void AddAdminPage(TabController tabCtl, PortalInfo portal)
tabCtl.UpdateTab(tab);
}

private void AddHostPage()
private void DeleteHostPage()
{
var hostTab = Upgrade.AddHostPage(
"Hotcakes Administration",
"Hotcakes Administration",
"~/Icons/Sigma/Configuration_16X16_Standard.png",
"~/Icons/Sigma/Configuration_32X32_Standard.png",
true);

hostTab.Url = VirtualPathUtility.ToAbsolute("~/DesktopModules/Hotcakes/Core/Admin/Default.aspx");
new TabController().UpdateTab(hostTab);
try
{
// this will only be the case if this is an upgrade
Upgrade.RemoveHostPage("Hotcakes Administration");
}
catch (Exception ex)
{
Logger.Error(ex.Message, ex);
}
}

private void CategorizeModules()
Expand Down