improved file upload, enhanced module installation from Nuget to support upgrades, added ability to upgrade the framework from Nuget, completed isolated multitenancy and site alias management, created IPortable interface for importing data into modules, added default content to initial installation

This commit is contained in:
Shaun Walker
2019-10-08 16:11:23 -04:00
parent dce53e10b0
commit 9971510b1e
48 changed files with 961 additions and 157 deletions

View File

@ -0,0 +1,46 @@
using Oqtane.Models;
using Oqtane.Modules.HtmlText.Models;
using Oqtane.Modules.HtmlText.Repository;
using System.Net;
namespace Oqtane.Modules.HtmlText.Manager
{
public class HtmlTextManager : IPortable
{
private IHtmlTextRepository htmltexts;
public HtmlTextManager(IHtmlTextRepository htmltexts)
{
this.htmltexts = htmltexts;
}
public string ExportModule(Module Module)
{
string content = "";
HtmlTextInfo htmltext = htmltexts.GetHtmlText(Module.ModuleId);
if (htmltext != null)
{
content = WebUtility.HtmlEncode(htmltext.Content);
}
return content;
}
public void ImportModule(Module Module, string Content, string Version)
{
Content = WebUtility.HtmlDecode(Content);
HtmlTextInfo htmltext = htmltexts.GetHtmlText(Module.ModuleId);
if (htmltext != null)
{
htmltext.Content = Content;
htmltexts.UpdateHtmlText(htmltext);
}
else
{
htmltext = new HtmlTextInfo();
htmltext.ModuleId = Module.ModuleId;
htmltext.Content = Content;
htmltexts.AddHtmlText(htmltext);
}
}
}
}