Skip to content

Commit

Permalink
Merge pull request #3844 from donker/ptfix
Browse files Browse the repository at this point in the history
Fix portal template import
  • Loading branch information
mitchelsellers authored Jun 17, 2020
2 parents f1397aa + d1728f3 commit 9679a4b
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 28 deletions.
59 changes: 49 additions & 10 deletions DNN Platform/Library/Entities/Portals/PortalController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1594,16 +1594,6 @@ private void ParsePortalSettings(XmlNode nodeSettings, int portalId)
UpdatePortalSetting(portalId, "EnableSkinWidgets", XmlUtils.GetNodeValue(nodeSettings, "enableskinwidgets", string.Empty));
}

if (!string.IsNullOrEmpty(XmlUtils.GetNodeValue(nodeSettings, "showcookieconsent", string.Empty)))
{
UpdatePortalSetting(portalId, "ShowCookieConsent", XmlUtils.GetNodeValue(nodeSettings, "showcookieconsent", "False"));
}

if (!string.IsNullOrEmpty(XmlUtils.GetNodeValue(nodeSettings, "cookiemorelink", string.Empty)))
{
UpdatePortalSetting(portalId, "CookieMoreLink", XmlUtils.GetNodeValue(nodeSettings, "cookiemorelink", string.Empty), true, currentCulture);
}

// Enable AutoSAve feature
if (!string.IsNullOrEmpty(XmlUtils.GetNodeValue(nodeSettings, "enableautosave", string.Empty)))
{
Expand Down Expand Up @@ -1687,6 +1677,47 @@ private void ParsePortalSettings(XmlNode nodeSettings, int portalId)
{
UpdatePortalSetting(portalId, "EnableBrowserLanguage", XmlUtils.GetNodeValue(nodeSettings, "enablebrowserlanguage", string.Empty));
}

if (!string.IsNullOrEmpty(XmlUtils.GetNodeValue(nodeSettings, "showcookieconsent", string.Empty)))
{
UpdatePortalSetting(portalId, "ShowCookieConsent", XmlUtils.GetNodeValue(nodeSettings, "showcookieconsent", "False"));
}

if (!string.IsNullOrEmpty(XmlUtils.GetNodeValue(nodeSettings, "cookiemorelink", string.Empty)))
{
UpdatePortalSetting(portalId, "CookieMoreLink", XmlUtils.GetNodeValue(nodeSettings, "cookiemorelink", string.Empty), true, currentCulture);
}

if (!string.IsNullOrEmpty(XmlUtils.GetNodeValue(nodeSettings, "dataconsentactive", string.Empty)))
{
UpdatePortalSetting(portalId, "DataConsentActive", XmlUtils.GetNodeValue(nodeSettings, "dataconsentactive", "False"));
}

if (!string.IsNullOrEmpty(XmlUtils.GetNodeValue(nodeSettings, "dataconsenttermslastchange", string.Empty)))
{
UpdatePortalSetting(portalId, "DataConsentTermsLastChange", XmlUtils.GetNodeValue(nodeSettings, "dataconsenttermslastchange", string.Empty), true, currentCulture);
}

if (!string.IsNullOrEmpty(XmlUtils.GetNodeValue(nodeSettings, "dataconsentconsentredirect", string.Empty)))
{
UpdatePortalSetting(portalId, "DataConsentConsentRedirect", XmlUtils.GetNodeValue(nodeSettings, "dataconsentconsentredirect", string.Empty), true, currentCulture);
}

if (!string.IsNullOrEmpty(XmlUtils.GetNodeValue(nodeSettings, "dataconsentuserdeleteaction", string.Empty)))
{
UpdatePortalSetting(portalId, "DataConsentUserDeleteAction", XmlUtils.GetNodeValue(nodeSettings, "dataconsentuserdeleteaction", string.Empty), true, currentCulture);
}

if (!string.IsNullOrEmpty(XmlUtils.GetNodeValue(nodeSettings, "dataconsentdelay", string.Empty)))
{
UpdatePortalSetting(portalId, "DataConsentDelay", XmlUtils.GetNodeValue(nodeSettings, "dataconsentdelay", string.Empty), true, currentCulture);
}

if (!string.IsNullOrEmpty(XmlUtils.GetNodeValue(nodeSettings, "dataconsentdelaymeasurement", string.Empty)))
{
UpdatePortalSetting(portalId, "DataConsentDelayMeasurement", XmlUtils.GetNodeValue(nodeSettings, "dataconsentdelaymeasurement", string.Empty), true, currentCulture);
}

}

private void ParseRoleGroups(XPathNavigator nav, int portalID, int administratorId)
Expand Down Expand Up @@ -1876,6 +1907,14 @@ private void ParseTab(XmlNode nodeTab, int portalId, bool isAdminTemplate, Porta
portal.Custom500TabId = tab.TabID;
logType = "Custom500Tab";
break;
case "termstab":
portal.TermsTabId = tab.TabID;
logType = "TermsTabId";
break;
case "privacytab":
portal.PrivacyTabId = tab.TabID;
logType = "PrivacyTabId";
break;
}

this.UpdatePortalSetup(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<xs:element name="settings" maxOccurs="1" minOccurs="0">
<xs:complexType>
<xs:all>
<xs:element name="showcookieconsent" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="enableskinwidgets" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="enableautosave" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="timetoautosave" type="xs:integer" minOccurs="0" maxOccurs="1" />
Expand Down Expand Up @@ -42,8 +41,16 @@
<xs:element name="pageheadtext" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="injectmodulehyperlink" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="addcompatiblehttpheader" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="allowuseruiculture" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="enablebrowserlanguage" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="allowuseruiculture" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="enablebrowserlanguage" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="showcookieconsent" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="cookiemorelink" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="dataconsentactive" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="dataconsenttermslastchange" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="dataconsentconsentredirect" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="dataconsentuserdeleteaction" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="dataconsentdelay" type="xs:integer" minOccurs="0" maxOccurs="1" />
<xs:element name="dataconsentdelaymeasurement" type="xs:string" minOccurs="0" maxOccurs="1" />
</xs:all>
<xs:attribute name="sku" type="xs:string"/>
</xs:complexType>
Expand All @@ -64,18 +71,18 @@
<xs:all>
<xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="active" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="settings" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="setting" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="value" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="settings" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="setting" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="value" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
Expand Down Expand Up @@ -438,7 +445,7 @@
<xs:complexType>
<xs:sequence>
<xs:element name="layout" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:complexType>
<xs:all>
<xs:element name="control" type="xs:string" minOccurs="1" maxOccurs="1" />
</xs:all>
Expand Down Expand Up @@ -576,8 +583,10 @@
<xs:enumeration value="logintab"/>
<xs:enumeration value="splashtab"/>
<xs:enumeration value="404tab"/>
<xs:enumeration value="500tab"/>
<xs:enumeration value="searchtab"/>
<xs:enumeration value="500tab"/>
<xs:enumeration value="searchtab"/>
<xs:enumeration value="termstab"/>
<xs:enumeration value="privacytab"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="alignmentEnum">
Expand Down
6 changes: 6 additions & 0 deletions DNN Platform/Website/DotNetNuke.Website.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2768,6 +2768,12 @@
<Content Include="images\xml.gif" />
<Content Include="images\yellow-warning.gif" />
<Content Include="images\yellow-warning_16px.gif" />
<None Include="DesktopModules\Admin\Portals\portal.template.xsd">
<SubType>Designer</SubType>
</None>
<Content Include="DesktopModules\Admin\Portals\portal.template.xsx">
<DependentUpon>portal.template.xsd</DependentUpon>
</Content>
<None Include="Install\App_LocalResources\Locales.xml" />
<Content Include="Install\AuthSystem\PlaceHolder.txt" />
<Content Include="Install\Cleanup\PlaceHolder.txt" />
Expand Down

0 comments on commit 9679a4b

Please sign in to comment.