Skip to content
This repository has been archived by the owner on Feb 10, 2021. It is now read-only.

Commit

Permalink
DNN-8137: Fixed CodeMirror & WordCount settings not loading issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Kan Ma committed Dec 21, 2016
1 parent 9c41887 commit 130f543
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion DNNConnect.CKEditorProvider.dnn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<dotnetnuke type="Package" version="5.0">
<packages><package name="DNNConnect.CKEditorProvider" type="Provider" version="01.00.02">
<packages><package name="DNNConnect.CKEditorProvider" type="Provider" version="01.00.03">
<friendlyName>DNN Connect CKEditor Provider</friendlyName>
<description>CKEditor Provider by DNN Connect for DNN</description>
<iconFile>~/Providers/HtmlEditorProviders/DNNConnect.CKE/LogoCKEditor.png</iconFile>
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

[assembly: AssemblyDescription("CKEditor HTML Editor Provider for DNN")]
[assembly: AssemblyTitle("CKEditor HTML Editor Provider for DNN")]
[assembly: AssemblyVersion("1.0.2.*")]
[assembly: AssemblyFileVersion("1.0.2")]
[assembly: AssemblyVersion("1.0.3.*")]
[assembly: AssemblyFileVersion("1.0.3")]
[assembly: ComVisible(false)]
[assembly: AssemblyCompany("DNN-Connect")]
[assembly: AssemblyCopyright("2015 DNN-Connect")]
Expand Down
56 changes: 30 additions & 26 deletions Utilities/SettingsUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,37 +103,39 @@ internal static EditorProviderSettings LoadPortalOrPageSettings(
{
if (!filteredSettings.Any(s => s.Name.Equals(string.Format("{0}{1}", key, info.Name))))
{
continue;
if (!info.Name.Equals("CodeMirror") && !info.Name.Equals("WordCount"))
{
continue;
}
}

/*if (!info.Name.Equals("CodeMirror") && !info.Name.Equals("WordCount"))
var settingValue = string.Empty;
if (!info.Name.Equals("CodeMirror") && !info.Name.Equals("WordCount"))
{
continue;
}*/

var settingValue =
filteredSettings.FirstOrDefault(
setting => setting.Name.Equals(string.Format("{0}{1}", key, info.Name))).Value;
settingValue =
filteredSettings.FirstOrDefault(
setting => setting.Name.Equals(string.Format("{0}{1}", key, info.Name))).Value;

if (string.IsNullOrEmpty(settingValue))
{
continue;
}
if (string.IsNullOrEmpty(settingValue))
{
continue;
}

switch (info.PropertyType.Name)
{
case "String":
info.SetValue(currentSettings.Config, settingValue, null);
break;
case "Int32":
info.SetValue(currentSettings.Config, int.Parse(settingValue), null);
break;
case "Decimal":
info.SetValue(currentSettings.Config, decimal.Parse(settingValue), null);
break;
case "Boolean":
info.SetValue(currentSettings.Config, bool.Parse(settingValue), null);
break;
switch (info.PropertyType.Name)
{
case "String":
info.SetValue(currentSettings.Config, settingValue, null);
break;
case "Int32":
info.SetValue(currentSettings.Config, int.Parse(settingValue), null);
break;
case "Decimal":
info.SetValue(currentSettings.Config, decimal.Parse(settingValue), null);
break;
case "Boolean":
info.SetValue(currentSettings.Config, bool.Parse(settingValue), null);
break;
}
}

switch (info.Name)
Expand Down Expand Up @@ -168,6 +170,7 @@ internal static EditorProviderSettings LoadPortalOrPageSettings(
typeof(CodeMirror).GetProperties()
.Where(codeMirrorInfo => !codeMirrorInfo.Name.Equals("Theme")))
{
settingValue = filteredSettings.FirstOrDefault(setting => setting.Name.Equals(string.Format("{0}{1}", key, codeMirrorInfo.Name))).Value;
switch (codeMirrorInfo.PropertyType.Name)
{
case "String":
Expand Down Expand Up @@ -198,6 +201,7 @@ internal static EditorProviderSettings LoadPortalOrPageSettings(
case "WordCount":
foreach (var wordCountInfo in typeof(WordCountConfig).GetProperties())
{
settingValue = filteredSettings.FirstOrDefault(setting => setting.Name.Equals(string.Format("{0}{1}", key, wordCountInfo.Name))).Value;
switch (wordCountInfo.PropertyType.Name)
{
case "String":
Expand Down

0 comments on commit 130f543

Please sign in to comment.