Skip to content

Commit a67fa32

Browse files
Merge pull request #6416 from valadas/skin-popup-fix
Fixed an issue where auth providers config would use wrong layout
2 parents b5c4b7c + 5c76b00 commit a67fa32

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

DNN Platform/Website/Default.aspx.cs

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ namespace DotNetNuke.Framework
3333
using DotNetNuke.UI;
3434
using DotNetNuke.UI.Internals;
3535
using DotNetNuke.UI.Modules;
36+
using DotNetNuke.UI.Skins;
3637
using DotNetNuke.UI.Skins.Controls;
3738
using DotNetNuke.UI.Utilities;
3839
using DotNetNuke.Web.Client;
@@ -184,25 +185,7 @@ protected override void OnInit(EventArgs e)
184185
// set global page settings
185186
this.InitializePage();
186187

187-
// load skin control and register UI js
188-
UI.Skins.Skin ctlSkin;
189-
if (this.PortalSettings.EnablePopUps)
190-
{
191-
ctlSkin = UrlUtils.InPopUp() ? UI.Skins.Skin.GetPopUpSkin(this) : UI.Skins.Skin.GetSkin(this);
192-
193-
// register popup js
194-
JavaScript.RequestRegistration(CommonJs.jQueryUI);
195-
196-
var popupFilePath = HttpContext.Current.IsDebuggingEnabled
197-
? "~/js/Debug/dnn.modalpopup.js"
198-
: "~/js/dnn.modalpopup.js";
199-
200-
ClientResourceManager.RegisterScript(this, popupFilePath, FileOrder.Js.DnnModalPopup);
201-
}
202-
else
203-
{
204-
ctlSkin = UI.Skins.Skin.GetSkin(this);
205-
}
188+
var ctlSkin = this.GetSkin();
206189

207190
// DataBind common paths for the client resource loader
208191
this.ClientResourceLoader.DataBind();
@@ -689,6 +672,31 @@ private void SetSkinDoctype()
689672
this.attributeList.Text = this.HtmlAttributeList;
690673
}
691674

675+
private Skin GetSkin()
676+
{
677+
// We always want to the popup skin if we are in a popup
678+
// even if we have popups disabled because we could be inside a PersonaBar iframe.
679+
if (UrlUtils.InPopUp())
680+
{
681+
this.LoadPopupScriptsIfNeeded();
682+
return Skin.GetPopUpSkin(this);
683+
}
684+
685+
return Skin.GetSkin(this);
686+
}
687+
688+
private void LoadPopupScriptsIfNeeded()
689+
{
690+
if (this.PortalSettings.EnablePopUps)
691+
{
692+
JavaScript.RequestRegistration(CommonJs.jQueryUI);
693+
var popupFilePath = HttpContext.Current.IsDebuggingEnabled
694+
? "~/js/Debug/dnn.modalpopup.js"
695+
: "~/js/dnn.modalpopup.js";
696+
ClientResourceManager.RegisterScript(this, popupFilePath, FileOrder.Js.DnnModalPopup);
697+
}
698+
}
699+
692700
private void ManageFavicon()
693701
{
694702
string headerLink = FavIcon.GetHeaderLink(this.PortalSettings.PortalId);

0 commit comments

Comments
 (0)