diff --git a/.yo-rc.json b/.yo-rc.json
new file mode 100644
index 00000000..f7a4977a
--- /dev/null
+++ b/.yo-rc.json
@@ -0,0 +1,26 @@
+{
+ "generator-dotnetnuke": {
+ "promptValues": {
+ "projType": "library",
+ "dnnVersion": "9.13.0",
+ "npm": true,
+ "projectname": "Blog",
+ "projectdescription": "The DotNetNuke Blog module is an easy to use content publishing module that is tightly integrated with the core DotNetNuke framework. It can be used in single or multi-author environments and also permits content authoring using off-site tools such as Windows Live Writer.",
+ "yourname": "Peter Donker",
+ "email": "peter@bring2mind.net",
+ "companyfull": "DotNetNuke Community",
+ "companyshort": "DotNetNuke",
+ "companyUrl": "www.dnncommunity.org",
+ "dnnHost": "http://dnndev.me",
+ "dnnRoot": "DL/",
+ "namespace": "DotNetNuke.Modules.Blog",
+ "Name": "Core",
+ "Namespace": "DotNetNuke.Blog.Core",
+ "Separate": false
+ },
+ "Company": "DotNetNuke",
+ "Project": "Blog",
+ "Namespace": "DotNetNuke.Blog",
+ "Solution": "DotNetNuke.Blog"
+ }
+}
diff --git a/DotNetNuke.Modules.Blog.sln b/DotNetNuke.Blog.sln
similarity index 73%
rename from DotNetNuke.Modules.Blog.sln
rename to DotNetNuke.Blog.sln
index 412f6f3e..ff4721ea 100644
--- a/DotNetNuke.Modules.Blog.sln
+++ b/DotNetNuke.Blog.sln
@@ -1,29 +1,35 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.1.32328.378
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DotNetNuke.Modules.Blog", "Server\Blog\DotNetNuke.Modules.Blog.vbproj", "{4E2BCA3B-927C-4AF2-9999-B1C074FD0539}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "build\Build.csproj", "{22A9DE4E-9CFD-4ABA-8C82-87D1C22F2FD9}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {4E2BCA3B-927C-4AF2-9999-B1C074FD0539}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4E2BCA3B-927C-4AF2-9999-B1C074FD0539}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4E2BCA3B-927C-4AF2-9999-B1C074FD0539}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4E2BCA3B-927C-4AF2-9999-B1C074FD0539}.Release|Any CPU.Build.0 = Release|Any CPU
- {22A9DE4E-9CFD-4ABA-8C82-87D1C22F2FD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {22A9DE4E-9CFD-4ABA-8C82-87D1C22F2FD9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {A4DC134D-8514-4096-8B8B-8AB593421020}
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.1.32328.378
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DotNetNuke.Modules.Blog", "Server\Blog\DotNetNuke.Modules.Blog.vbproj", "{4E2BCA3B-927C-4AF2-9999-B1C074FD0539}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "build\Build.csproj", "{22A9DE4E-9CFD-4ABA-8C82-87D1C22F2FD9}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetNuke.Modules.Blog.Core", "Server\Core\DotNetNuke.Modules.Blog.Core.csproj", "{18CBD81C-C31C-465D-8865-70957DF4711C}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4E2BCA3B-927C-4AF2-9999-B1C074FD0539}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4E2BCA3B-927C-4AF2-9999-B1C074FD0539}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4E2BCA3B-927C-4AF2-9999-B1C074FD0539}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4E2BCA3B-927C-4AF2-9999-B1C074FD0539}.Release|Any CPU.Build.0 = Release|Any CPU
+ {22A9DE4E-9CFD-4ABA-8C82-87D1C22F2FD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {22A9DE4E-9CFD-4ABA-8C82-87D1C22F2FD9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {18CBD81C-C31C-465D-8865-70957DF4711C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {18CBD81C-C31C-465D-8865-70957DF4711C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {18CBD81C-C31C-465D-8865-70957DF4711C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {18CBD81C-C31C-465D-8865-70957DF4711C}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {A4DC134D-8514-4096-8B8B-8AB593421020}
+ EndGlobalSection
+EndGlobal
diff --git a/License.md b/License.md
new file mode 100644
index 00000000..5c100fc3
--- /dev/null
+++ b/License.md
@@ -0,0 +1,10 @@
+Copyright (c) 2025 DotNetNuke, All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/Server/Blog/Admin.ascx.vb b/Server/Blog/Admin.ascx.vb
index a5763e86..9e714ee4 100644
--- a/Server/Blog/Admin.ascx.vb
+++ b/Server/Blog/Admin.ascx.vb
@@ -18,173 +18,175 @@
' DEALINGS IN THE SOFTWARE.
'
-Imports DotNetNuke.Modules.Blog.Common.Globals
+Imports DotNetNuke.Modules.Blog.Core.Common
+Imports DotNetNuke.Modules.Blog.Core.Data
+Imports DotNetNuke.Modules.Blog.Core.Entities.Terms
Public Class Admin
- Inherits BlogModuleBase
-
- Private _totalPosts As Integer = -1
-
- Private Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
- AddJavascriptFile("jquery.dynatree.min.js", "jquery.dynatree", "1.2.4", 60)
- AddCssFile("dynatree.css", "dynatree", "1.2.4")
- End Sub
-
- Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
-
- If Not BlogContext.Security.IsEditor Then
- Throw New Exception("You do not have access to this resource. Please check your login status.")
- End If
-
- If Not IsPostBack Then
- DataBind()
- End If
-
- UI.Utilities.ClientAPI.AddButtonConfirm(cmdEditTagsML, LocalizeString("LeavePage.Confirm"))
- UI.Utilities.ClientAPI.AddButtonConfirm(cmdEditCategoriesML, LocalizeString("LeavePage.Confirm"))
-
- End Sub
-
- Private Sub cmdEditTagsML_Click(sender As Object, e As EventArgs) Handles cmdEditTagsML.Click
- SaveChanges()
- Response.Redirect(EditUrl("TermsEditML"), False)
- End Sub
-
- Private Sub cmdEditCategoriesML_Click(sender As Object, e As EventArgs) Handles cmdEditCategoriesML.Click
- SaveChanges()
- If Settings.VocabularyId > -1 Then
- Response.Redirect(EditUrl("VocabularyId", Settings.VocabularyId.ToString, "TermsEditML"), False)
- End If
- End Sub
-
- Private Sub cmdCreateVocabulary_Click(sender As Object, e As EventArgs) Handles cmdCreateVocabulary.Click
- Settings.VocabularyId = Integration.Integration.CreateNewVocabulary(PortalId).VocabularyId
- Settings.UpdateSettings()
- DataBind()
- End Sub
-
- Private Sub ddVocabularyId_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddVocabularyId.SelectedIndexChanged
- Settings.VocabularyId = ddVocabularyId.SelectedValue.ToInt
- Settings.UpdateSettings()
- DataBind()
- End Sub
-
- Private Sub cmdCancel_Click(sender As Object, e As EventArgs) Handles cmdCancel.Click
- Response.Redirect(DotNetNuke.Common.NavigateURL(TabId), False)
- End Sub
-
- Private Sub cmdUpdateSettings_Click(sender As Object, e As EventArgs) Handles cmdUpdate.Click
- SaveChanges()
- Response.Redirect(DotNetNuke.Common.NavigateURL(TabId), False)
- End Sub
-
- Private Sub SaveChanges()
- Settings.AllowAttachments = chkAllowAttachments.Checked
- Settings.SummaryModel = CType(ddSummaryModel.SelectedValue.ToInt, SummaryType)
- Settings.AllowMultipleCategories = chkAllowMultipleCategories.Checked
- Settings.AllowWLW = chkAllowWLW.Checked
- Settings.WLWRecentPostsMax = txtWLWRecentPostsMax.Text.ToInt
- Settings.VocabularyId = ddVocabularyId.SelectedValue.ToInt
- Settings.ModifyPageDetails = chkModifyPageDetails.Checked
- Settings.AutoGenerateMissingSummary = chkAutoGenerateMissingSummary.Checked
- Settings.AutoGeneratedSummaryLength = Integer.Parse(txtAutoGeneratedSummaryLength.Text.Trim)
- Settings.FacebookAppId = txtFacebookAppId.Text.Trim
- Settings.FacebookProfileIdProperty = Integer.Parse(ddFacebookProfileIdProperty.SelectedValue)
- Settings.RssAllowContentInFeed = chkRssAllowContentInFeed.Checked
- Settings.RssDefaultCopyright = txtRssDefaultCopyright.Text
- Settings.RssDefaultNrItems = Integer.Parse(txtRssDefaultNrItems.Text)
- Settings.RssEmail = txtEmail.Text
- Settings.RssImageHeight = Integer.Parse(txtRssImageHeight.Text)
- Settings.RssImageWidth = Integer.Parse(txtRssImageWidth.Text)
- Settings.RssImageSizeAllowOverride = chkRssImageSizeAllowOverride.Checked
- Settings.RssMaxNrItems = Integer.Parse(txtRssMaxNrItems.Text)
- Settings.RssTtl = Integer.Parse(txtRssTtl.Text)
- Settings.IncrementViewCount = Integer.Parse(txtIncrementViewCount.Text)
-
- Settings.UpdateSettings()
- If treeState.Value <> Entities.Terms.TermsController.GetCategoryTreeAsJson(Categories) Then
- Dim categoryTree As List(Of DynatreeItem) = Newtonsoft.Json.JsonConvert.DeserializeObject(Of List(Of DynatreeItem))(treeState.Value)
- Dim ReturnedIds As New List(Of Integer)
- Dim i As Integer = 1
- For Each rootNode As DynatreeItem In categoryTree
- AddOrUpdateCategory(-1, i, rootNode, ReturnedIds)
- i += 1
- Next
- Dim deleteCategories As New List(Of Entities.Terms.TermInfo)
- For Each t As Entities.Terms.TermInfo In Categories.Values
- If Not ReturnedIds.Contains(t.TermId) Then deleteCategories.Add(t)
- Next
- For Each categoryToDelete As Entities.Terms.TermInfo In deleteCategories
- DotNetNuke.Entities.Content.Common.Util.GetTermController().DeleteTerm(categoryToDelete)
- Next
- Categories = Entities.Terms.TermsController.GetTermsByVocabulary(ModuleId, Settings.VocabularyId, BlogContext.Locale, True) ' clear the cache
- End If
- End Sub
-
- Private Sub AddOrUpdateCategory(parentId As Integer, viewOrder As Integer, category As DynatreeItem, ByRef returnedIds As List(Of Integer))
- If String.IsNullOrEmpty(category.title) Then Exit Sub
- Dim termId As Integer = -1
- If IsNumeric(category.key) Then termId = Integer.Parse(category.key)
- termId = Data.DataProvider.Instance.SetTerm(termId, Settings.VocabularyId, parentId, viewOrder, category.title, "", UserId)
- returnedIds.Add(termId)
- Dim i As Integer = 1
- For Each subCategory As DynatreeItem In category.children
- AddOrUpdateCategory(termId, i, subCategory, returnedIds)
- i += 1
- Next
- End Sub
-
- Public Overrides Sub DataBind()
- MyBase.DataBind()
-
- chkAllowAttachments.Checked = Settings.AllowAttachments
- Try
- ddSummaryModel.Items.FindByValue(CInt(Settings.SummaryModel).ToString).Selected = True
- Catch ex As Exception
- End Try
- cmdEditTagsML.Enabled = BlogContext.IsMultiLingualSite
- cmdEditCategoriesML.Enabled = BlogContext.IsMultiLingualSite And Settings.VocabularyId > -1
- chkAllowMultipleCategories.Checked = Settings.AllowMultipleCategories
- chkAllowWLW.Checked = Settings.AllowWLW
- chkModifyPageDetails.Checked = Settings.ModifyPageDetails
- chkAutoGenerateMissingSummary.Checked = Settings.AutoGenerateMissingSummary
- txtAutoGeneratedSummaryLength.Text = Settings.AutoGeneratedSummaryLength.ToString
- txtFacebookAppId.Text = Settings.FacebookAppId
- ddFacebookProfileIdProperty.DataSource = DotNetNuke.Entities.Profile.ProfileController.GetPropertyDefinitionsByPortal(PortalId, True, False)
- ddFacebookProfileIdProperty.DataBind()
- ddFacebookProfileIdProperty.Items.Insert(0, New ListItem(LocalizeString("NoneSpecified"), "-1"))
- Try
- ddFacebookProfileIdProperty.Items.FindByValue(Settings.FacebookProfileIdProperty.ToString).Selected = True
- Catch ex As Exception
- End Try
- chkRssAllowContentInFeed.Checked = Settings.RssAllowContentInFeed
- txtRssDefaultCopyright.Text = Settings.RssDefaultCopyright
- txtRssDefaultNrItems.Text = Settings.RssDefaultNrItems.ToString
- txtEmail.Text = Settings.RssEmail
- txtRssImageHeight.Text = Settings.RssImageHeight.ToString
- txtRssImageWidth.Text = Settings.RssImageWidth.ToString
- chkRssImageSizeAllowOverride.Checked = Settings.RssImageSizeAllowOverride
- txtRssMaxNrItems.Text = Settings.RssMaxNrItems.ToString
- txtRssTtl.Text = Settings.RssTtl.ToString
- txtIncrementViewCount.Text = Settings.IncrementViewCount.ToString
-
- txtWLWRecentPostsMax.Text = Settings.WLWRecentPostsMax.ToString
- ddVocabularyId.Items.Clear()
- ddVocabularyId.DataSource = GetPortalVocabularies(PortalId)
- ddVocabularyId.DataBind()
- ddVocabularyId.Items.Insert(0, New ListItem(LocalizeString("NoneSpecified"), "-1"))
- Try
- ddVocabularyId.Items.FindByValue(Settings.VocabularyId.ToString).Selected = True
- Catch ex As Exception
- End Try
-
- treeState.Value = Entities.Terms.TermsController.GetCategoryTreeAsJson(Categories)
-
- If Not DotNetNuke.Services.Localization.LocaleController.Instance.GetLocales(PortalId).Count > 1 Then
- cmdEditTagsML.Visible = False
- cmdEditCategoriesML.Visible = False
- End If
-
- End Sub
+ Inherits BlogModuleBase
+
+ Private _totalPosts As Integer = -1
+
+ Private Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
+ AddJavascriptFile("jquery.dynatree.min.js", "jquery.dynatree", "1.2.4", 60)
+ AddCssFile("dynatree.css", "dynatree", "1.2.4")
+ End Sub
+
+ Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
+
+ If Not BlogContext.Security.IsEditor Then
+ Throw New Exception("You do not have access to this resource. Please check your login status.")
+ End If
+
+ If Not IsPostBack Then
+ DataBind()
+ End If
+
+ UI.Utilities.ClientAPI.AddButtonConfirm(cmdEditTagsML, LocalizeString("LeavePage.Confirm"))
+ UI.Utilities.ClientAPI.AddButtonConfirm(cmdEditCategoriesML, LocalizeString("LeavePage.Confirm"))
+
+ End Sub
+
+ Private Sub cmdEditTagsML_Click(sender As Object, e As EventArgs) Handles cmdEditTagsML.Click
+ SaveChanges()
+ Response.Redirect(EditUrl("TermsEditML"), False)
+ End Sub
+
+ Private Sub cmdEditCategoriesML_Click(sender As Object, e As EventArgs) Handles cmdEditCategoriesML.Click
+ SaveChanges()
+ If Settings.VocabularyId > -1 Then
+ Response.Redirect(EditUrl("VocabularyId", Settings.VocabularyId.ToString, "TermsEditML"), False)
+ End If
+ End Sub
+
+ Private Sub cmdCreateVocabulary_Click(sender As Object, e As EventArgs) Handles cmdCreateVocabulary.Click
+ Settings.VocabularyId = Core.Integration.Integration.CreateNewVocabulary(PortalId).VocabularyId
+ Settings.UpdateSettings()
+ DataBind()
+ End Sub
+
+ Private Sub ddVocabularyId_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddVocabularyId.SelectedIndexChanged
+ Settings.VocabularyId = ddVocabularyId.SelectedValue.ToInt
+ Settings.UpdateSettings()
+ DataBind()
+ End Sub
+
+ Private Sub cmdCancel_Click(sender As Object, e As EventArgs) Handles cmdCancel.Click
+ Response.Redirect(DotNetNuke.Common.NavigateURL(TabId), False)
+ End Sub
+
+ Private Sub cmdUpdateSettings_Click(sender As Object, e As EventArgs) Handles cmdUpdate.Click
+ SaveChanges()
+ Response.Redirect(DotNetNuke.Common.NavigateURL(TabId), False)
+ End Sub
+
+ Private Sub SaveChanges()
+ Settings.AllowAttachments = chkAllowAttachments.Checked
+ Settings.SummaryModel = CType(ddSummaryModel.SelectedValue.ToInt, SummaryType)
+ Settings.AllowMultipleCategories = chkAllowMultipleCategories.Checked
+ Settings.AllowWLW = chkAllowWLW.Checked
+ Settings.WLWRecentPostsMax = txtWLWRecentPostsMax.Text.ToInt
+ Settings.VocabularyId = ddVocabularyId.SelectedValue.ToInt
+ Settings.ModifyPageDetails = chkModifyPageDetails.Checked
+ Settings.AutoGenerateMissingSummary = chkAutoGenerateMissingSummary.Checked
+ Settings.AutoGeneratedSummaryLength = Integer.Parse(txtAutoGeneratedSummaryLength.Text.Trim)
+ Settings.FacebookAppId = txtFacebookAppId.Text.Trim
+ Settings.FacebookProfileIdProperty = Integer.Parse(ddFacebookProfileIdProperty.SelectedValue)
+ Settings.RssAllowContentInFeed = chkRssAllowContentInFeed.Checked
+ Settings.RssDefaultCopyright = txtRssDefaultCopyright.Text
+ Settings.RssDefaultNrItems = Integer.Parse(txtRssDefaultNrItems.Text)
+ Settings.RssEmail = txtEmail.Text
+ Settings.RssImageHeight = Integer.Parse(txtRssImageHeight.Text)
+ Settings.RssImageWidth = Integer.Parse(txtRssImageWidth.Text)
+ Settings.RssImageSizeAllowOverride = chkRssImageSizeAllowOverride.Checked
+ Settings.RssMaxNrItems = Integer.Parse(txtRssMaxNrItems.Text)
+ Settings.RssTtl = Integer.Parse(txtRssTtl.Text)
+ Settings.IncrementViewCount = Integer.Parse(txtIncrementViewCount.Text)
+
+ Settings.UpdateSettings()
+ If treeState.Value <> TermsController.GetCategoryTreeAsJson(Categories) Then
+ Dim categoryTree As List(Of DynatreeItem) = Newtonsoft.Json.JsonConvert.DeserializeObject(Of List(Of DynatreeItem))(treeState.Value)
+ Dim ReturnedIds As New List(Of Integer)
+ Dim i As Integer = 1
+ For Each rootNode As DynatreeItem In categoryTree
+ AddOrUpdateCategory(-1, i, rootNode, ReturnedIds)
+ i += 1
+ Next
+ Dim deleteCategories As New List(Of TermInfo)
+ For Each t As TermInfo In Categories.Values
+ If Not ReturnedIds.Contains(t.TermId) Then deleteCategories.Add(t)
+ Next
+ For Each categoryToDelete As TermInfo In deleteCategories
+ DotNetNuke.Entities.Content.Common.Util.GetTermController().DeleteTerm(categoryToDelete)
+ Next
+ Categories = TermsController.GetTermsByVocabulary(ModuleId, Settings.VocabularyId, BlogContext.Locale, True) ' clear the cache
+ End If
+ End Sub
+
+ Private Sub AddOrUpdateCategory(parentId As Integer, viewOrder As Integer, category As DynatreeItem, ByRef returnedIds As List(Of Integer))
+ If String.IsNullOrEmpty(category.title) Then Exit Sub
+ Dim termId As Integer = -1
+ If IsNumeric(category.key) Then termId = Integer.Parse(category.key)
+ termId = DataProvider.Instance.SetTerm(termId, Settings.VocabularyId, parentId, viewOrder, category.title, "", UserId)
+ returnedIds.Add(termId)
+ Dim i As Integer = 1
+ For Each subCategory As DynatreeItem In category.children
+ AddOrUpdateCategory(termId, i, subCategory, returnedIds)
+ i += 1
+ Next
+ End Sub
+
+ Public Overrides Sub DataBind()
+ MyBase.DataBind()
+
+ chkAllowAttachments.Checked = Settings.AllowAttachments
+ Try
+ ddSummaryModel.Items.FindByValue(CInt(Settings.SummaryModel).ToString).Selected = True
+ Catch ex As Exception
+ End Try
+ cmdEditTagsML.Enabled = BlogContext.IsMultiLingualSite
+ cmdEditCategoriesML.Enabled = BlogContext.IsMultiLingualSite And Settings.VocabularyId > -1
+ chkAllowMultipleCategories.Checked = Settings.AllowMultipleCategories
+ chkAllowWLW.Checked = Settings.AllowWLW
+ chkModifyPageDetails.Checked = Settings.ModifyPageDetails
+ chkAutoGenerateMissingSummary.Checked = Settings.AutoGenerateMissingSummary
+ txtAutoGeneratedSummaryLength.Text = Settings.AutoGeneratedSummaryLength.ToString
+ txtFacebookAppId.Text = Settings.FacebookAppId
+ ddFacebookProfileIdProperty.DataSource = DotNetNuke.Entities.Profile.ProfileController.GetPropertyDefinitionsByPortal(PortalId, True, False)
+ ddFacebookProfileIdProperty.DataBind()
+ ddFacebookProfileIdProperty.Items.Insert(0, New ListItem(LocalizeString("NoneSpecified"), "-1"))
+ Try
+ ddFacebookProfileIdProperty.Items.FindByValue(Settings.FacebookProfileIdProperty.ToString).Selected = True
+ Catch ex As Exception
+ End Try
+ chkRssAllowContentInFeed.Checked = Settings.RssAllowContentInFeed
+ txtRssDefaultCopyright.Text = Settings.RssDefaultCopyright
+ txtRssDefaultNrItems.Text = Settings.RssDefaultNrItems.ToString
+ txtEmail.Text = Settings.RssEmail
+ txtRssImageHeight.Text = Settings.RssImageHeight.ToString
+ txtRssImageWidth.Text = Settings.RssImageWidth.ToString
+ chkRssImageSizeAllowOverride.Checked = Settings.RssImageSizeAllowOverride
+ txtRssMaxNrItems.Text = Settings.RssMaxNrItems.ToString
+ txtRssTtl.Text = Settings.RssTtl.ToString
+ txtIncrementViewCount.Text = Settings.IncrementViewCount.ToString
+
+ txtWLWRecentPostsMax.Text = Settings.WLWRecentPostsMax.ToString
+ ddVocabularyId.Items.Clear()
+ ddVocabularyId.DataSource = Globals.GetPortalVocabularies(PortalId)
+ ddVocabularyId.DataBind()
+ ddVocabularyId.Items.Insert(0, New ListItem(LocalizeString("NoneSpecified"), "-1"))
+ Try
+ ddVocabularyId.Items.FindByValue(Settings.VocabularyId.ToString).Selected = True
+ Catch ex As Exception
+ End Try
+
+ treeState.Value = TermsController.GetCategoryTreeAsJson(Categories)
+
+ If Not DotNetNuke.Services.Localization.LocaleController.Instance.GetLocales(PortalId).Count > 1 Then
+ cmdEditTagsML.Visible = False
+ cmdEditCategoriesML.Visible = False
+ End If
+
+ End Sub
End Class
\ No newline at end of file
diff --git a/Server/Blog/Blog.ascx b/Server/Blog/Blog.ascx
index d7fb8d57..5aee9d06 100644
--- a/Server/Blog/Blog.ascx
+++ b/Server/Blog/Blog.ascx
@@ -1,5 +1,5 @@
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Blog.ascx.vb" Inherits="DotNetNuke.Modules.Blog.Blog" %>
-<%@ Register TagPrefix="blog" Assembly="DotNetNuke.Modules.Blog" Namespace="DotNetNuke.Modules.Blog.Templating" %>
+<%@ Register TagPrefix="blog" Assembly="DotNetNuke.Modules.Blog.Core" Namespace="DotNetNuke.Modules.Blog.Core.Templating" %>
<%@ Register TagPrefix="blog" TagName="comments" Src="controls/Comments.ascx" %>
<%@ Register TagPrefix="blog" TagName="management" Src="controls/ManagementPanel.ascx" %>
diff --git a/Server/Blog/Blog.ascx.designer.vb b/Server/Blog/Blog.ascx.designer.vb
index 4e498dfc..06fccc24 100644
--- a/Server/Blog/Blog.ascx.designer.vb
+++ b/Server/Blog/Blog.ascx.designer.vb
@@ -31,21 +31,21 @@ Partial Public Class Blog
'''
Protected WithEvents ctlManagement As Global.DotNetNuke.Modules.Blog.Controls.ManagementPanel
- '''
- '''vtContents control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents vtContents As Global.DotNetNuke.Modules.Blog.Templating.ViewTemplate
+ '''
+ '''vtContents control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents vtContents As Global.DotNetNuke.Modules.Blog.Core.Templating.ViewTemplate
- '''
- '''ctlComments control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents ctlComments As Global.DotNetNuke.Modules.Blog.Controls.Comments
+ '''
+ '''ctlComments control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents ctlComments As Global.DotNetNuke.Modules.Blog.Controls.Comments
End Class
diff --git a/Server/Blog/Blog.ascx.vb b/Server/Blog/Blog.ascx.vb
index f43330d6..13c873c5 100644
--- a/Server/Blog/Blog.ascx.vb
+++ b/Server/Blog/Blog.ascx.vb
@@ -23,574 +23,574 @@ Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Services.Localization
Imports DotNetNuke.Entities.Modules.Actions
Imports DotNetNuke.Entities.Portals
-Imports DotNetNuke.Modules.Blog.Common.Globals
-Imports DotNetNuke.Modules.Blog.Templating
-Imports DotNetNuke.Modules.Blog.Entities.Blogs
-Imports DotNetNuke.Modules.Blog.Entities.Posts
-Imports DotNetNuke.Modules.Blog.Entities.Terms
-Imports DotNetNuke.Modules.Blog.Entities.Comments
+Imports DotNetNuke.Modules.Blog.Core.Common
+Imports DotNetNuke.Modules.Blog.Core.Entities.Posts
+Imports DotNetNuke.Modules.Blog.Core.Entities.Blogs
+Imports DotNetNuke.Modules.Blog.Core.Templating
+Imports DotNetNuke.Modules.Blog.Core.Entities.Terms
+Imports DotNetNuke.Modules.Blog.Core.Entities.Comments
Public Class Blog
- Inherits BlogModuleBase
- Implements IActionable
+ Inherits BlogModuleBase
+ Implements IActionable
#Region " Private Members "
- Private _urlParameters As New List(Of String)
- Private _pageSize As Integer = -1
- Private _totalRecords As Integer = 0
- Private _reqPage As Integer = 1
- Private _usePaging As Boolean = False
+ Private _urlParameters As New List(Of String)
+ Private _pageSize As Integer = -1
+ Private _totalRecords As Integer = 0
+ Private _reqPage As Integer = 1
+ Private _usePaging As Boolean = False
#End Region
#Region " Event Handlers "
- Private Sub Page_Init1(sender As Object, e As EventArgs) Handles Me.Init
- Integration.BlogModuleController.CheckupOnImportedFiles(ModuleId)
- ctlComments.ModuleConfiguration = ModuleConfiguration
- ctlComments.BlogContext = BlogContext
- ctlManagement.ModuleConfiguration = ModuleConfiguration
- ctlManagement.BlogContext = BlogContext
- End Sub
-
- Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
-
- ViewSettings.TemplateSettings.ReadValue("pagesize", _pageSize)
- Request.Params.ReadValue("Page", _reqPage)
-
- If Context.Items("BlogPageInitialized") Is Nothing Then
-
- ' wlw style detection post redirect?
- If Not String.IsNullOrEmpty(Settings.StyleDetectionUrl) And BlogContext.WLWRequest Then
- ' we have a style detection post in storage and it's being requested
- Dim url As String = Settings.StyleDetectionUrl
- Settings.StyleDetectionUrl = ""
- Settings.UpdateSettings()
- Response.Redirect(url, False)
- End If
-
- If BlogContext.ContentItemId = -1 AndAlso BlogContext.LegacyEntryId > -1 Then
- ' we have a legacy url
- Dim p As PostInfo = PostsController.GetPostByLegacyEntryId(BlogContext.LegacyEntryId, PortalId, BlogContext.Locale)
- If p IsNot Nothing Then
- Response.RedirectPermanent(p.PermaLink(PortalSettings), False)
- End If
- End If
-
- If Not IsPostBack And BlogContext.ContentItemId > -1 Then
- Dim viewCountTimeout As Integer = Settings.IncrementViewCount * 1000 'in milliseconds
- Dim scriptBlock As String = "(function ($, Sys) {$(document).ready(function () {setTimeout(function(){blogService.viewPost(" & BlogContext.BlogId.ToString & ", " & BlogContext.ContentItemId.ToString & ")}," & viewCountTimeout.ToString & ")});} (jQuery, window.Sys));"
- Page.ClientScript.RegisterClientScriptBlock([GetType], "PostViewScript", scriptBlock, True)
- End If
-
- AddWLWManifestLink()
-
- If Settings.ModifyPageDetails OrElse ViewSettings.ModifyPageDetails Then
- ' force modify on all modules orlse modify on selected modules only?
- If BlogContext.Post IsNot Nothing Then
- Page.Title = BlogContext.Post.LocalizedTitle
- Page.Description = DotNetNuke.Common.Utilities.HtmlUtils.Clean(BlogContext.Post.LocalizedSummary, False)
- Page.KeyWords = String.Join(",", BlogContext.Post.Terms.ToStringArray)
- 'AddOpenGraphMetaTags()
- ElseIf BlogContext.Blog IsNot Nothing Then
- Page.Title = BlogContext.Blog.LocalizedTitle
- Page.Description = DotNetNuke.Common.Utilities.HtmlUtils.Clean(BlogContext.Blog.LocalizedDescription, False)
- ElseIf BlogContext.Author IsNot Nothing Then
- Page.Title = BlogContext.Author.DisplayName
- Page.Description = DotNetNuke.Common.Utilities.HtmlUtils.Clean(BlogContext.Author.Profile.Biography, False)
- ElseIf BlogContext.Term IsNot Nothing Then
- Page.Title = BlogContext.Term.LocalizedName
- Page.Description = DotNetNuke.Common.Utilities.HtmlUtils.Clean(BlogContext.Term.LocalizedDescription, False)
- End If
-
- If _reqPage > 1 Then
- Page.Title = String.Format(Localization.GetString("PageTitle.Format", LocalResourceFile), Page.Title, _reqPage)
- End If
-
- End If
-
- If BlogContext.Post IsNot Nothing AndAlso BlogContext.Blog IsNot Nothing Then
- AddOpenGraphMetaTags()
- If ViewSettings.AddCanonicalTag Then
- AddCanonicalTag(True)
- End If
- If BlogContext.Blog.EnablePingBackReceive Then
- AddPingBackLink()
- End If
- If BlogContext.Blog.EnableTrackBackReceive Then
- AddTrackBackBlurb()
- End If
- Else
- AddCanonicalTag(False)
- End If
+ Private Sub Page_Init1(sender As Object, e As EventArgs) Handles Me.Init
+ Core.Integration.BlogModuleController.CheckupOnImportedFiles(ModuleId)
+ ctlComments.ModuleConfiguration = ModuleConfiguration
+ ctlComments.BlogContext = BlogContext
+ ctlManagement.ModuleConfiguration = ModuleConfiguration
+ ctlManagement.BlogContext = BlogContext
+ End Sub
+
+ Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
+
+ _pageSize = ViewSettings.TemplateSettings.ReadValue("pagesize", _pageSize)
+ _reqPage = Request.Params.ReadValue("Page", _reqPage)
+
+ If Context.Items("BlogPageInitialized") Is Nothing Then
+
+ ' wlw style detection post redirect?
+ If Not String.IsNullOrEmpty(Settings.StyleDetectionUrl) And BlogContext.WLWRequest Then
+ ' we have a style detection post in storage and it's being requested
+ Dim url As String = Settings.StyleDetectionUrl
+ Settings.StyleDetectionUrl = ""
+ Settings.UpdateSettings()
+ Response.Redirect(url, False)
+ End If
- Context.Items("BlogPageInitialized") = True
- End If
+ If BlogContext.ContentItemId = -1 AndAlso BlogContext.LegacyEntryId > -1 Then
+ ' we have a legacy url
+ Dim p As PostInfo = PostsController.GetPostByLegacyEntryId(BlogContext.LegacyEntryId, PortalId, BlogContext.Locale)
+ If p IsNot Nothing Then
+ Response.RedirectPermanent(p.PermaLink(PortalSettings), False)
+ End If
+ End If
- DataBind()
+ If Not IsPostBack And BlogContext.ContentItemId > -1 Then
+ Dim viewCountTimeout As Integer = Settings.IncrementViewCount * 1000 'in milliseconds
+ Dim scriptBlock As String = "(function ($, Sys) {$(document).ready(function () {setTimeout(function(){blogService.viewPost(" & BlogContext.BlogId.ToString & ", " & BlogContext.ContentItemId.ToString & ")}," & viewCountTimeout.ToString & ")});} (jQuery, window.Sys));"
+ Page.ClientScript.RegisterClientScriptBlock([GetType], "PostViewScript", scriptBlock, True)
+ End If
- End Sub
+ AddWLWManifestLink()
- Private Sub AddCanonicalTag(HasBlogContext As Boolean)
+ If Settings.ModifyPageDetails OrElse ViewSettings.ModifyPageDetails Then
+ ' force modify on all modules orlse modify on selected modules only?
If BlogContext.Post IsNot Nothing Then
- Page.Header.Controls.Add(New LiteralControl(String.Format("", BlogContext.Post.PermaLink)))
+ Page.Title = BlogContext.Post.LocalizedTitle
+ Page.Description = DotNetNuke.Common.Utilities.HtmlUtils.Clean(BlogContext.Post.LocalizedSummary, False)
+ Page.KeyWords = String.Join(",", BlogContext.Post.Terms.ToStringArray)
+ 'AddOpenGraphMetaTags()
ElseIf BlogContext.Blog IsNot Nothing Then
- Page.Header.Controls.Add(New LiteralControl(String.Format("", PortalSettings.Current.ActiveTab.FullUrl)))
+ Page.Title = BlogContext.Blog.LocalizedTitle
+ Page.Description = DotNetNuke.Common.Utilities.HtmlUtils.Clean(BlogContext.Blog.LocalizedDescription, False)
ElseIf BlogContext.Author IsNot Nothing Then
- Page.Header.Controls.Add(New LiteralControl(String.Format("", BlogContext.ModuleUrls.GetUrl(False, False, False, True, False))))
+ Page.Title = BlogContext.Author.DisplayName
+ Page.Description = DotNetNuke.Common.Utilities.HtmlUtils.Clean(BlogContext.Author.Profile.Biography, False)
ElseIf BlogContext.Term IsNot Nothing Then
- Page.Header.Controls.Add(New LiteralControl(String.Format("", BlogContext.Term.PermaLink(PortalSettings))))
- Else
- Page.Header.Controls.Add(New LiteralControl(String.Format("", PortalSettings.Current.ActiveTab.FullUrl)))
+ Page.Title = BlogContext.Term.LocalizedName
+ Page.Description = DotNetNuke.Common.Utilities.HtmlUtils.Clean(BlogContext.Term.LocalizedDescription, False)
End If
- If HasBlogContext Then
-
- ElseIf Not HasBlogContext And BlogContext.Term IsNot Nothing Then
- ElseIf Not HasBlogContext And BlogContext.Author IsNot Nothing Then
+ If _reqPage > 1 Then
+ Page.Title = String.Format(Localization.GetString("PageTitle.Format", LocalResourceFile), Page.Title, _reqPage)
+ End If
- Else
+ End If
+ If BlogContext.Post IsNot Nothing AndAlso BlogContext.Blog IsNot Nothing Then
+ AddOpenGraphMetaTags()
+ If ViewSettings.AddCanonicalTag Then
+ AddCanonicalTag(True)
+ End If
+ If BlogContext.Blog.EnablePingBackReceive Then
+ AddPingBackLink()
End If
- End Sub
+ If BlogContext.Blog.EnableTrackBackReceive Then
+ AddTrackBackBlurb()
+ End If
+ Else
+ AddCanonicalTag(False)
+ End If
+
+ Context.Items("BlogPageInitialized") = True
+ End If
+
+ DataBind()
+
+ End Sub
+
+ Private Sub AddCanonicalTag(HasBlogContext As Boolean)
+ If BlogContext.Post IsNot Nothing Then
+ Page.Header.Controls.Add(New LiteralControl(String.Format("", BlogContext.Post.PermaLink)))
+ ElseIf BlogContext.Blog IsNot Nothing Then
+ Page.Header.Controls.Add(New LiteralControl(String.Format("", PortalSettings.Current.ActiveTab.FullUrl)))
+ ElseIf BlogContext.Author IsNot Nothing Then
+ Page.Header.Controls.Add(New LiteralControl(String.Format("", BlogContext.ModuleUrls.GetUrl(False, False, False, True, False))))
+ ElseIf BlogContext.Term IsNot Nothing Then
+ Page.Header.Controls.Add(New LiteralControl(String.Format("", BlogContext.Term.PermaLink(PortalSettings))))
+ Else
+ Page.Header.Controls.Add(New LiteralControl(String.Format("", PortalSettings.Current.ActiveTab.FullUrl)))
+ End If
+ If HasBlogContext Then
+
+ ElseIf Not HasBlogContext And BlogContext.Term IsNot Nothing Then
+
+ ElseIf Not HasBlogContext And BlogContext.Author IsNot Nothing Then
+
+ Else
+
+ End If
+ End Sub
#End Region
#Region " Open Graph Meta Tags "
- Private Sub AddOpenGraphMetaTags()
- Dim URL As String = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host
+ Private Sub AddOpenGraphMetaTags()
+ Dim URL As String = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host
Page.Header.Controls.Add(New LiteralControl(String.Format("", BlogContext.Post.PermaLink)))
Page.Header.Controls.Add(New LiteralControl(String.Format("", BlogContext.Post.PermaLink)))
- Page.Header.Controls.Add(New LiteralControl(String.Format("", CleanStringForXmlAttribute(BlogContext.Post.LocalizedTitle))))
- Page.Header.Controls.Add(New LiteralControl(String.Format("", CleanStringForXmlAttribute(BlogContext.Post.LocalizedTitle))))
- Dim description As String = CleanStringForXmlAttribute(DotNetNuke.Common.Utilities.HtmlUtils.Clean(BlogContext.Post.LocalizedSummary, False))
- If (Not String.IsNullOrEmpty(description)) Then
+ Page.Header.Controls.Add(New LiteralControl(String.Format("", Globals.CleanStringForXmlAttribute(BlogContext.Post.LocalizedTitle))))
+ Page.Header.Controls.Add(New LiteralControl(String.Format("", Globals.CleanStringForXmlAttribute(BlogContext.Post.LocalizedTitle))))
+ Dim description As String = Globals.CleanStringForXmlAttribute(DotNetNuke.Common.Utilities.HtmlUtils.Clean(BlogContext.Post.LocalizedSummary, False))
+ If (Not String.IsNullOrEmpty(description)) Then
Page.Header.Controls.Add(New LiteralControl(String.Format("", description)))
Page.Header.Controls.Add(New LiteralControl(String.Format("", description)))
End If
- If Not String.IsNullOrEmpty(BlogContext.Post.Image) Then
- Dim strPath As String = String.Format("{0}?TabId={1}&ModuleId={2}&Blog={3}&Post={4}&w=1200&h=630&c=1&key={5}", glbImageHandlerPath, TabId.ToString, Settings.ModuleId.ToString, BlogContext.BlogId.ToString, BlogContext.ContentItemId.ToString, BlogContext.Post.Image)
+ If Not String.IsNullOrEmpty(BlogContext.Post.Image) Then
+ Dim strPath As String = String.Format("{0}?TabId={1}&ModuleId={2}&Blog={3}&Post={4}&w=1200&h=630&c=1&key={5}", Globals.glbImageHandlerPath, TabId.ToString, Settings.ModuleId.ToString, BlogContext.BlogId.ToString, BlogContext.ContentItemId.ToString, BlogContext.Post.Image)
Page.Header.Controls.Add(New LiteralControl(String.Format("", URL + ResolveUrl(strPath))))
Page.Header.Controls.Add(New LiteralControl(String.Format("", URL + ResolveUrl(strPath))))
Page.Header.Controls.Add(New LiteralControl(String.Format("")))
End If
- Page.Header.Controls.Add(New LiteralControl(String.Format("", CleanStringForXmlAttribute(PortalSettings.PortalName))))
- If Not String.IsNullOrEmpty(Settings.FacebookAppId) Then
- Page.Header.Controls.Add(New LiteralControl(String.Format("", Settings.FacebookAppId)))
- End If
- Page.Header.Controls.Add(New LiteralControl(String.Format("", "article")))
- If Not String.IsNullOrEmpty(BlogContext.Post.Locale) Then
- Page.Header.Controls.Add(New LiteralControl(String.Format("", BlogContext.Post.Locale.Replace("-", "_"))))
- ElseIf Not String.IsNullOrEmpty(BlogContext.Blog.Locale) Then
- Page.Header.Controls.Add(New LiteralControl(String.Format("", BlogContext.Blog.Locale.Replace("-", "_"))))
- Else
- Page.Header.Controls.Add(New LiteralControl(String.Format("", PortalSettings.DefaultLanguage.Replace("-", "_"))))
- End If
- Page.Header.Controls.Add(New LiteralControl(String.Format("", BlogContext.Post.LastModifiedOnDate.ToString("u"))))
- If Settings.FacebookProfileIdProperty <> -1 Then
- Dim author As DotNetNuke.Entities.Users.UserInfo = BlogContext.Author
- If author Is Nothing Then
- author = BlogContext.Post.CreatedByUser(PortalId)
- End If
- If author IsNot Nothing Then
- Dim pp As DotNetNuke.Entities.Profile.ProfilePropertyDefinition = author.Profile.ProfileProperties.GetById(Settings.FacebookProfileIdProperty)
- If pp IsNot Nothing AndAlso Not String.IsNullOrEmpty(pp.PropertyValue) Then
- Page.Header.Controls.Add(New LiteralControl(String.Format("", pp.PropertyValue)))
+ Page.Header.Controls.Add(New LiteralControl(String.Format("", Globals.CleanStringForXmlAttribute(PortalSettings.PortalName))))
+ If Not String.IsNullOrEmpty(Settings.FacebookAppId) Then
+ Page.Header.Controls.Add(New LiteralControl(String.Format("", Settings.FacebookAppId)))
End If
- End If
- End If
- End Sub
+ Page.Header.Controls.Add(New LiteralControl(String.Format("", "article")))
+ If Not String.IsNullOrEmpty(BlogContext.Post.Locale) Then
+ Page.Header.Controls.Add(New LiteralControl(String.Format("", BlogContext.Post.Locale.Replace("-", "_"))))
+ ElseIf Not String.IsNullOrEmpty(BlogContext.Blog.Locale) Then
+ Page.Header.Controls.Add(New LiteralControl(String.Format("", BlogContext.Blog.Locale.Replace("-", "_"))))
+ Else
+ Page.Header.Controls.Add(New LiteralControl(String.Format("", PortalSettings.DefaultLanguage.Replace("-", "_"))))
+ End If
+ Page.Header.Controls.Add(New LiteralControl(String.Format("", BlogContext.Post.LastModifiedOnDate.ToString("u"))))
+ If Settings.FacebookProfileIdProperty <> -1 Then
+ Dim author As DotNetNuke.Entities.Users.UserInfo = BlogContext.Author
+ If author Is Nothing Then
+ author = BlogContext.Post.CreatedByUser(PortalId)
+ End If
+ If author IsNot Nothing Then
+ Dim pp As DotNetNuke.Entities.Profile.ProfilePropertyDefinition = author.Profile.ProfileProperties.GetById(Settings.FacebookProfileIdProperty)
+ If pp IsNot Nothing AndAlso Not String.IsNullOrEmpty(pp.PropertyValue) Then
+ Page.Header.Controls.Add(New LiteralControl(String.Format("", pp.PropertyValue)))
+ End If
+ End If
+ End If
+ End Sub
#End Region
#Region " Public Methods "
- Private Sub AddWLWManifestLink()
- If Context.Items("WLWManifestLinkAdded") Is Nothing Then
- Dim link As New HtmlLink()
- link.Attributes.Add("rel", "wlwmanifest")
- link.Attributes.Add("type", "application/wlwmanifest+xml")
- If ViewSettings.BlogModuleId = -1 Then
- link.Attributes.Add("href", ResolveUrl(ManifestFilePath(TabId, ModuleId)))
- Else
- link.Attributes.Add("href", ResolveUrl(ManifestFilePath(TabId, ViewSettings.BlogModuleId)))
- End If
- Page.Header.Controls.Add(link)
- Context.Items("WLWManifestLinkAdded") = True
- End If
- End Sub
-
- Private Sub AddPingBackLink()
- If Context.Items("PingBackLinkAdded") Is Nothing Then
- Dim pingbackUrl As String = Services.BlogRouteMapper.GetRoute(Services.BlogRouteMapper.ServiceControllers.Comments, "Pingback")
- pingbackUrl &= String.Format("?tabId={0}&moduleId={1}&blogId={2}&postId={3}", TabId, BlogContext.BlogModuleId, BlogContext.BlogId, BlogContext.ContentItemId)
- Dim link As New HtmlGenericControl("link")
- link.Attributes.Add("rel", "pingback")
- link.Attributes.Add("href", pingbackUrl)
- Page.Header.Controls.Add(link)
- Context.Items("PingBackLinkAdded") = True
- End If
- End Sub
-
- Private Sub AddTrackBackBlurb()
- If Context.Items("TrackBackBlurbAdded") Is Nothing Then
- Dim trackbackUrl As String = Services.BlogRouteMapper.GetRoute(Services.BlogRouteMapper.ServiceControllers.Comments, "Trackback")
- trackbackUrl &= String.Format("?tabId={0}&moduleId={1}&blogId={2}&postId={3}", TabId, BlogContext.BlogModuleId, BlogContext.BlogId, BlogContext.ContentItemId)
- Dim postUrl As String = BlogContext.Post.PermaLink(PortalSettings)
- Dim sb As New StringBuilder
- sb.AppendLine("")
- litTrackback.Text = sb.ToString
- Context.Items("TrackBackBlurbAdded") = True
- End If
- End Sub
-#End Region
-
-#Region " Template Data Retrieval "
- Private Sub vtContents_GetData(ByVal DataSource As String, ByVal Parameters As Dictionary(Of String, String), ByRef Replacers As System.Collections.Generic.List(Of GenericTokenReplace), ByRef Arguments As System.Collections.Generic.List(Of String()), callingObject As Object) Handles vtContents.GetData
-
- Select Case DataSource.ToLower
-
- Case "blogs"
-
- Dim blogList As IEnumerable(Of BlogInfo) = BlogsController.GetBlogsByModule(BlogContext.BlogModuleId, UserId, BlogContext.Locale).Values.Where(Function(b) b.Published = True).OrderBy(Function(b) b.Title)
- Parameters.ReadValue("pagesize", _pageSize)
- If _pageSize > 0 Then
- _usePaging = True
- Dim startRec As Integer = ((_reqPage - 1) * _pageSize) + 1
- Dim endRec As Integer = _reqPage * _pageSize
- Dim i As Integer = 1
- For Each b As BlogInfo In blogList
- If i >= startRec And i <= endRec Then
- If BlogContext.ParentModule IsNot Nothing Then
- b.ParentTabID = BlogContext.ParentModule.TabID
- End If
- Replacers.Add(New BlogTokenReplace(Me, b))
- End If
- i += 1
- Next
- Else
- For Each b As BlogInfo In blogList
- If BlogContext.ParentModule IsNot Nothing Then
- b.ParentTabID = BlogContext.ParentModule.TabID
+ Private Sub AddWLWManifestLink()
+ If Context.Items("WLWManifestLinkAdded") Is Nothing Then
+ Dim link As New HtmlLink()
+ link.Attributes.Add("rel", "wlwmanifest")
+ link.Attributes.Add("type", "application/wlwmanifest+xml")
+ If ViewSettings.BlogModuleId = -1 Then
+ link.Attributes.Add("href", ResolveUrl(Globals.ManifestFilePath(TabId, ModuleId)))
+ Else
+ link.Attributes.Add("href", ResolveUrl(Globals.ManifestFilePath(TabId, ViewSettings.BlogModuleId)))
End If
- Replacers.Add(New BlogTokenReplace(Me, b))
- Next
+ Page.Header.Controls.Add(link)
+ Context.Items("WLWManifestLinkAdded") = True
End If
-
- Case "posts"
-
- Parameters.ReadValue("pagesize", _pageSize)
- EnsurePostList(_pageSize)
- For Each e As PostInfo In PostList
- If BlogContext.ParentModule IsNot Nothing Then
- e.ParentTabID = BlogContext.ParentModule.TabID
- End If
- Replacers.Add(New BlogTokenReplace(Me, e))
- Next
-
- Case "postspager"
-
- Parameters.ReadValue("pagesize", _pageSize)
- EnsurePostList(_pageSize)
- Dim pagerType As String = "allpages"
- Parameters.ReadValue("pagertype", pagerType)
- Dim remdr As Integer = 0
- Dim nrPages As Integer = Math.DivRem(_totalRecords, _pageSize, remdr)
- If remdr > 0 Then
- nrPages += 1
+ End Sub
+
+ Private Sub AddPingBackLink()
+ If Context.Items("PingBackLinkAdded") Is Nothing Then
+ Dim pingbackUrl As String = Api.BlogRouteMapper.GetRoute(Api.BlogRouteMapper.ServiceControllers.Comments, "Pingback")
+ pingbackUrl &= String.Format("?tabId={0}&moduleId={1}&blogId={2}&postId={3}", TabId, BlogContext.BlogModuleId, BlogContext.BlogId, BlogContext.ContentItemId)
+ Dim link As New HtmlGenericControl("link")
+ link.Attributes.Add("rel", "pingback")
+ link.Attributes.Add("href", pingbackUrl)
+ Page.Header.Controls.Add(link)
+ Context.Items("PingBackLinkAdded") = True
End If
- If nrPages < 2 Then
- Else
- Replacers.Add(New BlogTokenReplace(Me))
- Select Case pagerType.ToLower
- Case "allpages"
- For i As Integer = 1 To nrPages
- Dim s As String() = {"page=" & i.ToString, "pageiscurrent=" & CBool(i = _reqPage).ToString, "pagename=" & i.ToString, "pagetype=number"}
- Arguments.Add(s)
- Next
- Case "somepages"
- If _reqPage > 3 Then
- Dim s As String() = {"page=1", "pageiscurrent=False", "pagename=1", "pagetype=firstpage"}
- Arguments.Add(s)
- End If
- For i As Integer = Math.Max(_reqPage - 2, 1) To Math.Min(_reqPage + 2, nrPages)
- Dim s As String() = {"page=" & i.ToString, "pageiscurrent=" & CBool(i = _reqPage).ToString, "pagename=" & i.ToString, "pagetype=number"}
- Arguments.Add(s)
- Next
- If _reqPage < nrPages - 3 Then
- Dim s As String() = {"page=" & nrPages.ToString, "pageiscurrent=False", "pagename=" & nrPages.ToString, "pagetype=lastpage"}
- Arguments.Add(s)
- End If
- Case "newerolder"
- If _reqPage > 1 Then
- Dim s As String() = {"page=" & (_reqPage - 1).ToString, "pageiscurrent=False", "pagename=" & LocalizeString("Newer"), "pagetype=previous"}
- Arguments.Add(s)
- End If
- If _reqPage < nrPages Then
- Dim s As String() = {"page=" & (_reqPage + 1).ToString, "pageiscurrent=False", "pagename=" & LocalizeString("Older"), "pagetype=next"}
- Arguments.Add(s)
- End If
- End Select
+ End Sub
+
+ Private Sub AddTrackBackBlurb()
+ If Context.Items("TrackBackBlurbAdded") Is Nothing Then
+ Dim trackbackUrl As String = Api.BlogRouteMapper.GetRoute(Api.BlogRouteMapper.ServiceControllers.Comments, "Trackback")
+ trackbackUrl &= String.Format("?tabId={0}&moduleId={1}&blogId={2}&postId={3}", TabId, BlogContext.BlogModuleId, BlogContext.BlogId, BlogContext.ContentItemId)
+ Dim postUrl As String = BlogContext.Post.PermaLink(PortalSettings)
+ Dim sb As New StringBuilder
+ sb.AppendLine("")
+ litTrackback.Text = sb.ToString
+ Context.Items("TrackBackBlurbAdded") = True
End If
+ End Sub
+#End Region
- Case "terms"
+#Region " Template Data Retrieval "
+ Private Sub vtContents_GetData(ByVal DataSource As String, ByVal Parameters As Dictionary(Of String, String), ByRef Replacers As System.Collections.Generic.List(Of GenericTokenReplace), ByRef Arguments As System.Collections.Generic.List(Of String()), callingObject As Object) Handles vtContents.GetData
+
+ Select Case DataSource.ToLower
+
+ Case "blogs"
+
+ Dim blogList As IEnumerable(Of BlogInfo) = BlogsController.GetBlogsByModule(BlogContext.BlogModuleId, UserId, BlogContext.Locale).Values.Where(Function(b) b.Published = True).OrderBy(Function(b) b.Title)
+ _pageSize = Parameters.ReadValue("pagesize", _pageSize)
+ If _pageSize > 0 Then
+ _usePaging = True
+ Dim startRec As Integer = ((_reqPage - 1) * _pageSize) + 1
+ Dim endRec As Integer = _reqPage * _pageSize
+ Dim i As Integer = 1
+ For Each b As BlogInfo In blogList
+ If i >= startRec And i <= endRec Then
+ If BlogContext.ParentModule IsNot Nothing Then
+ b.ParentTabID = BlogContext.ParentModule.TabID
+ End If
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, b))
+ End If
+ i += 1
+ Next
+ Else
+ For Each b As BlogInfo In blogList
+ If BlogContext.ParentModule IsNot Nothing Then
+ b.ParentTabID = BlogContext.ParentModule.TabID
+ End If
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, b))
+ Next
+ End If
- If callingObject IsNot Nothing AndAlso TypeOf callingObject Is PostInfo Then
- For Each t As TermInfo In CType(callingObject, PostInfo).Terms
- Replacers.Add(New BlogTokenReplace(Me, BlogContext.Post, t))
- Next
- ElseIf BlogContext.Post IsNot Nothing Then
- For Each t As TermInfo In BlogContext.Post.Terms
- Replacers.Add(New BlogTokenReplace(Me, BlogContext.Post, t))
- Next
- Else
- For Each t As TermInfo In TermsController.GetTermsByModule(BlogContext.BlogModuleId, BlogContext.Locale)
- Replacers.Add(New BlogTokenReplace(Me, Nothing, t))
- Next
- End If
- _usePaging = False
+ Case "posts"
+
+ _pageSize = Parameters.ReadValue("pagesize", _pageSize)
+ EnsurePostList(_pageSize)
+ For Each e As PostInfo In PostList
+ If BlogContext.ParentModule IsNot Nothing Then
+ e.ParentTabID = BlogContext.ParentModule.TabID
+ End If
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, e))
+ Next
+
+ Case "postspager"
+
+ _pageSize = Parameters.ReadValue("pagesize", _pageSize)
+ EnsurePostList(_pageSize)
+ Dim pagerType As String = "allpages"
+ pagerType = Parameters.ReadValue("pagertype", pagerType)
+ Dim remdr As Integer = 0
+ Dim nrPages As Integer = Math.DivRem(_totalRecords, _pageSize, remdr)
+ If remdr > 0 Then
+ nrPages += 1
+ End If
+ If nrPages < 2 Then
+ Else
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings))
+ Select Case pagerType.ToLower
+ Case "allpages"
+ For i As Integer = 1 To nrPages
+ Dim s As String() = {"page=" & i.ToString, "pageiscurrent=" & CBool(i = _reqPage).ToString, "pagename=" & i.ToString, "pagetype=number"}
+ Arguments.Add(s)
+ Next
+ Case "somepages"
+ If _reqPage > 3 Then
+ Dim s As String() = {"page=1", "pageiscurrent=False", "pagename=1", "pagetype=firstpage"}
+ Arguments.Add(s)
+ End If
+ For i As Integer = Math.Max(_reqPage - 2, 1) To Math.Min(_reqPage + 2, nrPages)
+ Dim s As String() = {"page=" & i.ToString, "pageiscurrent=" & CBool(i = _reqPage).ToString, "pagename=" & i.ToString, "pagetype=number"}
+ Arguments.Add(s)
+ Next
+ If _reqPage < nrPages - 3 Then
+ Dim s As String() = {"page=" & nrPages.ToString, "pageiscurrent=False", "pagename=" & nrPages.ToString, "pagetype=lastpage"}
+ Arguments.Add(s)
+ End If
+ Case "newerolder"
+ If _reqPage > 1 Then
+ Dim s As String() = {"page=" & (_reqPage - 1).ToString, "pageiscurrent=False", "pagename=" & LocalizeString("Newer"), "pagetype=previous"}
+ Arguments.Add(s)
+ End If
+ If _reqPage < nrPages Then
+ Dim s As String() = {"page=" & (_reqPage + 1).ToString, "pageiscurrent=False", "pagename=" & LocalizeString("Older"), "pagetype=next"}
+ Arguments.Add(s)
+ End If
+ End Select
+ End If
- Case "allterms"
+ Case "terms"
- For Each t As TermInfo In TermsController.GetTermsByModule(BlogContext.BlogModuleId, BlogContext.Locale)
- Replacers.Add(New BlogTokenReplace(Me, Nothing, t))
- Next
- _usePaging = False
+ If callingObject IsNot Nothing AndAlso TypeOf callingObject Is PostInfo Then
+ For Each t As TermInfo In CType(callingObject, PostInfo).Terms
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, BlogContext.Post, t))
+ Next
+ ElseIf BlogContext.Post IsNot Nothing Then
+ For Each t As TermInfo In BlogContext.Post.Terms
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, BlogContext.Post, t))
+ Next
+ Else
+ For Each t As TermInfo In TermsController.GetTermsByModule(BlogContext.BlogModuleId, BlogContext.Locale)
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, Nothing, t))
+ Next
+ End If
+ _usePaging = False
- Case "keywords", "tags"
+ Case "allterms"
- If callingObject IsNot Nothing AndAlso TypeOf callingObject Is PostInfo Then
- For Each t As TermInfo In CType(callingObject, PostInfo).PostTags
- If BlogContext.ParentModule IsNot Nothing Then
- t.ParentTabID = BlogContext.ParentModule.TabID
- End If
- Replacers.Add(New BlogTokenReplace(Me, BlogContext.Post, t))
- Next
- ElseIf BlogContext.Post IsNot Nothing Then
- For Each t As TermInfo In BlogContext.Post.PostTags
- If BlogContext.ParentModule IsNot Nothing Then
- t.ParentTabID = BlogContext.ParentModule.TabID
- End If
- Replacers.Add(New BlogTokenReplace(Me, BlogContext.Post, t))
- Next
- Else
- For Each t As TermInfo In TermsController.GetTermsByModule(BlogContext.BlogModuleId, BlogContext.Locale).Where(Function(x) x.VocabularyId = 1).ToList
- If BlogContext.ParentModule IsNot Nothing Then
- t.ParentTabID = BlogContext.ParentModule.TabID
- End If
- Replacers.Add(New BlogTokenReplace(Me, Nothing, t))
- Next
- End If
- _usePaging = False
-
- Case "allkeywords", "alltags"
-
- For Each t As TermInfo In TermsController.GetTermsByModule(BlogContext.BlogModuleId, BlogContext.Locale).Where(Function(x) x.VocabularyId = 1).ToList
- If BlogContext.ParentModule IsNot Nothing Then
- t.ParentTabID = BlogContext.ParentModule.TabID
- End If
- Replacers.Add(New BlogTokenReplace(Me, Nothing, t))
- Next
- _usePaging = False
-
- Case "categories"
-
- If callingObject IsNot Nothing AndAlso TypeOf callingObject Is PostInfo Then
- For Each t As TermInfo In CType(callingObject, PostInfo).PostCategories
- Replacers.Add(New BlogTokenReplace(Me, BlogContext.Post, t))
- Next
- ElseIf BlogContext.Post IsNot Nothing Then
- For Each t As TermInfo In BlogContext.Post.PostCategories
- Replacers.Add(New BlogTokenReplace(Me, BlogContext.Post, t))
- Next
- ElseIf ViewSettings.Categories = "" Then
- For Each t As TermInfo In TermsController.GetTermsByModule(BlogContext.BlogModuleId, BlogContext.Locale).Where(Function(x) x.VocabularyId <> 1).ToList
- Replacers.Add(New BlogTokenReplace(Me, Nothing, t))
- Next
- Else
- For Each t As TermInfo In TermsController.GetTermsByModule(BlogContext.BlogModuleId, BlogContext.Locale).Where(Function(x) ViewSettings.CategoryList.Contains(x.VocabularyId)).ToList
- Replacers.Add(New BlogTokenReplace(Me, Nothing, t))
- Next
- End If
- _usePaging = False
-
- Case "allcategories"
-
- For Each t As TermInfo In TermsController.GetTermsByVocabulary(BlogContext.BlogModuleId, Settings.VocabularyId, BlogContext.Locale).Values
- If BlogContext.ParentModule IsNot Nothing Then
- t.ParentTabID = BlogContext.ParentModule.TabID
- End If
- Replacers.Add(New BlogTokenReplace(Me, Nothing, t))
- Next
- _usePaging = False
-
- Case "selectcategories"
-
- For Each t As TermInfo In TermsController.GetTermsByModule(BlogContext.BlogModuleId, BlogContext.Locale).Where(Function(x) ViewSettings.CategoryList.Contains(x.TermId)).ToList
- If BlogContext.ParentModule IsNot Nothing Then
- t.ParentTabID = BlogContext.ParentModule.TabID
- End If
- Replacers.Add(New BlogTokenReplace(Me, Nothing, t))
- Next
- _usePaging = False
-
- Case "comments"
-
- If callingObject IsNot Nothing AndAlso TypeOf callingObject Is PostInfo Then
- For Each c As CommentInfo In CommentsController.GetCommentsByContentItem(CType(callingObject, PostInfo).ContentItemId, False, UserId)
- Replacers.Add(New BlogTokenReplace(Me, BlogContext.Post, c))
- Next
- _usePaging = False
- ElseIf BlogContext.Post IsNot Nothing Then
- For Each c As CommentInfo In CommentsController.GetCommentsByContentItem(BlogContext.Post.ContentItemId, False, UserId)
- Replacers.Add(New BlogTokenReplace(Me, BlogContext.Post, c))
- Next
- _usePaging = False
- Else
- Parameters.ReadValue("pagesize", _pageSize)
- If _pageSize < 1 Then _pageSize = 10 ' we will not list "all Posts"
- For Each c As CommentInfo In CommentsController.GetCommentsByModule(BlogContext.BlogModuleId, UserId, _reqPage - 1, _pageSize, "CREATEDONDATE DESC", _totalRecords).Values
- Replacers.Add(New BlogTokenReplace(Me, BlogContext.Post, c))
- Next
- End If
+ For Each t As TermInfo In TermsController.GetTermsByModule(BlogContext.BlogModuleId, BlogContext.Locale)
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, Nothing, t))
+ Next
+ _usePaging = False
- Case "allcomments"
-
- Parameters.ReadValue("pagesize", _pageSize)
- Dim loadPosts As Boolean = False
- Parameters.ReadValue("loadposts", loadPosts)
- If _pageSize < 1 Then _pageSize = 10 ' we will not list "all Posts"
- For Each c As CommentInfo In CommentsController.GetCommentsByModule(BlogContext.BlogModuleId, UserId, _reqPage - 1, _pageSize, "CREATEDONDATE DESC", _totalRecords).Values
- If loadPosts Then
- Replacers.Add(New BlogTokenReplace(Me, PostsController.GetPost(c.ContentItemId, BlogContext.BlogModuleId, BlogContext.Locale), c))
- Else
- Replacers.Add(New BlogTokenReplace(Me, Nothing, c))
- End If
- Next
-
- Case "calendar", "blogcalendar"
-
- For Each bci As BlogCalendarInfo In BlogsController.GetBlogCalendar(BlogContext.BlogModuleId, BlogContext.BlogId, BlogContext.ShowLocale)
- If BlogContext.ParentModule IsNot Nothing Then
- bci.ParentTabID = BlogContext.ParentModule.TabID
- End If
- Replacers.Add(New BlogTokenReplace(Me, bci))
- Next
-
- Case "authors", "allauthors"
-
- Dim blogToShow As Integer = BlogContext.BlogId
- If DataSource.ToLower = "allauthors" Then blogToShow = -1
- Dim sort As String = ""
- Parameters.ReadValue("sort", sort)
- Select Case sort.ToLower
- Case "username"
- For Each u As PostAuthor In PostsController.GetAuthors(BlogContext.BlogModuleId, blogToShow).OrderBy(Function(t) t.Username)
- Replacers.Add(New BlogTokenReplace(Me, New LazyLoadingUser(u)))
- Next
- Case "email"
- For Each u As PostAuthor In PostsController.GetAuthors(BlogContext.BlogModuleId, blogToShow).OrderBy(Function(t) t.Email)
- Replacers.Add(New BlogTokenReplace(Me, New LazyLoadingUser(u)))
- Next
- Case "firstname"
- For Each u As PostAuthor In PostsController.GetAuthors(BlogContext.BlogModuleId, blogToShow).OrderBy(Function(t) t.FirstName)
- Replacers.Add(New BlogTokenReplace(Me, New LazyLoadingUser(u)))
- Next
- Case "displayname"
- For Each u As PostAuthor In PostsController.GetAuthors(BlogContext.BlogModuleId, blogToShow).OrderBy(Function(t) t.DisplayName)
- Replacers.Add(New BlogTokenReplace(Me, New LazyLoadingUser(u)))
- Next
- Case Else ' last name
- For Each u As PostAuthor In PostsController.GetAuthors(BlogContext.BlogModuleId, blogToShow)
- If BlogContext.ParentModule IsNot Nothing Then
- u.ParentTabID = BlogContext.ParentModule.TabID
- End If
- Replacers.Add(New BlogTokenReplace(Me, New LazyLoadingUser(u)))
- Next
- End Select
+ Case "keywords", "tags"
- End Select
+ If callingObject IsNot Nothing AndAlso TypeOf callingObject Is PostInfo Then
+ For Each t As TermInfo In CType(callingObject, PostInfo).PostTags
+ If BlogContext.ParentModule IsNot Nothing Then
+ t.ParentTabID = BlogContext.ParentModule.TabID
+ End If
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, BlogContext.Post, t))
+ Next
+ ElseIf BlogContext.Post IsNot Nothing Then
+ For Each t As TermInfo In BlogContext.Post.PostTags
+ If BlogContext.ParentModule IsNot Nothing Then
+ t.ParentTabID = BlogContext.ParentModule.TabID
+ End If
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, BlogContext.Post, t))
+ Next
+ Else
+ For Each t As TermInfo In TermsController.GetTermsByModule(BlogContext.BlogModuleId, BlogContext.Locale).Where(Function(x) x.VocabularyId = 1).ToList
+ If BlogContext.ParentModule IsNot Nothing Then
+ t.ParentTabID = BlogContext.ParentModule.TabID
+ End If
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, Nothing, t))
+ Next
+ End If
+ _usePaging = False
+
+ Case "allkeywords", "alltags"
+
+ For Each t As TermInfo In TermsController.GetTermsByModule(BlogContext.BlogModuleId, BlogContext.Locale).Where(Function(x) x.VocabularyId = 1).ToList
+ If BlogContext.ParentModule IsNot Nothing Then
+ t.ParentTabID = BlogContext.ParentModule.TabID
+ End If
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, Nothing, t))
+ Next
+ _usePaging = False
+
+ Case "categories"
+
+ If callingObject IsNot Nothing AndAlso TypeOf callingObject Is PostInfo Then
+ For Each t As TermInfo In CType(callingObject, PostInfo).PostCategories
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, BlogContext.Post, t))
+ Next
+ ElseIf BlogContext.Post IsNot Nothing Then
+ For Each t As TermInfo In BlogContext.Post.PostCategories
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, BlogContext.Post, t))
+ Next
+ ElseIf ViewSettings.Categories = "" Then
+ For Each t As TermInfo In TermsController.GetTermsByModule(BlogContext.BlogModuleId, BlogContext.Locale).Where(Function(x) x.VocabularyId <> 1).ToList
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, Nothing, t))
+ Next
+ Else
+ For Each t As TermInfo In TermsController.GetTermsByModule(BlogContext.BlogModuleId, BlogContext.Locale).Where(Function(x) ViewSettings.CategoryList.Contains(x.VocabularyId)).ToList
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, Nothing, t))
+ Next
+ End If
+ _usePaging = False
+
+ Case "allcategories"
+
+ For Each t As TermInfo In TermsController.GetTermsByVocabulary(BlogContext.BlogModuleId, Settings.VocabularyId, BlogContext.Locale).Values
+ If BlogContext.ParentModule IsNot Nothing Then
+ t.ParentTabID = BlogContext.ParentModule.TabID
+ End If
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, Nothing, t))
+ Next
+ _usePaging = False
+
+ Case "selectcategories"
+
+ For Each t As TermInfo In TermsController.GetTermsByModule(BlogContext.BlogModuleId, BlogContext.Locale).Where(Function(x) ViewSettings.CategoryList.Contains(x.TermId)).ToList
+ If BlogContext.ParentModule IsNot Nothing Then
+ t.ParentTabID = BlogContext.ParentModule.TabID
+ End If
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, Nothing, t))
+ Next
+ _usePaging = False
+
+ Case "comments"
+
+ If callingObject IsNot Nothing AndAlso TypeOf callingObject Is PostInfo Then
+ For Each c As CommentInfo In CommentsController.GetCommentsByContentItem(CType(callingObject, PostInfo).ContentItemId, False, UserId)
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, BlogContext.Post, c))
+ Next
+ _usePaging = False
+ ElseIf BlogContext.Post IsNot Nothing Then
+ For Each c As CommentInfo In CommentsController.GetCommentsByContentItem(BlogContext.Post.ContentItemId, False, UserId)
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, BlogContext.Post, c))
+ Next
+ _usePaging = False
+ Else
+ _pageSize = Parameters.ReadValue("pagesize", _pageSize)
+ If _pageSize < 1 Then _pageSize = 10 ' we will not list "all Posts"
+ For Each c As CommentInfo In CommentsController.GetCommentsByModule(BlogContext.BlogModuleId, UserId, _reqPage - 1, _pageSize, "CREATEDONDATE DESC", _totalRecords).Values
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, BlogContext.Post, c))
+ Next
+ End If
+
+ Case "allcomments"
+
+ _pageSize = Parameters.ReadValue("pagesize", _pageSize)
+ Dim loadPosts As Boolean = False
+ loadPosts = Parameters.ReadValue("loadposts", loadPosts)
+ If _pageSize < 1 Then _pageSize = 10 ' we will not list "all Posts"
+ For Each c As CommentInfo In CommentsController.GetCommentsByModule(BlogContext.BlogModuleId, UserId, _reqPage - 1, _pageSize, "CREATEDONDATE DESC", _totalRecords).Values
+ If loadPosts Then
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, PostsController.GetPost(c.ContentItemId, BlogContext.BlogModuleId, BlogContext.Locale), c))
+ Else
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, Nothing, c))
+ End If
+ Next
+
+ Case "calendar", "blogcalendar"
+
+ For Each bci As BlogCalendarInfo In BlogsController.GetBlogCalendar(BlogContext.BlogModuleId, BlogContext.BlogId, BlogContext.ShowLocale)
+ If BlogContext.ParentModule IsNot Nothing Then
+ bci.ParentTabID = BlogContext.ParentModule.TabID
+ End If
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, bci))
+ Next
+
+ Case "authors", "allauthors"
+
+ Dim blogToShow As Integer = BlogContext.BlogId
+ If DataSource.ToLower = "allauthors" Then blogToShow = -1
+ Dim sort As String = ""
+ sort = Parameters.ReadValue("sort", sort)
+ Select Case sort.ToLower
+ Case "username"
+ For Each u As PostAuthor In PostsController.GetAuthors(BlogContext.BlogModuleId, blogToShow).OrderBy(Function(t) t.Username)
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, New LazyLoadingUser(u)))
+ Next
+ Case "email"
+ For Each u As PostAuthor In PostsController.GetAuthors(BlogContext.BlogModuleId, blogToShow).OrderBy(Function(t) t.Email)
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, New LazyLoadingUser(u)))
+ Next
+ Case "firstname"
+ For Each u As PostAuthor In PostsController.GetAuthors(BlogContext.BlogModuleId, blogToShow).OrderBy(Function(t) t.FirstName)
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, New LazyLoadingUser(u)))
+ Next
+ Case "displayname"
+ For Each u As PostAuthor In PostsController.GetAuthors(BlogContext.BlogModuleId, blogToShow).OrderBy(Function(t) t.DisplayName)
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, New LazyLoadingUser(u)))
+ Next
+ Case Else ' last name
+ For Each u As PostAuthor In PostsController.GetAuthors(BlogContext.BlogModuleId, blogToShow)
+ If BlogContext.ParentModule IsNot Nothing Then
+ u.ParentTabID = BlogContext.ParentModule.TabID
+ End If
+ Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, New LazyLoadingUser(u)))
+ Next
+ End Select
- End Sub
+ End Select
+
+ End Sub
#End Region
#Region " Post List Stuff "
- Private Property PostList As IEnumerable(Of PostInfo) = Nothing
- Private Sub EnsurePostList(pageSize As Integer)
-
- If PostList Is Nothing Then
- If pageSize < 1 Then pageSize = 10 ' we will not list "all Posts"
- Dim publishValue As Integer = 1
- If Not String.IsNullOrEmpty(BlogContext.SearchString) Then
- If BlogContext.SearchUnpublished Then publishValue = -1
- If String.IsNullOrEmpty(BlogContext.Categories) Then
- If BlogContext.Term Is Nothing Then
- PostList = PostsController.SearchPosts(Settings.ModuleId, BlogContext.BlogId, BlogContext.Locale, BlogContext.SearchString, BlogContext.SearchTitle, BlogContext.SearchContents, publishValue, BlogContext.ShowLocale, BlogContext.EndDate, -1, _reqPage - 1, pageSize, "PUBLISHEDONDATE DESC", _totalRecords, UserId, BlogContext.Security.UserIsAdmin).Values
- Else
- PostList = PostsController.SearchPostsByTerm(Settings.ModuleId, BlogContext.BlogId, BlogContext.Locale, BlogContext.TermId, BlogContext.SearchString, BlogContext.SearchTitle, BlogContext.SearchContents, publishValue, BlogContext.ShowLocale, BlogContext.EndDate, -1, _reqPage - 1, pageSize, "PUBLISHEDONDATE DESC", _totalRecords, UserId, BlogContext.Security.UserIsAdmin).Values
- End If
- Else
- PostList = PostsController.SearchPostsByCategory(Settings.ModuleId, BlogContext.BlogId, BlogContext.Locale, BlogContext.Categories, BlogContext.SearchString, BlogContext.SearchTitle, BlogContext.SearchContents, publishValue, BlogContext.ShowLocale, BlogContext.EndDate, -1, _reqPage - 1, pageSize, "PUBLISHEDONDATE DESC", _totalRecords, UserId, BlogContext.Security.UserIsAdmin).Values
- End If
- ElseIf String.IsNullOrEmpty(BlogContext.Categories) Then
- publishValue = -1
- If ViewSettings.HideUnpublishedBlogsViewMode AndAlso PortalSettings.UserMode = PortalSettings.Mode.View Then publishValue = 1
- If ViewSettings.HideUnpublishedBlogsEditMode AndAlso PortalSettings.UserMode = PortalSettings.Mode.Edit Then publishValue = 1
- If BlogContext.Term Is Nothing Then
- PostList = PostsController.GetPosts(Settings.ModuleId, BlogContext.BlogId, BlogContext.Locale, publishValue, BlogContext.ShowLocale, BlogContext.EndDate, BlogContext.AuthorId, False, _reqPage - 1, pageSize, "PUBLISHEDONDATE DESC", _totalRecords, UserId, BlogContext.Security.UserIsAdmin).Values
- Else
- PostList = PostsController.GetPostsByTerm(Settings.ModuleId, BlogContext.BlogId, BlogContext.Locale, BlogContext.TermId, publishValue, BlogContext.ShowLocale, BlogContext.EndDate, BlogContext.AuthorId, _reqPage - 1, pageSize, "PUBLISHEDONDATE DESC", _totalRecords, UserId, BlogContext.Security.UserIsAdmin).Values
+ Private Property PostList As IEnumerable(Of PostInfo) = Nothing
+ Private Sub EnsurePostList(pageSize As Integer)
+
+ If PostList Is Nothing Then
+ If pageSize < 1 Then pageSize = 10 ' we will not list "all Posts"
+ Dim publishValue As Integer = 1
+ If Not String.IsNullOrEmpty(BlogContext.SearchString) Then
+ If BlogContext.SearchUnpublished Then publishValue = -1
+ If String.IsNullOrEmpty(BlogContext.Categories) Then
+ If BlogContext.Term Is Nothing Then
+ PostList = PostsController.SearchPosts(Settings.ModuleId, BlogContext.BlogId, BlogContext.Locale, BlogContext.SearchString, BlogContext.SearchTitle, BlogContext.SearchContents, publishValue, BlogContext.ShowLocale, BlogContext.EndDate, -1, _reqPage - 1, pageSize, "PUBLISHEDONDATE DESC", _totalRecords, UserId, BlogContext.Security.UserIsAdmin).Values
+ Else
+ PostList = PostsController.SearchPostsByTerm(Settings.ModuleId, BlogContext.BlogId, BlogContext.Locale, BlogContext.TermId, BlogContext.SearchString, BlogContext.SearchTitle, BlogContext.SearchContents, publishValue, BlogContext.ShowLocale, BlogContext.EndDate, -1, _reqPage - 1, pageSize, "PUBLISHEDONDATE DESC", _totalRecords, UserId, BlogContext.Security.UserIsAdmin).Values
+ End If
+ Else
+ PostList = PostsController.SearchPostsByCategory(Settings.ModuleId, BlogContext.BlogId, BlogContext.Locale, BlogContext.Categories, BlogContext.SearchString, BlogContext.SearchTitle, BlogContext.SearchContents, publishValue, BlogContext.ShowLocale, BlogContext.EndDate, -1, _reqPage - 1, pageSize, "PUBLISHEDONDATE DESC", _totalRecords, UserId, BlogContext.Security.UserIsAdmin).Values
+ End If
+ ElseIf String.IsNullOrEmpty(BlogContext.Categories) Then
+ publishValue = -1
+ If ViewSettings.HideUnpublishedBlogsViewMode AndAlso PortalSettings.UserMode = PortalSettings.Mode.View Then publishValue = 1
+ If ViewSettings.HideUnpublishedBlogsEditMode AndAlso PortalSettings.UserMode = PortalSettings.Mode.Edit Then publishValue = 1
+ If BlogContext.Term Is Nothing Then
+ PostList = PostsController.GetPosts(Settings.ModuleId, BlogContext.BlogId, BlogContext.Locale, publishValue, BlogContext.ShowLocale, BlogContext.EndDate, BlogContext.AuthorId, False, _reqPage - 1, pageSize, "PUBLISHEDONDATE DESC", _totalRecords, UserId, BlogContext.Security.UserIsAdmin).Values
+ Else
+ PostList = PostsController.GetPostsByTerm(Settings.ModuleId, BlogContext.BlogId, BlogContext.Locale, BlogContext.TermId, publishValue, BlogContext.ShowLocale, BlogContext.EndDate, BlogContext.AuthorId, _reqPage - 1, pageSize, "PUBLISHEDONDATE DESC", _totalRecords, UserId, BlogContext.Security.UserIsAdmin).Values
+ End If
+ Else
+ publishValue = -1
+ If ViewSettings.HideUnpublishedBlogsViewMode AndAlso PortalSettings.UserMode = PortalSettings.Mode.View Then publishValue = 1
+ If ViewSettings.HideUnpublishedBlogsEditMode AndAlso PortalSettings.UserMode = PortalSettings.Mode.Edit Then publishValue = 1
+ PostList = PostsController.GetPostsByCategory(Settings.ModuleId, BlogContext.BlogId, BlogContext.Locale, BlogContext.Categories, publishValue, BlogContext.ShowLocale, BlogContext.EndDate, BlogContext.AuthorId, _reqPage - 1, pageSize, "PUBLISHEDONDATE DESC", _totalRecords, UserId, BlogContext.Security.UserIsAdmin).Values
+ End If
+ _usePaging = True
End If
- Else
- publishValue = -1
- If ViewSettings.HideUnpublishedBlogsViewMode AndAlso PortalSettings.UserMode = PortalSettings.Mode.View Then publishValue = 1
- If ViewSettings.HideUnpublishedBlogsEditMode AndAlso PortalSettings.UserMode = PortalSettings.Mode.Edit Then publishValue = 1
- PostList = PostsController.GetPostsByCategory(Settings.ModuleId, BlogContext.BlogId, BlogContext.Locale, BlogContext.Categories, publishValue, BlogContext.ShowLocale, BlogContext.EndDate, BlogContext.AuthorId, _reqPage - 1, pageSize, "PUBLISHEDONDATE DESC", _totalRecords, UserId, BlogContext.Security.UserIsAdmin).Values
- End If
- _usePaging = True
- End If
- End Sub
+ End Sub
#End Region
#Region " Overrides "
- Public Overrides Sub DataBind()
-
- Dim tmgr As New TemplateManager(PortalSettings, ViewSettings.Template)
- With vtContents
- .TemplatePath = tmgr.TemplatePath
- .TemplateRelPath = tmgr.TemplateRelPath
- .TemplateMapPath = tmgr.TemplateMapPath
- .DefaultReplacer = New BlogTokenReplace(Me)
- End With
- vtContents.DataBind()
-
- ctlComments.Visible = ViewSettings.AllowComments AndAlso BlogContext.Security.CanViewComments
- ctlManagement.Visible = CBool(ViewSettings.BlogModuleId = -1) OrElse ViewSettings.ShowManagementPanel
-
- If PortalSettings.UserMode = PortalSettings.Mode.View AndAlso ViewSettings.ShowManagementPanelViewMode = False Then
- ctlManagement.Visible = False
- End If
+ Public Overrides Sub DataBind()
+
+ Dim tmgr As New TemplateManager(PortalSettings, ViewSettings.Template)
+ With vtContents
+ .TemplatePath = tmgr.TemplatePath
+ .TemplateRelPath = tmgr.TemplateRelPath
+ .TemplateMapPath = tmgr.TemplateMapPath
+ .DefaultReplacer = New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings)
+ End With
+ vtContents.DataBind()
+
+ ctlComments.Visible = ViewSettings.AllowComments AndAlso BlogContext.Security.CanViewComments
+ ctlManagement.Visible = CBool(ViewSettings.BlogModuleId = -1) OrElse ViewSettings.ShowManagementPanel
+
+ If PortalSettings.UserMode = PortalSettings.Mode.View AndAlso ViewSettings.ShowManagementPanelViewMode = False Then
+ ctlManagement.Visible = False
+ End If
- End Sub
+ End Sub
#End Region
#Region " IActionable "
- Public ReadOnly Property ModuleActions As Actions.ModuleActionCollection Implements IActionable.ModuleActions
- Get
- Dim MyActions As New Actions.ModuleActionCollection
- If IsEditable Or BlogContext.Security.IsBlogger Then
- MyActions.Add(GetNextActionID, Localization.GetString(ModuleActionType.EditContent, LocalResourceFile), ModuleActionType.EditContent, "", "", EditUrl("Manage"), False, DotNetNuke.Security.SecurityAccessLevel.View, True, False)
- End If
- If IsEditable Then
- MyActions.Add(GetNextActionID, LocalizeString("TemplateSettings"), ModuleActionType.EditContent, "", "", EditUrl("TemplateSettings"), False, DotNetNuke.Security.SecurityAccessLevel.Edit, True, False)
- End If
- Return MyActions
- End Get
- End Property
+ Public ReadOnly Property ModuleActions As Actions.ModuleActionCollection Implements IActionable.ModuleActions
+ Get
+ Dim MyActions As New Actions.ModuleActionCollection
+ If IsEditable Or BlogContext.Security.IsBlogger Then
+ MyActions.Add(GetNextActionID, Localization.GetString(ModuleActionType.EditContent, LocalResourceFile), ModuleActionType.EditContent, "", "", EditUrl("Manage"), False, DotNetNuke.Security.SecurityAccessLevel.View, True, False)
+ End If
+ If IsEditable Then
+ MyActions.Add(GetNextActionID, LocalizeString("TemplateSettings"), ModuleActionType.EditContent, "", "", EditUrl("TemplateSettings"), False, DotNetNuke.Security.SecurityAccessLevel.Edit, True, False)
+ End If
+ Return MyActions
+ End Get
+ End Property
#End Region
End Class
diff --git a/Server/Blog/BlogEdit.ascx b/Server/Blog/BlogEdit.ascx
index 6b5fe7eb..cc5ac693 100644
--- a/Server/Blog/BlogEdit.ascx
+++ b/Server/Blog/BlogEdit.ascx
@@ -1,7 +1,8 @@
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="BlogEdit.ascx.vb" Inherits="DotNetNuke.Modules.Blog.BlogEdit" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
-<%@ Register TagPrefix="blog" Namespace="DotNetNuke.Modules.Blog.Security.Controls" Assembly="DotNetNuke.Modules.Blog" %>
+<%@ Register TagPrefix="blog" Namespace="DotNetNuke.Modules.Blog.Core.Security.Controls" Assembly="DotNetNuke.Modules.Blog.Core" %>
<%@ Register TagPrefix="blog" Namespace="DotNetNuke.Modules.Blog.Controls" Assembly="DotNetNuke.Modules.Blog" %>
+
diff --git a/Server/Blog/BlogEdit.ascx.designer.vb b/Server/Blog/BlogEdit.ascx.designer.vb
index 3754cab2..619abaa8 100644
--- a/Server/Blog/BlogEdit.ascx.designer.vb
+++ b/Server/Blog/BlogEdit.ascx.designer.vb
@@ -13,390 +13,390 @@ Option Explicit On
Partial Public Class BlogEdit
- '''
- '''lblTitle control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents lblTitle As Global.System.Web.UI.UserControl
-
- '''
- '''txtTitle control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents txtTitle As Global.DotNetNuke.Modules.Blog.Controls.ShortTextEdit
-
- '''
- '''lblDescription control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents lblDescription As Global.System.Web.UI.UserControl
-
- '''
- '''txtDescription control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents txtDescription As Global.DotNetNuke.Modules.Blog.Controls.LongTextEdit
-
- '''
- '''rowLocale control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents rowLocale As Global.System.Web.UI.HtmlControls.HtmlGenericControl
-
- '''
- '''lblLocale control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents lblLocale As Global.System.Web.UI.UserControl
-
- '''
- '''ddLocale control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents ddLocale As Global.System.Web.UI.WebControls.DropDownList
-
- '''
- '''rowFullLocalization control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents rowFullLocalization As Global.System.Web.UI.HtmlControls.HtmlGenericControl
-
- '''
- '''lblFullLocalization control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents lblFullLocalization As Global.System.Web.UI.UserControl
-
- '''
- '''chkFullLocalization control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents chkFullLocalization As Global.System.Web.UI.WebControls.CheckBox
-
- '''
- '''lblImage control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents lblImage As Global.System.Web.UI.UserControl
-
- '''
- '''imgBlogImage control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents imgBlogImage As Global.System.Web.UI.WebControls.Image
-
- '''
- '''fileImage control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents fileImage As Global.System.Web.UI.WebControls.FileUpload
-
- '''
- '''cmdImageRemove control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents cmdImageRemove As Global.System.Web.UI.WebControls.LinkButton
-
- '''
- '''lblPublic control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents lblPublic As Global.System.Web.UI.UserControl
-
- '''
- '''chkPublic control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents chkPublic As Global.System.Web.UI.WebControls.CheckBox
-
- '''
- '''lblSyndicate control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents lblSyndicate As Global.System.Web.UI.UserControl
-
- '''
- '''chkSyndicate control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents chkSyndicate As Global.System.Web.UI.WebControls.CheckBox
-
- '''
- '''lblSyndicationEmail control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents lblSyndicationEmail As Global.System.Web.UI.UserControl
-
- '''
- '''txtSyndicationEmail control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents txtSyndicationEmail As Global.System.Web.UI.WebControls.TextBox
-
- '''
- '''lblCopyright control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents lblCopyright As Global.System.Web.UI.UserControl
-
- '''
- '''txtCopyright control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents txtCopyright As Global.System.Web.UI.WebControls.TextBox
-
- '''
- '''lblIncludeImagesInFeed control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents lblIncludeImagesInFeed As Global.System.Web.UI.UserControl
-
- '''
- '''chkIncludeImagesInFeed control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents chkIncludeImagesInFeed As Global.System.Web.UI.WebControls.CheckBox
-
- '''
- '''lblIncludeAuthorInFeed control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents lblIncludeAuthorInFeed As Global.System.Web.UI.UserControl
-
- '''
- '''chkIncludeAuthorInFeed control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents chkIncludeAuthorInFeed As Global.System.Web.UI.WebControls.CheckBox
-
- '''
- '''lblPingbacks control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents lblPingbacks As Global.System.Web.UI.UserControl
-
- '''
- '''chkEnablePingBackSend control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents chkEnablePingBackSend As Global.System.Web.UI.WebControls.CheckBox
-
- '''
- '''chkEnablePingBackReceive control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents chkEnablePingBackReceive As Global.System.Web.UI.WebControls.CheckBox
-
- '''
- '''chkAutoApprovePingBack control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents chkAutoApprovePingBack As Global.System.Web.UI.WebControls.CheckBox
-
- '''
- '''lblTrackbacks control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents lblTrackbacks As Global.System.Web.UI.UserControl
-
- '''
- '''chkEnableTrackBackSend control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents chkEnableTrackBackSend As Global.System.Web.UI.WebControls.CheckBox
-
- '''
- '''chkEnableTrackBackReceive control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents chkEnableTrackBackReceive As Global.System.Web.UI.WebControls.CheckBox
-
- '''
- '''chkAutoApproveTrackBack control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents chkAutoApproveTrackBack As Global.System.Web.UI.WebControls.CheckBox
-
- '''
- '''lblMustApproveGhostPosts control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents lblMustApproveGhostPosts As Global.System.Web.UI.UserControl
-
- '''
- '''chkMustApproveGhostPosts control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents chkMustApproveGhostPosts As Global.System.Web.UI.WebControls.CheckBox
-
- '''
- '''lblPublishAsOwner control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents lblPublishAsOwner As Global.System.Web.UI.UserControl
-
- '''
- '''chkPublishAsOwner control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents chkPublishAsOwner As Global.System.Web.UI.WebControls.CheckBox
-
- '''
- '''lblPermissions control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents lblPermissions As Global.System.Web.UI.UserControl
-
- '''
- '''ctlPermissions control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents ctlPermissions As Global.DotNetNuke.Modules.Blog.Security.Controls.BlogPermissionsGrid
-
- '''
- '''cmdUpdate control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents cmdUpdate As Global.System.Web.UI.WebControls.LinkButton
-
- '''
- '''hlCancel control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents hlCancel As Global.System.Web.UI.WebControls.HyperLink
-
- '''
- '''cmdDelete control.
- '''
- '''
- '''Auto-generated field.
- '''To modify move field declaration from designer file to code-behind file.
- '''
- Protected WithEvents cmdDelete As Global.System.Web.UI.WebControls.LinkButton
+ '''
+ '''lblTitle control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblTitle As Global.System.Web.UI.UserControl
+
+ '''
+ '''txtTitle control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents txtTitle As Global.DotNetNuke.Modules.Blog.Controls.ShortTextEdit
+
+ '''
+ '''lblDescription control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblDescription As Global.System.Web.UI.UserControl
+
+ '''
+ '''txtDescription control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents txtDescription As Global.DotNetNuke.Modules.Blog.Controls.LongTextEdit
+
+ '''
+ '''rowLocale control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents rowLocale As Global.System.Web.UI.HtmlControls.HtmlGenericControl
+
+ '''
+ '''lblLocale control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblLocale As Global.System.Web.UI.UserControl
+
+ '''
+ '''ddLocale control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents ddLocale As Global.System.Web.UI.WebControls.DropDownList
+
+ '''
+ '''rowFullLocalization control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents rowFullLocalization As Global.System.Web.UI.HtmlControls.HtmlGenericControl
+
+ '''
+ '''lblFullLocalization control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblFullLocalization As Global.System.Web.UI.UserControl
+
+ '''
+ '''chkFullLocalization control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents chkFullLocalization As Global.System.Web.UI.WebControls.CheckBox
+
+ '''
+ '''lblImage control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblImage As Global.System.Web.UI.UserControl
+
+ '''
+ '''imgBlogImage control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents imgBlogImage As Global.System.Web.UI.WebControls.Image
+
+ '''
+ '''fileImage control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents fileImage As Global.System.Web.UI.WebControls.FileUpload
+
+ '''
+ '''cmdImageRemove control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents cmdImageRemove As Global.System.Web.UI.WebControls.LinkButton
+
+ '''
+ '''lblPublic control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblPublic As Global.System.Web.UI.UserControl
+
+ '''
+ '''chkPublic control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents chkPublic As Global.System.Web.UI.WebControls.CheckBox
+
+ '''
+ '''lblSyndicate control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblSyndicate As Global.System.Web.UI.UserControl
+
+ '''
+ '''chkSyndicate control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents chkSyndicate As Global.System.Web.UI.WebControls.CheckBox
+
+ '''
+ '''lblSyndicationEmail control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblSyndicationEmail As Global.System.Web.UI.UserControl
+
+ '''
+ '''txtSyndicationEmail control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents txtSyndicationEmail As Global.System.Web.UI.WebControls.TextBox
+
+ '''
+ '''lblCopyright control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblCopyright As Global.System.Web.UI.UserControl
+
+ '''
+ '''txtCopyright control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents txtCopyright As Global.System.Web.UI.WebControls.TextBox
+
+ '''
+ '''lblIncludeImagesInFeed control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblIncludeImagesInFeed As Global.System.Web.UI.UserControl
+
+ '''
+ '''chkIncludeImagesInFeed control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents chkIncludeImagesInFeed As Global.System.Web.UI.WebControls.CheckBox
+
+ '''
+ '''lblIncludeAuthorInFeed control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblIncludeAuthorInFeed As Global.System.Web.UI.UserControl
+
+ '''
+ '''chkIncludeAuthorInFeed control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents chkIncludeAuthorInFeed As Global.System.Web.UI.WebControls.CheckBox
+
+ '''
+ '''lblPingbacks control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblPingbacks As Global.System.Web.UI.UserControl
+
+ '''
+ '''chkEnablePingBackSend control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents chkEnablePingBackSend As Global.System.Web.UI.WebControls.CheckBox
+
+ '''
+ '''chkEnablePingBackReceive control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents chkEnablePingBackReceive As Global.System.Web.UI.WebControls.CheckBox
+
+ '''
+ '''chkAutoApprovePingBack control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents chkAutoApprovePingBack As Global.System.Web.UI.WebControls.CheckBox
+
+ '''
+ '''lblTrackbacks control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblTrackbacks As Global.System.Web.UI.UserControl
+
+ '''
+ '''chkEnableTrackBackSend control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents chkEnableTrackBackSend As Global.System.Web.UI.WebControls.CheckBox
+
+ '''
+ '''chkEnableTrackBackReceive control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents chkEnableTrackBackReceive As Global.System.Web.UI.WebControls.CheckBox
+
+ '''
+ '''chkAutoApproveTrackBack control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents chkAutoApproveTrackBack As Global.System.Web.UI.WebControls.CheckBox
+
+ '''
+ '''lblMustApproveGhostPosts control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblMustApproveGhostPosts As Global.System.Web.UI.UserControl
+
+ '''
+ '''chkMustApproveGhostPosts control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents chkMustApproveGhostPosts As Global.System.Web.UI.WebControls.CheckBox
+
+ '''
+ '''lblPublishAsOwner control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblPublishAsOwner As Global.System.Web.UI.UserControl
+
+ '''
+ '''chkPublishAsOwner control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents chkPublishAsOwner As Global.System.Web.UI.WebControls.CheckBox
+
+ '''
+ '''lblPermissions control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents lblPermissions As Global.System.Web.UI.UserControl
+
+ '''
+ '''ctlPermissions control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents ctlPermissions As Global.DotNetNuke.Modules.Blog.Core.Security.Controls.BlogPermissionsGrid
+
+ '''
+ '''cmdUpdate control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents cmdUpdate As Global.System.Web.UI.WebControls.LinkButton
+
+ '''
+ '''hlCancel control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents hlCancel As Global.System.Web.UI.WebControls.HyperLink
+
+ '''
+ '''cmdDelete control.
+ '''
+ '''
+ '''Auto-generated field.
+ '''To modify move field declaration from designer file to code-behind file.
+ '''
+ Protected WithEvents cmdDelete As Global.System.Web.UI.WebControls.LinkButton
End Class
diff --git a/Server/Blog/BlogEdit.ascx.vb b/Server/Blog/BlogEdit.ascx.vb
index e6eb2278..649b9401 100644
--- a/Server/Blog/BlogEdit.ascx.vb
+++ b/Server/Blog/BlogEdit.ascx.vb
@@ -20,215 +20,215 @@
Imports System.Linq
Imports DotNetNuke.Common
-Imports DotNetNuke.Services.Exceptions
-Imports DotNetNuke.Modules.Blog.Entities.Blogs
-Imports DotNetNuke.Modules.Blog.Common.Globals
Imports DotNetNuke.Framework
+Imports DotNetNuke.Modules.Blog.Core.Common
+Imports DotNetNuke.Modules.Blog.Core.Entities.Blogs
+Imports DotNetNuke.Services.Exceptions
Public Class BlogEdit
- Inherits BlogModuleBase
-
- Private Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
-
- JavaScriptLibraries.JavaScript.RequestRegistration(JavaScriptLibraries.CommonJs.DnnPlugins)
- If Not BlogContext.Security.IsEditor Then
- If Not BlogContext.Security.IsBlogger Then
- Response.Redirect(NavigateURL("Access Denied"), True)
- End If
- If BlogContext.Blog IsNot Nothing AndAlso BlogContext.Blog.OwnerUserId <> UserId Then
- Response.Redirect(NavigateURL("Access Denied"), True)
- End If
- End If
- txtTitle.DefaultLanguage = PortalSettings.DefaultLanguage
- txtDescription.DefaultLanguage = PortalSettings.DefaultLanguage
-
- End Sub
-
- Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
-
- If Not BlogContext.Security.IsBlogger Then
- Throw New Exception("You do not have access to this resource. Please check your login status.")
- End If
-
- If Not Page.IsPostBack Then
- If BlogContext.Blog Is Nothing Then BlogContext.Blog = New BlogInfo ' initialize fields
-
- txtTitle.DefaultText = BlogContext.Blog.Title
- txtTitle.LocalizedTexts = BlogContext.Blog.TitleLocalizations
- txtTitle.InitialBind()
- txtDescription.DefaultText = BlogContext.Blog.Description
- txtDescription.LocalizedTexts = BlogContext.Blog.DescriptionLocalizations
- txtDescription.InitialBind()
-
- If BlogContext.IsMultiLingualSite Then
- ddLocale.DataSource = DotNetNuke.Services.Localization.LocaleController.Instance.GetLocales(PortalId).Values.OrderBy(Function(t) t.NativeName)
- ddLocale.DataValueField = "Code"
- ddLocale.DataBind()
- Try
- ddLocale.Items.FindByValue(BlogContext.Blog.Locale).Selected = True
- Catch ex As Exception
- End Try
- chkFullLocalization.Checked = BlogContext.Blog.FullLocalization
- Else
- rowLocale.Visible = False
- rowFullLocalization.Visible = False
- End If
- chkPublic.Checked = BlogContext.Blog.Published
- chkSyndicate.Checked = BlogContext.Blog.Syndicated
- If BlogContext.Blog.SyndicationEmail Is Nothing Then
- txtSyndicationEmail.Text = ModuleContext.PortalSettings.UserInfo.Email
- Else
- txtSyndicationEmail.Text = BlogContext.Blog.SyndicationEmail
- End If
- chkIncludeImagesInFeed.Checked = BlogContext.Blog.IncludeImagesInFeed
- chkIncludeAuthorInFeed.Checked = BlogContext.Blog.IncludeAuthorInFeed
- chkEnablePingBackReceive.Checked = BlogContext.Blog.EnablePingBackReceive
- chkEnablePingBackSend.Checked = BlogContext.Blog.EnablePingBackSend
- chkAutoApprovePingBack.Checked = BlogContext.Blog.AutoApprovePingBack
- chkEnableTrackBackReceive.Checked = BlogContext.Blog.EnableTrackBackReceive
- chkEnableTrackBackSend.Checked = BlogContext.Blog.EnableTrackBackSend
- chkAutoApproveTrackBack.Checked = BlogContext.Blog.AutoApproveTrackBack
- txtCopyright.Text = BlogContext.Blog.Copyright
- cmdDelete.Visible = CBool(BlogContext.BlogId <> -1)
- If Not String.IsNullOrEmpty(BlogContext.Blog.Image) Then
- imgBlogImage.ImageUrl = ResolveUrl(glbImageHandlerPath) & String.Format("?TabId={0}&ModuleId={1}&Blog={2}&w=100&h=100&c=1&key={3}", TabId, Settings.ModuleId, BlogContext.BlogId, BlogContext.Blog.Image)
- imgBlogImage.Visible = True
- cmdImageRemove.Visible = True
- Else
- imgBlogImage.Visible = False
- cmdImageRemove.Visible = False
- End If
- ' ghost writing
- chkMustApproveGhostPosts.Checked = BlogContext.Blog.MustApproveGhostPosts
- chkPublishAsOwner.Checked = BlogContext.Blog.PublishAsOwner
- ctlPermissions.Permissions = BlogContext.Blog.Permissions
- ctlPermissions.TabId = TabId
- ctlPermissions.CurrentUserId = UserId
- ctlPermissions.UserIsAdmin = BlogContext.Security.UserIsAdmin
-
- hlCancel.NavigateUrl = EditUrl("Manage")
- End If
-
- End Sub
-
- Protected Sub cmdDelete_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdDelete.Click
- Try
- If Not BlogContext.Blog Is Nothing Then
- BlogsController.DeleteBlog(BlogContext.Blog.BlogID)
- End If
- Response.Redirect(EditUrl("Manage"), False)
- Catch exc As Exception
- ProcessModuleLoadException(Me, exc)
- End Try
- End Sub
-
- Private Sub cmdUpdate_Click(sender As Object, e As EventArgs) Handles cmdUpdate.Click
- Try
- If Page.IsValid = True Then
- If BlogContext.Blog Is Nothing Then
- BlogContext.Blog = New BlogInfo
- With BlogContext.Blog
- .ModuleID = Settings.ModuleId
- .OwnerUserId = UserId
- End With
+ Inherits BlogModuleBase
+
+ Private Sub Page_Init(sender As Object, e As EventArgs) Handles Me.Init
+
+ JavaScriptLibraries.JavaScript.RequestRegistration(JavaScriptLibraries.CommonJs.DnnPlugins)
+ If Not BlogContext.Security.IsEditor Then
+ If Not BlogContext.Security.IsBlogger Then
+ Response.Redirect(NavigateURL("Access Denied"), True)
+ End If
+ If BlogContext.Blog IsNot Nothing AndAlso BlogContext.Blog.OwnerUserId <> UserId Then
+ Response.Redirect(NavigateURL("Access Denied"), True)
+ End If
End If
- With BlogContext.Blog
- .Title = txtTitle.DefaultText
- .TitleLocalizations = txtTitle.GetLocalizedTexts
- .Description = txtDescription.DefaultText
- .DescriptionLocalizations = txtDescription.GetLocalizedTexts
- If BlogContext.IsMultiLingualSite Then
- .Locale = ddLocale.SelectedValue
- .FullLocalization = chkFullLocalization.Checked
- Else
- .Locale = PortalSettings.DefaultLanguage
- End If
- .Published = chkPublic.Checked
- .Syndicated = chkSyndicate.Checked
- .SyndicationEmail = txtSyndicationEmail.Text
- .IncludeImagesInFeed = chkIncludeImagesInFeed.Checked
- .IncludeAuthorInFeed = chkIncludeAuthorInFeed.Checked
- .EnablePingBackReceive = chkEnablePingBackReceive.Checked
- .EnablePingBackSend = chkEnablePingBackSend.Checked
- .AutoApprovePingBack = chkAutoApprovePingBack.Checked
- .EnableTrackBackReceive = chkEnableTrackBackReceive.Checked
- .EnableTrackBackSend = chkEnableTrackBackSend.Checked
- .AutoApproveTrackBack = chkAutoApproveTrackBack.Checked
- .Copyright = txtCopyright.Text.Trim
- .MustApproveGhostPosts = chkMustApproveGhostPosts.Checked
- .PublishAsOwner = chkPublishAsOwner.Checked
- .Permissions = ctlPermissions.Permissions
- If BlogContext.BlogId = -1 Then
- .BlogID = BlogsController.AddBlog(BlogContext.Blog, UserId)
- BlogContext.BlogId = .BlogID
- Else
- BlogsController.UpdateBlog(BlogContext.Blog, UserId)
- End If
- Modules.Blog.Security.Permissions.BlogPermissionsController.UpdateBlogPermissions(BlogContext.Blog)
- End With
-
- If fileImage.HasFile Then
- Dim extension As String = IO.Path.GetExtension(fileImage.FileName).ToLower
- If glbPermittedFileExtensions.IndexOf(extension & ",") > -1 Then
- Dim saveDir As String = GetBlogDirectoryMapPath(BlogContext.BlogId)
- If Not IO.Directory.Exists(saveDir) Then IO.Directory.CreateDirectory(saveDir)
- If BlogContext.Blog.Image <> "" Then
- ' remove old images
- Dim imagesToDelete As New List(Of String)
- Dim d As New IO.DirectoryInfo(saveDir)
- For Each f As IO.FileInfo In d.GetFiles
- If f.Name.StartsWith(BlogContext.Blog.Image) Then
- imagesToDelete.Add(f.FullName)
- End If
- Next
- For Each f As String In imagesToDelete
+ txtTitle.DefaultLanguage = PortalSettings.DefaultLanguage
+ txtDescription.DefaultLanguage = PortalSettings.DefaultLanguage
+
+ End Sub
+
+ Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
+
+ If Not BlogContext.Security.IsBlogger Then
+ Throw New Exception("You do not have access to this resource. Please check your login status.")
+ End If
+
+ If Not Page.IsPostBack Then
+ If BlogContext.Blog Is Nothing Then BlogContext.Blog = New BlogInfo ' initialize fields
+
+ txtTitle.DefaultText = BlogContext.Blog.Title
+ txtTitle.LocalizedTexts = BlogContext.Blog.TitleLocalizations
+ txtTitle.InitialBind()
+ txtDescription.DefaultText = BlogContext.Blog.Description
+ txtDescription.LocalizedTexts = BlogContext.Blog.DescriptionLocalizations
+ txtDescription.InitialBind()
+
+ If BlogContext.IsMultiLingualSite Then
+ ddLocale.DataSource = DotNetNuke.Services.Localization.LocaleController.Instance.GetLocales(PortalId).Values.OrderBy(Function(t) t.NativeName)
+ ddLocale.DataValueField = "Code"
+ ddLocale.DataBind()
Try
- IO.File.Delete(f)
+ ddLocale.Items.FindByValue(BlogContext.Blog.Locale).Selected = True
Catch ex As Exception
End Try
- Next
+ chkFullLocalization.Checked = BlogContext.Blog.FullLocalization
+ Else
+ rowLocale.Visible = False
+ rowFullLocalization.Visible = False
+ End If
+ chkPublic.Checked = BlogContext.Blog.Published
+ chkSyndicate.Checked = BlogContext.Blog.Syndicated
+ If BlogContext.Blog.SyndicationEmail Is Nothing Then
+ txtSyndicationEmail.Text = ModuleContext.PortalSettings.UserInfo.Email
+ Else
+ txtSyndicationEmail.Text = BlogContext.Blog.SyndicationEmail
End If
- Dim newFileName As String = Guid.NewGuid.ToString("D")
- fileImage.SaveAs(saveDir & newFileName & IO.Path.GetExtension(fileImage.FileName).ToLower)
- BlogContext.Blog.Image = newFileName
+ chkIncludeImagesInFeed.Checked = BlogContext.Blog.IncludeImagesInFeed
+ chkIncludeAuthorInFeed.Checked = BlogContext.Blog.IncludeAuthorInFeed
+ chkEnablePingBackReceive.Checked = BlogContext.Blog.EnablePingBackReceive
+ chkEnablePingBackSend.Checked = BlogContext.Blog.EnablePingBackSend
+ chkAutoApprovePingBack.Checked = BlogContext.Blog.AutoApprovePingBack
+ chkEnableTrackBackReceive.Checked = BlogContext.Blog.EnableTrackBackReceive
+ chkEnableTrackBackSend.Checked = BlogContext.Blog.EnableTrackBackSend
+ chkAutoApproveTrackBack.Checked = BlogContext.Blog.AutoApproveTrackBack
+ txtCopyright.Text = BlogContext.Blog.Copyright
+ cmdDelete.Visible = CBool(BlogContext.BlogId <> -1)
+ If Not String.IsNullOrEmpty(BlogContext.Blog.Image) Then
+ imgBlogImage.ImageUrl = ResolveUrl(Core.Common.Globals.glbImageHandlerPath) & String.Format("?TabId={0}&ModuleId={1}&Blog={2}&w=100&h=100&c=1&key={3}", TabId, Settings.ModuleId, BlogContext.BlogId, BlogContext.Blog.Image)
+ imgBlogImage.Visible = True
+ cmdImageRemove.Visible = True
+ Else
+ imgBlogImage.Visible = False
+ cmdImageRemove.Visible = False
+ End If
+ ' ghost writing
+ chkMustApproveGhostPosts.Checked = BlogContext.Blog.MustApproveGhostPosts
+ chkPublishAsOwner.Checked = BlogContext.Blog.PublishAsOwner
+ ctlPermissions.Permissions = BlogContext.Blog.Permissions
+ ctlPermissions.TabId = TabId
+ ctlPermissions.CurrentUserId = UserId
+ ctlPermissions.UserIsAdmin = BlogContext.Security.UserIsAdmin
+
+ hlCancel.NavigateUrl = EditUrl("Manage")
+ End If
+
+ End Sub
+
+ Protected Sub cmdDelete_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdDelete.Click
+ Try
+ If Not BlogContext.Blog Is Nothing Then
+ BlogsController.DeleteBlog(BlogContext.Blog.BlogID)
+ End If
+ Response.Redirect(EditUrl("Manage"), False)
+ Catch exc As Exception
+ ProcessModuleLoadException(Me, exc)
+ End Try
+ End Sub
+
+ Private Sub cmdUpdate_Click(sender As Object, e As EventArgs) Handles cmdUpdate.Click
+ Try
+ If Page.IsValid = True Then
+ If BlogContext.Blog Is Nothing Then
+ BlogContext.Blog = New BlogInfo
+ With BlogContext.Blog
+ .ModuleID = Settings.ModuleId
+ .OwnerUserId = UserId
+ End With
+ End If
+ With BlogContext.Blog
+ .Title = txtTitle.DefaultText
+ .TitleLocalizations = txtTitle.GetLocalizedTexts
+ .Description = txtDescription.DefaultText
+ .DescriptionLocalizations = txtDescription.GetLocalizedTexts
+ If BlogContext.IsMultiLingualSite Then
+ .Locale = ddLocale.SelectedValue
+ .FullLocalization = chkFullLocalization.Checked
+ Else
+ .Locale = PortalSettings.DefaultLanguage
+ End If
+ .Published = chkPublic.Checked
+ .Syndicated = chkSyndicate.Checked
+ .SyndicationEmail = txtSyndicationEmail.Text
+ .IncludeImagesInFeed = chkIncludeImagesInFeed.Checked
+ .IncludeAuthorInFeed = chkIncludeAuthorInFeed.Checked
+ .EnablePingBackReceive = chkEnablePingBackReceive.Checked
+ .EnablePingBackSend = chkEnablePingBackSend.Checked
+ .AutoApprovePingBack = chkAutoApprovePingBack.Checked
+ .EnableTrackBackReceive = chkEnableTrackBackReceive.Checked
+ .EnableTrackBackSend = chkEnableTrackBackSend.Checked
+ .AutoApproveTrackBack = chkAutoApproveTrackBack.Checked
+ .Copyright = txtCopyright.Text.Trim
+ .MustApproveGhostPosts = chkMustApproveGhostPosts.Checked
+ .PublishAsOwner = chkPublishAsOwner.Checked
+ .Permissions = ctlPermissions.Permissions
+ If BlogContext.BlogId = -1 Then
+ .BlogID = BlogsController.AddBlog(BlogContext.Blog, UserId)
+ BlogContext.BlogId = .BlogID
+ Else
+ BlogsController.UpdateBlog(BlogContext.Blog, UserId)
+ End If
+ Modules.Blog.Core.Security.Permissions.BlogPermissionsController.UpdateBlogPermissions(BlogContext.Blog)
+ End With
+
+ If fileImage.HasFile Then
+ Dim extension As String = IO.Path.GetExtension(fileImage.FileName).ToLower
+ If Core.Common.Globals.glbPermittedFileExtensions.IndexOf(extension & ",") > -1 Then
+ Dim saveDir As String = Core.Common.Globals.GetBlogDirectoryMapPath(BlogContext.BlogId)
+ If Not IO.Directory.Exists(saveDir) Then IO.Directory.CreateDirectory(saveDir)
+ If BlogContext.Blog.Image <> "" Then
+ ' remove old images
+ Dim imagesToDelete As New List(Of String)
+ Dim d As New IO.DirectoryInfo(saveDir)
+ For Each f As IO.FileInfo In d.GetFiles
+ If f.Name.StartsWith(BlogContext.Blog.Image) Then
+ imagesToDelete.Add(f.FullName)
+ End If
+ Next
+ For Each f As String In imagesToDelete
+ Try
+ IO.File.Delete(f)
+ Catch ex As Exception
+ End Try
+ Next
+ End If
+ Dim newFileName As String = Guid.NewGuid.ToString("D")
+ fileImage.SaveAs(saveDir & newFileName & IO.Path.GetExtension(fileImage.FileName).ToLower)
+ BlogContext.Blog.Image = newFileName
+ BlogsController.UpdateBlog(BlogContext.Blog, UserId)
+ End If
+ End If
+
+ End If
+ Response.Redirect(EditUrl("Manage"), False)
+ Catch exc As Exception
+ ProcessModuleLoadException(Me, exc)
+ End Try
+ End Sub
+
+ Private Sub cmdImageRemove_Click(sender As Object, e As EventArgs) Handles cmdImageRemove.Click
+
+ If BlogContext.Blog IsNot Nothing Then
+ If BlogContext.Blog.Image <> "" Then
+ ' remove old images
+ Dim saveDir As String = Core.Common.Globals.GetBlogDirectoryMapPath(BlogContext.BlogId)
+ Dim imagesToDelete As New List(Of String)
+ Dim d As New IO.DirectoryInfo(saveDir)
+ For Each f As IO.FileInfo In d.GetFiles
+ If f.Name.StartsWith(BlogContext.Blog.Image) Then
+ imagesToDelete.Add(f.FullName)
+ End If
+ Next
+ For Each f As String In imagesToDelete
+ Try
+ IO.File.Delete(f)
+ Catch ex As Exception
+ End Try
+ Next
+ End If
+ BlogContext.Blog.Image = ""
BlogsController.UpdateBlog(BlogContext.Blog, UserId)
- End If
End If
+ imgBlogImage.Visible = False
+ cmdImageRemove.Visible = False
- End If
- Response.Redirect(EditUrl("Manage"), False)
- Catch exc As Exception
- ProcessModuleLoadException(Me, exc)
- End Try
- End Sub
-
- Private Sub cmdImageRemove_Click(sender As Object, e As EventArgs) Handles cmdImageRemove.Click
-
- If BlogContext.Blog IsNot Nothing Then
- If BlogContext.Blog.Image <> "" Then
- ' remove old images
- Dim saveDir As String = GetBlogDirectoryMapPath(BlogContext.BlogId)
- Dim imagesToDelete As New List(Of String)
- Dim d As New IO.DirectoryInfo(saveDir)
- For Each f As IO.FileInfo In d.GetFiles
- If f.Name.StartsWith(BlogContext.Blog.Image) Then
- imagesToDelete.Add(f.FullName)
- End If
- Next
- For Each f As String In imagesToDelete
- Try
- IO.File.Delete(f)
- Catch ex As Exception
- End Try
- Next
- End If
- BlogContext.Blog.Image = ""
- BlogsController.UpdateBlog(BlogContext.Blog, UserId)
- End If
- imgBlogImage.Visible = False
- cmdImageRemove.Visible = False
-
- End Sub
+ End Sub
End Class
\ No newline at end of file
diff --git a/Server/Blog/BlogImage.ashx.vb b/Server/Blog/BlogImage.ashx.vb
index 55c5d437..3de162e7 100644
--- a/Server/Blog/BlogImage.ashx.vb
+++ b/Server/Blog/BlogImage.ashx.vb
@@ -18,79 +18,79 @@
' DEALINGS IN THE SOFTWARE.
'
-Imports DotNetNuke.Modules.Blog.Common.Globals
Imports DotNetNuke.Entities.Portals
+Imports DotNetNuke.Modules.Blog.Core.Common
Public Class BlogImage
- Implements System.Web.IHttpHandler
+ Implements System.Web.IHttpHandler
- Private Property BlogId As Integer = -1
- Private Property PostId As Integer = -1
- Private Property ModuleId As Integer = -1
- Private Property TabId As Integer = -1
- Private Property Key As String = ""
- Private Property Width As Integer = -1
- Private Property Height As Integer = -1
- Private Property Crop As Boolean = False
- Private Property PortalSettings As PortalSettings = Nothing
+ Private Property BlogId As Integer = -1
+ Private Property PostId As Integer = -1
+ Private Property ModuleId As Integer = -1
+ Private Property TabId As Integer = -1
+ Private Property Key As String = ""
+ Private Property Width As Integer = -1
+ Private Property Height As Integer = -1
+ Private Property Crop As Boolean = False
+ Private Property PortalSettings As PortalSettings = Nothing
- Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
+ Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
- PortalSettings = PortalController.Instance.GetCurrentPortalSettings
- context.Request.Params.ReadValue("Blog", BlogId)
- context.Request.Params.ReadValue("Post", PostId)
- context.Request.Params.ReadValue("Key", Key)
- context.Request.Params.ReadValue("ModuleId", ModuleId)
- context.Request.Params.ReadValue("TabId", TabId)
- context.Request.Params.ReadValue("w", Width)
- context.Request.Params.ReadValue("h", Height)
- context.Request.Params.ReadValue("c", Crop)
+ PortalSettings = PortalController.Instance.GetCurrentPortalSettings
+ BlogId = context.Request.Params.ReadValue("Blog", BlogId)
+ PostId = context.Request.Params.ReadValue("Post", PostId)
+ Key = context.Request.Params.ReadValue("Key", Key)
+ ModuleId = context.Request.Params.ReadValue("ModuleId", ModuleId)
+ TabId = context.Request.Params.ReadValue("TabId", TabId)
+ Width = context.Request.Params.ReadValue("w", Width)
+ Height = context.Request.Params.ReadValue("h", Height)
+ Crop = context.Request.Params.ReadValue("c", Crop)
- Try
- Dim path As String = ""
- If PostId > -1 Then ' we're looking for an Post's image
- path = GetPostDirectoryMapPath(BlogId, PostId)
- ElseIf BlogId > -1 Then ' we're looking for a blog's image
- path = GetBlogDirectoryMapPath(BlogId)
- End If
- Dim files() As String = IO.Directory.GetFiles(path, String.Format("{0}-{1}-{2}-{3}.*", Key, Width, Height, Crop))
- If files.Length > 0 Then
- Select Case IO.Path.GetExtension(files(0)).ToLower
- Case ".jpg"
- context.Response.ContentType = "image/jpeg"
- Case ".png"
- context.Response.ContentType = "image/png"
- Case ".gif"
- context.Response.ContentType = "image/gif"
- Case ".bmp"
- context.Response.ContentType = "image/bmp"
- Case ".tif", ".tiff"
- context.Response.ContentType = "image/tiff"
- Case Else
- Exit Sub
- End Select
- context.Response.WriteFile(files(0))
- Else
- files = IO.Directory.GetFiles(path, String.Format("{0}.*", Key))
- If files.Length > 0 Then
- Dim img As New Common.Image(files(0))
- If img.IsValidExtension Then
- context.Response.ContentType = img.MimeType
- Dim newImg As String = img.ResizeImage(Width, Height, Crop)
- context.Response.WriteFile(newImg)
- img.Dispose()
- End If
- End If
- End If
- Catch ex As Exception
- End Try
+ Try
+ Dim path As String = ""
+ If PostId > -1 Then ' we're looking for an Post's image
+ path = Globals.GetPostDirectoryMapPath(BlogId, PostId)
+ ElseIf BlogId > -1 Then ' we're looking for a blog's image
+ path = Globals.GetBlogDirectoryMapPath(BlogId)
+ End If
+ Dim files() As String = IO.Directory.GetFiles(path, String.Format("{0}-{1}-{2}-{3}.*", Key, Width, Height, Crop))
+ If files.Length > 0 Then
+ Select Case IO.Path.GetExtension(files(0)).ToLower
+ Case ".jpg"
+ context.Response.ContentType = "image/jpeg"
+ Case ".png"
+ context.Response.ContentType = "image/png"
+ Case ".gif"
+ context.Response.ContentType = "image/gif"
+ Case ".bmp"
+ context.Response.ContentType = "image/bmp"
+ Case ".tif", ".tiff"
+ context.Response.ContentType = "image/tiff"
+ Case Else
+ Exit Sub
+ End Select
+ context.Response.WriteFile(files(0))
+ Else
+ files = IO.Directory.GetFiles(path, String.Format("{0}.*", Key))
+ If files.Length > 0 Then
+ Dim img As New Core.Common.Image(files(0))
+ If img.IsValidExtension Then
+ context.Response.ContentType = img.MimeType
+ Dim newImg As String = img.ResizeImage(Width, Height, Crop)
+ context.Response.WriteFile(newImg)
+ img.Dispose()
+ End If
+ End If
+ End If
+ Catch ex As Exception
+ End Try
- End Sub
+ End Sub
- ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
- Get
- Return False
- End Get
- End Property
+ ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
+ Get
+ Return False
+ End Get
+ End Property
End Class
\ No newline at end of file
diff --git a/Server/Blog/BlogImport.ascx.vb b/Server/Blog/BlogImport.ascx.vb
index aea9f9c4..50a3c024 100644
--- a/Server/Blog/BlogImport.ascx.vb
+++ b/Server/Blog/BlogImport.ascx.vb
@@ -20,10 +20,10 @@
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Services.Localization
-Imports DotNetNuke.Modules.Blog.Common.Globals
-Imports DotNetNuke.Modules.Blog.BlogML.Xml
-Imports DotNetNuke.Modules.Blog.Entities.Posts
+Imports DotNetNuke.Modules.Blog.Core.Common
+Imports DotNetNuke.Modules.Blog.Core.BlogML.Xml
Imports System.IO.Compression
+Imports DotNetNuke.Modules.Blog.Core.Entities.Posts
Public Class BlogImport
Inherits BlogModuleBase
@@ -135,12 +135,12 @@ Public Class BlogImport
.Locale = post.Locale
End With
If newPost.Title <> "" And newPost.Content <> "" Then
- newPost.ContentItemId = PostsController.AddPost(newPost, UserId)
+ newPost = Core.Entities.Posts.PostsController.AddPost(newPost, UserId)
strReport.AppendFormat("Added {0}" & vbCrLf, post.Title)
' import resources
If post.Attachments.Count > 0 Then
- Dim postDir As String = GetPostDirectoryMapPath(newPost)
- Dim postPath As String = GetPostDirectoryPath(newPost)
+ Dim postDir As String = Core.Common.Globals.GetPostDirectoryMapPath(newPost)
+ Dim postPath As String = Core.Common.Globals.GetPostDirectoryPath(newPost)
IO.Directory.CreateDirectory(postDir)
For Each att As BlogMLAttachment In post.Attachments
If att.Embedded And att.Data IsNot Nothing Then
@@ -154,7 +154,7 @@ Public Class BlogImport
End If
Next
End If
- PostsController.UpdatePost(newPost, UserId)
+ Core.Entities.Posts.PostsController.UpdatePost(newPost, UserId)
End If
Next
txtReport.Text = strReport.ToString
diff --git a/Server/Blog/Components/Api/BlogRouteMapper.vb b/Server/Blog/Components/Api/BlogRouteMapper.vb
new file mode 100644
index 00000000..a3b2c936
--- /dev/null
+++ b/Server/Blog/Components/Api/BlogRouteMapper.vb
@@ -0,0 +1,38 @@
+Imports DotNetNuke.Web.Api
+
+Namespace Api
+ Public Class BlogRouteMapper
+ Implements IServiceRouteMapper
+
+ Public Enum ServiceControllers
+ Blogs
+ Comments
+ Posts
+ Terms
+ End Enum
+
+ Public Const ServicePath As String = "~/DesktopModules/Blog/API/"
+
+ Public Sub RegisterRoutes(mapRouteManager As IMapRoute) Implements IServiceRouteMapper.RegisterRoutes
+ mapRouteManager.MapHttpRoute("Blog", "BlogApiControllers", "{controller}/{action}", New String() {"DotNetNuke.Modules.Blog.Api"})
+ End Sub
+
+ Public Shared Function GetRoute(controller As ServiceControllers, method As String) As String
+ Select Case controller
+ Case ServiceControllers.Blogs
+ Return GetRoute("Blogs", method)
+ Case ServiceControllers.Comments
+ Return GetRoute("Comments", method)
+ Case ServiceControllers.Posts
+ Return GetRoute("Posts", method)
+ Case Else
+ Return GetRoute("Terms", method)
+ End Select
+ End Function
+
+ Public Shared Function GetRoute(controller As String, method As String) As String
+ Return HttpContext.Current.Request.Url.Scheme & "://" & HttpContext.Current.Request.Url.Host & DotNetNuke.Common.ResolveUrl(ServicePath & controller & "/" & method)
+ End Function
+
+ End Class
+End Namespace
\ No newline at end of file
diff --git a/Server/Blog/Components/Entities/Blogs/BlogsController_Service.vb b/Server/Blog/Components/Api/BlogsController.vb
similarity index 80%
rename from Server/Blog/Components/Entities/Blogs/BlogsController_Service.vb
rename to Server/Blog/Components/Api/BlogsController.vb
index f0c21f11..3c912d67 100644
--- a/Server/Blog/Components/Entities/Blogs/BlogsController_Service.vb
+++ b/Server/Blog/Components/Api/BlogsController.vb
@@ -22,16 +22,18 @@ Imports System.Net
Imports System.Net.Http
Imports System.Web.Http
Imports DotNetNuke.Web.Api
-Imports DotNetNuke.Modules.Blog.Common.Globals
-Imports DotNetNuke.Modules.Blog.Entities.Posts
-Imports DotNetNuke.Modules.Blog.Entities.Comments
-Imports DotNetNuke.Modules.Blog.BlogML.Xml
-Imports DotNetNuke.Modules.Blog.Entities.Terms
+Imports DotNetNuke.Modules.Blog.Core.Common
+Imports DotNetNuke.Modules.Blog.Core.BlogML.Xml
+Imports DotNetNuke.Modules.Blog.Core.Entities.Terms
Imports System.Xml
-Imports DotNetNuke.Modules.Blog.Services
Imports System.IO.Compression
+Imports DotNetNuke.Modules.Blog.Core.Entities.Blogs
+Imports DotNetNuke.Modules.Blog.Core.Entities.Posts
+Imports DotNetNuke.Modules.Blog.Core
+Imports DotNetNuke.Modules.Blog.Core.Entities.Comments
+Imports DotNetNuke.Modules.Blog.Core.Services
-Namespace Entities.Blogs
+Namespace Api
Partial Public Class BlogsController
Inherits DnnApiController
@@ -46,15 +48,15 @@ Namespace Entities.Blogs
#Region " Service Methods "
-
+
Public Function ExportBlog(postData As BlogDTO) As HttpResponseMessage
SetContext(postData)
- Dim saveDir As New IO.DirectoryInfo(GetBlogDirectoryMapPath(Blog.BlogID))
+ Dim saveDir As New IO.DirectoryInfo(Globals.GetBlogDirectoryMapPath(Blog.BlogID))
If Not saveDir.Exists Then saveDir.Create()
- RemoveOldTimeStampedFiles(saveDir)
+ Globals.RemoveOldTimeStampedFiles(saveDir)
Dim newBlogML As New BlogMLBlog
newBlogML.Title = Blog.Title
@@ -65,7 +67,7 @@ Namespace Entities.Blogs
AddPosts(newBlogML)
Dim blogMLFile As String = Date.Now.ToString("yyyy-MM-dd") & "-" & Guid.NewGuid.ToString("D")
- Using objZipOutputStream As New ZipArchive(IO.File.Create(GetBlogDirectoryMapPath(Blog.BlogID) & blogMLFile & ".zip"), ZipArchiveMode.Create)
+ Using objZipOutputStream As New ZipArchive(IO.File.Create(Globals.GetBlogDirectoryMapPath(Blog.BlogID) & blogMLFile & ".zip"), ZipArchiveMode.Create)
Dim objZipEntry As ZipArchiveEntry = objZipOutputStream.CreateEntry(blogMLFile & ".xml")
Using stream As XmlWriter = XmlWriter.Create(objZipEntry.Open)
BlogMLSerializer.Serialize(stream, newBlogML)
@@ -73,19 +75,19 @@ Namespace Entities.Blogs
End Using
End Using
- Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = GetBlogDirectoryPath(Blog.BlogID) & blogMLFile & ".zip"})
+ Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = Globals.GetBlogDirectoryPath(Blog.BlogID) & blogMLFile & ".zip"})
End Function
#End Region
#Region " Private Methods "
Private Sub SetContext(data As BlogDTO)
- Blog = BlogsController.GetBlog(data.BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
+ Blog = Core.Entities.Blogs.BlogsController.GetBlog(data.BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
Settings = ModuleSettings.GetModuleSettings(ActiveModule.ModuleID)
End Sub
Private Sub AddCategories(ByRef TargetBlogML As BlogMLBlog)
If Settings.VocabularyId > -1 Then
- For Each c As TermInfo In Entities.Terms.TermsController.GetTermsByVocabulary(ActiveModule.ModuleID, Settings.VocabularyId, Threading.Thread.CurrentThread.CurrentCulture.Name).Values
+ For Each c As TermInfo In Core.Entities.Terms.TermsController.GetTermsByVocabulary(ActiveModule.ModuleID, Settings.VocabularyId, Threading.Thread.CurrentThread.CurrentCulture.Name).Values
Dim categoryML As New BlogMLCategory
categoryML.Approved = True
categoryML.DateCreated = c.CreatedOnDate
@@ -103,7 +105,7 @@ Namespace Entities.Blogs
Dim handledRecs As Integer = 0
Dim page As Integer = 0
Do
- For Each post As PostInfo In PostsController.GetPostsByBlog(ActiveModule.ModuleID, Blog.BlogID, Threading.Thread.CurrentThread.CurrentCulture.Name, -1, page, 10, "PUBLISHEDONDATE", totalRecs).Values
+ For Each post As PostInfo In Core.Entities.Posts.PostsController.GetPostsByBlog(ActiveModule.ModuleID, Blog.BlogID, Threading.Thread.CurrentThread.CurrentCulture.Name, -1, page, 10, "PUBLISHEDONDATE", totalRecs).Values
handledRecs += 1
TargetBlogML.Posts.Add(ConvertPost(post))
Next
@@ -142,7 +144,7 @@ Namespace Entities.Blogs
newPostML.Locale = post.Locale
' pack files
- Dim postDir As String = GetPostDirectoryMapPath(post.BlogID, post.ContentItemId)
+ Dim postDir As String = Globals.GetPostDirectoryMapPath(post.BlogID, post.ContentItemId)
If IO.Directory.Exists(postDir) Then
For Each f As String In IO.Directory.GetFiles(postDir)
Dim fileName As String = IO.Path.GetFileName(f)
@@ -167,7 +169,7 @@ Namespace Entities.Blogs
Next
End If
- For Each comment As CommentInfo In CommentsController.GetCommentsByContentItem(post.ContentItemId, False, UserInfo.UserID)
+ For Each comment As CommentInfo In Core.Entities.Comments.CommentsController.GetCommentsByContentItem(post.ContentItemId, False, UserInfo.UserID)
Dim newComment As New BlogMLComment
newComment.Approved = comment.Approved
newComment.Content = New BlogMLContent()
diff --git a/Server/Blog/Components/Api/CommentsController.vb b/Server/Blog/Components/Api/CommentsController.vb
new file mode 100644
index 00000000..ae92fb41
--- /dev/null
+++ b/Server/Blog/Components/Api/CommentsController.vb
@@ -0,0 +1,428 @@
+'
+' DNN Connect - http://dnn-connect.org
+' Copyright (c) 2015
+' by DNN Connect
+'
+' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
+' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+'
+' The above copyright notice and this permission notice shall be included in all copies or substantial portions
+' of the Software.
+'
+' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+' DEALINGS IN THE SOFTWARE.
+'
+
+Imports System.Linq
+Imports System.Net
+Imports System.Net.Http
+Imports System.Web.Http
+Imports DotNetNuke.Web.Api
+Imports DotNetNuke.Modules.Blog.Core.Common
+Imports System.Xml
+Imports DotNetNuke.Modules.Blog.Core.Entities.Blogs
+Imports DotNetNuke.Modules.Blog.Core.Entities.Posts
+Imports DotNetNuke.Modules.Blog.Core.Entities.Comments
+Imports DotNetNuke.Modules.Blog.Core.Security
+Imports DotNetNuke.Modules.Blog.Core.Services
+Imports DotNetNuke.Modules.Blog.Core.Templating
+
+Namespace Api
+ Partial Public Class CommentsController
+ Inherits DnnApiController
+
+ Public Class CommentDTO
+ Public Property BlogId As Integer
+ Public Property CommentId As Integer
+ Public Property Karma As Integer
+ End Class
+
+ Public Class FullCommentDTO
+ Public Property BlogId As Integer
+ Public Property PostId As Integer
+ Public Property ParentId As Integer
+ Public Property Comment As String
+ Public Property Author As String
+ Public Property Website As String
+ Public Property Email As String
+ End Class
+
+#Region " Private Members "
+ Private Property Blog As BlogInfo = Nothing
+ Private Property Post As PostInfo = Nothing
+ Private Property Comment As CommentInfo = Nothing
+ Private Property AllComments As New List(Of CommentInfo)
+
+ Private _Settings As ModuleSettings
+ Private Property Settings() As ModuleSettings
+ Get
+ If _Settings Is Nothing Then
+ _Settings = ModuleSettings.GetModuleSettings(ActiveModule.ModuleID)
+ End If
+ Return _Settings
+ End Get
+ Set(ByVal value As ModuleSettings)
+ _Settings = value
+ End Set
+ End Property
+
+ Private _viewSettings As ViewSettings
+ Private Property ViewSettings() As ViewSettings
+ Get
+ If _viewSettings Is Nothing Then
+ _viewSettings = ViewSettings.GetViewSettings(ActiveModule.TabModuleID)
+ End If
+ Return _viewSettings
+ End Get
+ Set(ByVal value As ViewSettings)
+ _viewSettings = value
+ End Set
+ End Property
+
+ Private _Security As ContextSecurity
+ Private Property Security() As ContextSecurity
+ Get
+ If _Security Is Nothing Then
+ _Security = New ContextSecurity(ActiveModule.ModuleID, ActiveModule.TabID, Blog, UserInfo)
+ End If
+ Return _Security
+ End Get
+ Set(ByVal value As ContextSecurity)
+ _Security = value
+ End Set
+ End Property
+#End Region
+
+#Region " Service Methods "
+
+
+
+
+ Public Function ApproveComment(postData As CommentDTO) As HttpResponseMessage
+ SetContext(postData)
+ If Blog Is Nothing Or Comment Is Nothing Then
+ Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
+ End If
+ Core.Entities.Comments.CommentsController.ApproveComment(ActiveModule.ModuleID, Blog.BlogID, Comment)
+ Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "success"})
+ End Function
+
+
+
+
+
+ Public Function DeleteComment(postData As CommentDTO) As HttpResponseMessage
+ SetContext(postData)
+ If Blog Is Nothing Or Comment Is Nothing Then
+ Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
+ End If
+ Core.Entities.Comments.CommentsController.DeleteComment(ActiveModule.ModuleID, Blog.BlogID, Comment)
+ Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "success"})
+ End Function
+
+
+
+
+
+ Public Function ReportComment(postData As CommentDTO) As HttpResponseMessage
+ SetContext(postData)
+ If Blog Is Nothing Or Comment Is Nothing Then
+ Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
+ End If
+ If UserInfo.UserID < 0 Then Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
+ Dim ret As Integer = Core.Data.DataProvider.Instance.AddCommentKarma(postData.CommentId, UserInfo.UserID, postData.Karma)
+ If ret = -1 Then Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "exists"})
+ Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "success"})
+ End Function
+
+
+
+
+
+ Public Function AddComment(postData As FullCommentDTO) As HttpResponseMessage
+ SetContext(postData)
+ Post = Core.Entities.Posts.PostsController.GetPost(postData.PostId, ActiveModule.ModuleID, "")
+ If Blog Is Nothing Or Post Is Nothing Then
+ Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
+ End If
+ Dim objComment As New CommentInfo
+ objComment.ContentItemId = Post.ContentItemId
+ objComment.CreatedByUserID = UserInfo.UserID
+ objComment.ParentId = postData.ParentId
+ objComment.Comment = HttpUtility.HtmlEncode(Globals.SafeStringSimpleHtml(postData.Comment).Replace(vbCrLf, " "))
+ objComment.Approved = Security.CanAutoApproveComment Or Security.CanApproveComment Or Post.CreatedByUserID = UserInfo.UserID
+ objComment.Author = Globals.SafeString(postData.Author)
+ objComment.Email = Globals.SafeString(postData.Email)
+ objComment.Website = Globals.SafeString(postData.Website)
+ objComment.CommentID = Core.Entities.Comments.CommentsController.AddComment(Blog, Post, objComment)
+ If Not objComment.Approved Then
+ Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "successnotapproved"})
+ End If
+ Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "success"})
+ End Function
+
+
+
+
+
+ Public Function ListComments() As HttpResponseMessage
+ Dim BlogId As Integer = -1
+ Dim PostId As Integer = -1
+ BlogId = HttpContext.Current.Request.Params.ReadValue("blogId", BlogId)
+ PostId = HttpContext.Current.Request.Params.ReadValue("postId", PostId)
+ Blog = Core.Entities.Blogs.BlogsController.GetBlog(BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
+ Post = Core.Entities.Posts.PostsController.GetPost(PostId, ActiveModule.ModuleID, "")
+ If Blog Is Nothing Or Post Is Nothing Then
+ Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
+ End If
+ If Not Security.CanViewComments Then Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = ""})
+ Dim ViewSettings As ViewSettings = ViewSettings.GetViewSettings(ActiveModule.TabModuleID)
+ AllComments = Core.Entities.Comments.CommentsController.GetCommentsByContentItem(Post.ContentItemId, Security.CanApproveComment, UserInfo.UserID)
+ Dim vt As New ViewTemplate
+ Dim tmgr As New TemplateManager(PortalSettings, ViewSettings.Template)
+ With vt
+ .TemplatePath = tmgr.TemplatePath
+ .TemplateRelPath = tmgr.TemplateRelPath
+ .TemplateMapPath = tmgr.TemplateMapPath
+ .DefaultReplacer = New BlogTokenReplace(ActiveModule, Security, Blog, Post, Settings, ViewSettings)
+ .StartTemplate = "CommentsTemplate.html"
+ End With
+ AddHandler vt.GetData, AddressOf TemplateGetData
+ vt.DataBind()
+ Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = vt.GetContentsAsString})
+ End Function
+
+
+
+
+ Public Function Pingback() As HttpResponseMessage
+
+ Dim BlogId As Integer = -1
+ Dim PostId As Integer = -1
+ BlogId = HttpContext.Current.Request.Params.ReadValue("blogId", BlogId)
+ PostId = HttpContext.Current.Request.Params.ReadValue("postId", PostId)
+ Blog = Core.Entities.Blogs.BlogsController.GetBlog(BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
+ If Not Blog.EnablePingBackReceive Then
+ Return Request.CreateResponse(HttpStatusCode.NotFound, New With {.Result = "This blog does not accept pingbacks"})
+ End If
+ Post = Core.Entities.Posts.PostsController.GetPost(PostId, ActiveModule.ModuleID, "")
+ If Post Is Nothing Then
+ Return PingBackError(32, "The specified target URI does not exist.")
+ End If
+
+ Dim doc As XmlDocument = RetrieveXmlDocument(HttpContext.Current)
+ Dim list As XmlNodeList = If(doc.SelectNodes("methodCall/params/param/value/string"), doc.SelectNodes("methodCall/params/param/value"))
+
+ If list Is Nothing Then
+ Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "Cannot parse the request"})
+ End If
+
+ Dim sourceUrl As String = Globals.SafeString(list(0).InnerText.Trim())
+ Dim targetUrl As String = Globals.SafeString(list(1).InnerText.Trim())
+
+ Dim containsHtml As Boolean = False
+ Dim sourceHasLink As Boolean = False
+ Dim title As String = sourceUrl
+
+ Try
+ CheckSourcePage(sourceUrl, targetUrl, sourceHasLink, title)
+ Catch ex As Exception
+ End Try
+
+ If Not IsFirstPingBack(Post, sourceUrl) Then
+ Return PingBackError(48, "The pingback has already been registered.")
+ End If
+
+ If Not sourceHasLink Then
+ Return PingBackError(17, "The source URI does not contain a link to the target URI, and so cannot be used as a source.")
+ End If
+
+ If containsHtml Then
+ ' spam
+ Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "Cannot parse the request"})
+ Else
+ Dim objComment As New CommentInfo With {.ContentItemId = Post.ContentItemId, .Author = GetDomain(sourceUrl), .Website = sourceUrl}
+ Dim comment As String = String.Format(DotNetNuke.Services.Localization.Localization.GetString("PingbackComment", Globals.SharedResourceFileName), objComment.Author, sourceUrl, title)
+ objComment.Comment = HttpUtility.HtmlEncode(comment)
+ objComment.Approved = Blog.AutoApprovePingBack
+ objComment.CommentID = Core.Entities.Comments.CommentsController.AddComment(Blog, Post, objComment)
+ Return PingBackSuccess()
+ End If
+
+ End Function
+
+
+
+
+ Public Function Trackback() As HttpResponseMessage
+
+ Dim BlogId As Integer = -1
+ Dim PostId As Integer = -1
+ BlogId = HttpContext.Current.Request.Params.ReadValue("blogId", BlogId)
+ PostId = HttpContext.Current.Request.Params.ReadValue("postId", PostId)
+ Blog = Core.Entities.Blogs.BlogsController.GetBlog(BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
+ If Not Blog.EnableTrackBackReceive Then
+ Return Request.CreateResponse(HttpStatusCode.NotFound, New With {.Result = "This blog does not accept trackbacks"})
+ End If
+ Post = Core.Entities.Posts.PostsController.GetPost(PostId, ActiveModule.ModuleID, "")
+ If Post Is Nothing Then
+ Return TrackBackResponse("The source page does not link")
+ End If
+
+ Dim title As String = Globals.SafeString(HttpContext.Current.Request.Params("title"))
+ Dim excerpt As String = Globals.SafeString(HttpContext.Current.Request.Params("excerpt"))
+ Dim blogName As String = Globals.SafeString(HttpContext.Current.Request.Params("blog_name"))
+ Dim sourceUrl As String = String.Empty
+ If HttpContext.Current.Request.Params("url") IsNot Nothing Then
+ sourceUrl = Globals.SafeString(HttpContext.Current.Request.Params("url").Split(","c)(0), DotNetNuke.Security.PortalSecurity.FilterFlag.NoSQL And DotNetNuke.Security.PortalSecurity.FilterFlag.NoScripting)
+ End If
+
+ Dim sourceHasLink As Boolean = False
+
+ Try
+ CheckSourcePage(sourceUrl, Post.PermaLink(PortalSettings), sourceHasLink, title)
+ Catch ex As Exception
+ End Try
+
+ If Not IsFirstPingBack(Post, sourceUrl) Then
+ Return TrackBackResponse("Trackback already registered")
+ End If
+
+ If Not sourceHasLink Then
+ Return TrackBackResponse("The source page does not link")
+ End If
+
+ Dim objComment As New CommentInfo With {.ContentItemId = Post.ContentItemId, .Author = blogName, .Website = sourceUrl}
+ Dim comment As String = String.Format(DotNetNuke.Services.Localization.Localization.GetString("TrackbackComment", Globals.SharedResourceFileName), blogName, sourceUrl, title)
+ objComment.Comment = HttpUtility.HtmlEncode(comment)
+ objComment.Approved = Blog.AutoApproveTrackBack
+ objComment.CommentID = Core.Entities.Comments.CommentsController.AddComment(Blog, Post, objComment)
+ Return TrackBackResponse()
+
+ End Function
+#End Region
+
+#Region " Private Methods "
+ Private Sub SetContext(data As CommentDTO)
+ Blog = Core.Entities.Blogs.BlogsController.GetBlog(data.BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
+ Comment = Core.Entities.Comments.CommentsController.GetComment(data.CommentId, UserInfo.UserID)
+ End Sub
+
+ Private Sub SetContext(data As FullCommentDTO)
+ Blog = Core.Entities.Blogs.BlogsController.GetBlog(data.BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
+ End Sub
+
+ Private Sub TemplateGetData(ByVal DataSource As String, ByVal Parameters As Dictionary(Of String, String), ByRef Replacers As System.Collections.Generic.List(Of GenericTokenReplace), ByRef Arguments As System.Collections.Generic.List(Of String()), callingObject As Object)
+
+ Select Case DataSource.ToLower
+
+ Case "comments"
+
+ If callingObject IsNot Nothing AndAlso TypeOf callingObject Is CommentInfo Then
+ Dim parent As Integer = CType(callingObject, CommentInfo).CommentID
+ For Each c As CommentInfo In AllComments.Where(Function(cmt) cmt.ParentId = parent).OrderBy(Function(cmt) cmt.CreatedOnDate)
+ Replacers.Add(New BlogTokenReplace(ActiveModule, Security, Blog, Post, Settings, ViewSettings, c))
+ Next
+ Else
+ For Each c As CommentInfo In AllComments.Where(Function(cmt) cmt.ParentId = -1).OrderBy(Function(cmt) cmt.CreatedOnDate)
+ Replacers.Add(New BlogTokenReplace(ActiveModule, Security, Blog, Post, Settings, ViewSettings, c))
+ Next
+ End If
+
+ End Select
+
+ End Sub
+
+ Private Shared Function RetrieveXmlDocument(context As HttpContext) As XmlDocument
+ Dim xml As String = ParseRequest(context)
+ If Not xml.Contains("pingback.ping") Then
+ context.Response.StatusCode = 404
+ context.Response.[End]()
+ End If
+ Dim doc As New XmlDocument()
+ doc.LoadXml(xml)
+ Return doc
+ End Function
+
+ Private Shared Function ParseRequest(context As HttpContext) As String
+ Dim buffer(CInt(context.Request.InputStream.Length - 1)) As Byte
+ context.Request.InputStream.Read(buffer, 0, buffer.Length)
+ Return Encoding.[Default].GetString(buffer)
+ End Function
+
+ Private Shared Function IsFirstPingBack(post As PostInfo, sourceUrl As String) As Boolean
+ For Each c As CommentInfo In Core.Entities.Comments.CommentsController.GetCommentsByContentItem(post.ContentItemId, True, -1)
+ If c.Website.ToString.Equals(sourceUrl, StringComparison.OrdinalIgnoreCase) Then Return False
+ Next
+ Return True
+ End Function
+
+ Private Shared Function TrackBackResponse() As HttpResponseMessage
+ Return TrackBackResponse("0")
+ End Function
+ Private Shared Function TrackBackResponse(status As String) As HttpResponseMessage
+ Dim reply As String = String.Format("{0}", status)
+ Dim res As New HttpResponseMessage(HttpStatusCode.OK)
+ res.Content = New StringContent(reply, System.Text.Encoding.UTF8, "application/xml")
+ Return res
+ End Function
+
+ Private Shared Function PingBackSuccess() As HttpResponseMessage
+ Dim Success As String = "Thanks!"
+ Dim res As New HttpResponseMessage(HttpStatusCode.OK)
+ res.Content = New StringContent(Success, System.Text.Encoding.UTF8, "application/xml")
+ Return res
+ End Function
+
+ Private Shared Function PingBackError(code As Integer, message As String) As HttpResponseMessage
+ Dim sb As New StringBuilder()
+ sb.Append("")
+ sb.Append("")
+ sb.Append("")
+ sb.Append("")
+ sb.Append("")
+ sb.Append("")
+ sb.Append("faultCode")
+ sb.AppendFormat("{0}", code)
+ sb.Append("")
+ sb.Append("")
+ sb.Append("faultString")
+ sb.AppendFormat("{0}", message)
+ sb.Append("")
+ sb.Append("")
+ sb.Append("")
+ sb.Append("")
+ sb.Append("")
+ Dim res As New HttpResponseMessage(HttpStatusCode.OK)
+ res.Content = New StringContent(sb.ToString, System.Text.Encoding.UTF8, "application/xml")
+ Return res
+ End Function
+
+ Private Shared Function GetDomain(sourceUrl As String) As String
+ Dim start As Integer = sourceUrl.IndexOf("://") + 3
+ Dim [stop] As Integer = sourceUrl.IndexOf("/", start)
+ Return sourceUrl.Substring(start, [stop] - start).Replace("www.", String.Empty)
+ End Function
+
+ Private Shared Sub CheckSourcePage(sourceUrl As String, targetUrl As String, ByRef sourceContainsLink As Boolean, ByRef title As String)
+
+ Dim remoteFile As New WebPage(New Uri(sourceUrl))
+ Dim html As String = remoteFile.GetFileAsString()
+ Dim RegexTitle As New Regex("(?<=)([\s\S]*)(?=)", RegexOptions.IgnoreCase Or RegexOptions.Compiled)
+ Dim titleMatch As Match = RegexTitle.Match(html)
+ If titleMatch.Success Then title = Globals.SafeString(titleMatch.Value.Trim(CChar(vbCrLf)).Trim())
+ html = html.ToUpperInvariant
+ targetUrl = targetUrl.ToUpperInvariant
+ sourceContainsLink = html.Contains("HREF=""" & targetUrl & """") OrElse html.Contains("HREF='" & targetUrl & "'")
+
+ End Sub
+#End Region
+
+ End Class
+End Namespace
+
diff --git a/Server/Blog/Components/Api/NotificationServiceController.vb b/Server/Blog/Components/Api/NotificationServiceController.vb
new file mode 100644
index 00000000..1f0824f1
--- /dev/null
+++ b/Server/Blog/Components/Api/NotificationServiceController.vb
@@ -0,0 +1,137 @@
+'
+' DotNetNuke® - http://www.dotnetnuke.com
+' Copyright (c) 2002-2011
+' by DotNetNuke Corporation
+'
+' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
+' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+'
+' The above copyright notice and this permission notice shall be included in all copies or substantial portions
+' of the Software.
+'
+' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+' DEALINGS IN THE SOFTWARE.
+'
+Option Strict On
+Option Explicit On
+Imports System.Net
+Imports System.Net.Http
+Imports System.Web.Http
+Imports DotNetNuke.Modules.Blog.Core.Entities.Blogs
+Imports DotNetNuke.Modules.Blog.Core.Entities.Comments
+Imports DotNetNuke.Modules.Blog.Core.Entities.Posts
+Imports DotNetNuke.Modules.Blog.Core.Integration
+Imports DotNetNuke.Modules.Blog.Core.Services
+Imports DotNetNuke.Services.Social.Notifications
+Imports DotNetNuke.Web.Api
+
+Namespace Api
+
+ Public Class NotificationServiceController
+ Inherits DnnApiController
+
+ Public Class NotificationDTO
+ Public Property NotificationId As Integer
+ End Class
+
+#Region " Private Members "
+
+ Private Property BlogModuleId As Integer = -1
+ Private Property BlogId As Integer = -1
+ Private Property Blog As BlogInfo = Nothing
+ Private Property ContentItemId As Integer = -1
+ Private Property Post As PostInfo = Nothing
+ Private Property CommentId As Integer = -1
+ Private Property Comment As CommentInfo = Nothing
+
+#End Region
+
+#Region " Service Methods "
+
+
+
+ Public Function ApprovePost(postData As NotificationDTO) As HttpResponseMessage
+ Dim notify As Notification = NotificationsController.Instance.GetNotification(postData.NotificationId)
+ ParsePublishKey(notify.Context)
+ If Blog Is Nothing Or Post Is Nothing Then
+ Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
+ End If
+ Post.Published = True
+ Core.Entities.Posts.PostsController.UpdatePost(Post, UserInfo.UserID)
+ NotificationsController.Instance().DeleteNotification(postData.NotificationId)
+ Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "success"})
+ End Function
+
+
+
+
+ Public Function DeletePost(postData As NotificationDTO) As HttpResponseMessage
+ Dim notify As Notification = NotificationsController.Instance.GetNotification(postData.NotificationId)
+ ParsePublishKey(notify.Context)
+ If Blog Is Nothing Or Post Is Nothing Then
+ Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
+ End If
+ Core.Entities.Posts.PostsController.DeletePost(ContentItemId)
+ NotificationsController.Instance().DeleteNotification(postData.NotificationId)
+ Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "success"})
+ End Function
+
+
+
+
+ Public Function ApproveComment(postData As NotificationDTO) As HttpResponseMessage
+ Dim notify As Notification = NotificationsController.Instance.GetNotification(postData.NotificationId)
+ ParseCommentKey(notify.Context)
+ If Blog Is Nothing Or Post Is Nothing Or Comment Is Nothing Then
+ Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
+ End If
+ Core.Entities.Comments.CommentsController.ApproveComment(BlogModuleId, BlogId, Comment)
+ NotificationsController.Instance().DeleteNotification(postData.NotificationId)
+ Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "success"})
+ End Function
+
+
+
+
+ Public Function DeleteComment(postData As NotificationDTO) As HttpResponseMessage
+ Dim notify As Notification = NotificationsController.Instance.GetNotification(postData.NotificationId)
+ ParseCommentKey(notify.Context)
+ If Blog Is Nothing Or Post Is Nothing Or Comment Is Nothing Then
+ Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
+ End If
+ Core.Entities.Comments.CommentsController.DeleteComment(BlogModuleId, BlogId, Comment)
+ NotificationsController.Instance().DeleteNotification(postData.NotificationId)
+ Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "success"})
+ End Function
+#End Region
+
+#Region " Private Methods "
+ Private Sub ParsePublishKey(key As String)
+ Dim nKey As New NotificationKey(key)
+ BlogModuleId = nKey.ModuleId
+ BlogId = nKey.BlogId
+ ContentItemId = nKey.ContentItemId
+ Blog = Core.Entities.Blogs.BlogsController.GetBlog(BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
+ Post = Core.Entities.Posts.PostsController.GetPost(ContentItemId, BlogModuleId, Threading.Thread.CurrentThread.CurrentCulture.Name)
+ End Sub
+
+ Private Sub ParseCommentKey(key As String)
+ Dim nKey As New NotificationKey(key)
+ BlogModuleId = nKey.ModuleId
+ BlogId = nKey.BlogId
+ ContentItemId = nKey.ContentItemId
+ CommentId = nKey.CommentId
+ Blog = Core.Entities.Blogs.BlogsController.GetBlog(BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
+ Post = Core.Entities.Posts.PostsController.GetPost(ContentItemId, BlogModuleId, Threading.Thread.CurrentThread.CurrentCulture.Name)
+ Comment = Core.Entities.Comments.CommentsController.GetComment(CommentId, UserInfo.UserID)
+ End Sub
+#End Region
+
+ End Class
+
+End Namespace
\ No newline at end of file
diff --git a/Server/Blog/Components/Api/PostsController.vb b/Server/Blog/Components/Api/PostsController.vb
new file mode 100644
index 00000000..6076f513
--- /dev/null
+++ b/Server/Blog/Components/Api/PostsController.vb
@@ -0,0 +1,92 @@
+'
+' DNN Connect - http://dnn-connect.org
+' Copyright (c) 2015
+' by DNN Connect
+'
+' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
+' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+'
+' The above copyright notice and this permission notice shall be included in all copies or substantial portions
+' of the Software.
+'
+' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+' DEALINGS IN THE SOFTWARE.
+'
+
+Imports System.Net
+Imports System.Net.Http
+Imports System.Web.Http
+Imports DotNetNuke.Modules.Blog.Core.Entities.Blogs
+Imports DotNetNuke.Modules.Blog.Core.Entities.Posts
+Imports DotNetNuke.Modules.Blog.Core.Services
+Imports DotNetNuke.Web.Api
+
+Namespace Api
+ Partial Public Class PostsController
+ Inherits DnnApiController
+
+ Public Class PostDTO
+ Public Property BlogId As Integer
+ Public Property PostId As Integer
+ End Class
+
+#Region " Private Members "
+ Private Property Blog As BlogInfo = Nothing
+ Private Property Post As PostInfo = Nothing
+#End Region
+
+#Region " Service Methods "
+
+
+
+
+ Public Function ApprovePost(postData As PostDTO) As HttpResponseMessage
+ SetContext(postData)
+ If Blog Is Nothing Or Post Is Nothing Then
+ Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
+ End If
+ Core.Entities.Posts.PostsController.PublishPost(Post, True, UserInfo.UserID)
+ Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "success"})
+ End Function
+
+
+
+
+
+ Public Function DeletePost(postData As PostDTO) As HttpResponseMessage
+ SetContext(postData)
+ If Blog Is Nothing Or Post Is Nothing Then
+ Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
+ End If
+ Core.Entities.Posts.PostsController.DeletePost(Post)
+ Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "success"})
+ End Function
+
+
+
+
+
+ Public Function ViewPost(postData As PostDTO) As HttpResponseMessage
+ SetContext(postData)
+ If Blog Is Nothing Or Post Is Nothing Then
+ Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
+ End If
+ Core.Data.DataProvider.Instance.AddPostView(postData.PostId)
+ Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "success"})
+ End Function
+#End Region
+
+#Region " Private Methods "
+ Private Sub SetContext(data As PostDTO)
+ Blog = Core.Entities.Blogs.BlogsController.GetBlog(data.BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
+ Post = Core.Entities.Posts.PostsController.GetPost(data.PostId, ActiveModule.ModuleID, Threading.Thread.CurrentThread.CurrentCulture.Name)
+ End Sub
+#End Region
+
+ End Class
+End Namespace
\ No newline at end of file
diff --git a/Server/Blog/Components/Api/TermsController.vb b/Server/Blog/Components/Api/TermsController.vb
new file mode 100644
index 00000000..5037da6c
--- /dev/null
+++ b/Server/Blog/Components/Api/TermsController.vb
@@ -0,0 +1,64 @@
+'
+' DNN Connect - http://dnn-connect.org
+' Copyright (c) 2015
+' by DNN Connect
+'
+' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
+' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+'
+' The above copyright notice and this permission notice shall be included in all copies or substantial portions
+' of the Software.
+'
+' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+' DEALINGS IN THE SOFTWARE.
+'
+
+Imports System.Linq
+Imports System.Net
+Imports System.Net.Http
+Imports System.Web.Http
+Imports DotNetNuke.Web.Api
+
+Namespace Api
+ Partial Public Class TermsController
+ Inherits DnnApiController
+
+ Private Const DisallowedCharacters As String = "%?*&;:'\\"
+
+#Region " Service Methods "
+
+
+
+ Public Function Search() As HttpResponseMessage
+ Dim queryString As NameValueCollection = HttpUtility.ParseQueryString(Request.RequestUri.Query)
+ Dim searchString As String = queryString("term")
+ Dim vocab As Integer = Integer.Parse(queryString("vocab"))
+ Dim colTerms As IEnumerable(Of String) = Core.Entities.Terms.TermsController.GetTermsByVocabulary(ActiveModule.ModuleID, vocab, Threading.Thread.CurrentThread.CurrentCulture.Name).Values.Where(Function(t) t.LocalizedName.IndexOfAny(DisallowedCharacters.ToCharArray()) = -1 And t.LocalizedName.ToLower().Contains(searchString.ToLower())).Select(Function(t) t.LocalizedName)
+ Return Request.CreateResponse(HttpStatusCode.OK, colTerms)
+ End Function
+
+
+
+
+ Public Function GetVocabularyML(vocabularyId As Integer) As HttpResponseMessage
+ Dim res As New List(Of TermML)
+ For Each t As Core.Entities.Terms.TermInfo In Core.Entities.Terms.TermsController.GetTermsByVocabulary(ActiveModule.ModuleID, vocabularyId, "").Values
+ res.Add(New TermML With {.TermID = t.TermId, .DefaultName = t.Name, .LocNames = t.NameLocalizations.GetDictionary})
+ Next
+ Return Request.CreateResponse(HttpStatusCode.OK, res)
+ End Function
+#End Region
+
+ Public Structure TermML
+ Public TermID As Integer
+ Public DefaultName As String
+ Public LocNames As Dictionary(Of String, String)
+ End Structure
+
+ End Class
+End Namespace
\ No newline at end of file
diff --git a/Server/Blog/Components/BlogML/BlogMLBlogExtendedProperties.vb b/Server/Blog/Components/BlogML/BlogMLBlogExtendedProperties.vb
deleted file mode 100644
index 0ff58ba8..00000000
--- a/Server/Blog/Components/BlogML/BlogMLBlogExtendedProperties.vb
+++ /dev/null
@@ -1,6 +0,0 @@
-Namespace BlogML
- Public Class BlogMLBlogExtendedProperties
- Public Shared ReadOnly CommentModeration As String = "CommentModeration"
- Public Shared ReadOnly EnableSendingTrackbacks As String = "SendTrackback"
- End Class
-End Namespace
\ No newline at end of file
diff --git a/Server/Blog/Components/BlogML/BlogMLResource.vb b/Server/Blog/Components/BlogML/BlogMLResource.vb
deleted file mode 100644
index 0f2daec0..00000000
--- a/Server/Blog/Components/BlogML/BlogMLResource.vb
+++ /dev/null
@@ -1,85 +0,0 @@
-Imports System.IO
-Imports System.Xml
-Imports System.Xml.Schema
-
-Namespace BlogML
-
- Public Class BlogMLResource
- ' TODO: Update to .NET 2.0
- Public Shared Function GetSchemaStream() As Stream
- Dim stream As Stream = GetType(BlogMLResource).Assembly.GetManifestResourceStream("BlogML.BlogML.xsd")
- If stream Is Nothing Then
- Throw New InvalidOperationException("Schema not found")
- End If
- Return stream
- End Function
-
- Public Shared Function GetSchema() As XmlSchema
-
- Dim schema As XmlSchema = XmlSchema.Read(GetSchemaStream(), New ValidationEventHandler(AddressOf ValidationEvent))
- Return schema
-
- End Function
-
- Private Shared Sub ValidationEvent(sender As [Object], e As ValidationEventArgs)
- Dim message As String = String.Format("Validation {0}: {1}", e.Severity, e.Message)
- Throw New InvalidOperationException(message)
- End Sub
-
-
- Public Shared Sub Validate(inputUri As String)
- Validate(inputUri, Nothing)
- End Sub
-
-
- Public Shared Sub Validate(inputUri As String, validationHandler As ValidationEventHandler)
- Dim reader As XmlTextReader = Nothing
- Try
- reader = New XmlTextReader(inputUri)
- Validate(reader, validationHandler)
- Finally
- If reader IsNot Nothing Then
- reader.Close()
-
- End If
- End Try
- End Sub
-
- Public Shared Sub Validate(reader As XmlTextReader)
- Validate(reader, Nothing)
- End Sub
-
-
- Public Shared Sub Validate(treader As XmlTextReader, validationHandler As ValidationEventHandler)
- Dim validator As XmlReaderSettings = Nothing
- Try
- validator = New XmlReaderSettings()
- Dim schema As XmlSchema = GetSchema()
- validator.Schemas.Add(schema)
- validator.ValidationType = ValidationType.Schema
-
-
- If validationHandler IsNot Nothing Then
- AddHandler validator.ValidationEventHandler, validationHandler
- Else
- AddHandler validator.ValidationEventHandler, New ValidationEventHandler(AddressOf ValidationEvent)
- End If
-
- Dim objXmlReader As XmlReader = XmlReader.Create(treader, validator)
-
-
- While objXmlReader.Read()
- End While
- Catch ex As Exception
- 'Console.WriteLine(ex.ToString())
- Throw
- Finally
- If validationHandler IsNot Nothing Then
- RemoveHandler validator.ValidationEventHandler, validationHandler
- Else
- RemoveHandler validator.ValidationEventHandler, New ValidationEventHandler(AddressOf ValidationEvent)
- End If
- End Try
- End Sub
- End Class
-End Namespace
\ No newline at end of file
diff --git a/Server/Blog/Components/BlogML/BlogMLWriterBase.vb b/Server/Blog/Components/BlogML/BlogMLWriterBase.vb
deleted file mode 100644
index 09152e82..00000000
--- a/Server/Blog/Components/BlogML/BlogMLWriterBase.vb
+++ /dev/null
@@ -1,424 +0,0 @@
-Imports System.Xml
-Imports System.IO
-Imports DotNetNuke.Modules.Blog.BlogML.Xml
-
-Namespace BlogML
-
- Public MustInherit Class BlogMLWriterBase
- Private Const BlogMLNamespace As String = "http://www.blogml.com/2006/09/BlogML"
-
- Protected Property Writer() As XmlWriter
- Get
- Return m_Writer
- End Get
- Private Set(value As XmlWriter)
- m_Writer = Value
- End Set
- End Property
- Private m_Writer As XmlWriter
-
- Public Sub Write(writer__1 As XmlWriter)
- Writer = writer__1
-
- 'Write the XML delcaration.
- writer__1.WriteStartDocument()
-
- Try
- InternalWriteBlog()
- Finally
- Writer = Nothing
- End Try
- End Sub
-
- Protected MustOverride Sub InternalWriteBlog()
-
-#Region "WriteStartBlog"
-
-
- Protected Sub WriteStartBlog(title As String, subTitle As String, rootUrl As String)
- WriteStartBlog(title, ContentTypes.Text, subTitle, ContentTypes.Text, rootUrl, DateTime.Now)
- End Sub
-
- Protected Sub WriteStartBlog(title As String, subTitle As String, rootUrl As String, dateCreated As DateTime)
- WriteStartBlog(title, ContentTypes.Text, subTitle, ContentTypes.Text, rootUrl, dateCreated)
- End Sub
-
- Protected Sub WriteStartBlog(title As String, titleContentType As ContentTypes, subTitle As String, subTitleContentType As ContentTypes, rootUrl As String, dateCreated As DateTime)
- 'WriteStartElement("blog");
- Writer.WriteStartElement("blog", BlogMLNamespace)
- ' fixes bug in Work Item 2004
- WriteAttributeStringRequired("root-url", rootUrl)
- WriteAttributeString("date-created", FormatDateTime(dateCreated))
-
- ' Write the default namespace, identified as xmlns with no prefix
- Writer.WriteAttributeString("xmlns", Nothing, Nothing, "http://www.blogml.com/2006/09/BlogML")
- Writer.WriteAttributeString("xmlns", "xs", Nothing, "http://www.w3.org/2001/XMLSchema")
-
- WriteContent("title", BlogMLContent.Create(title, titleContentType))
- WriteContent("sub-title", BlogMLContent.Create(subTitle, subTitleContentType))
- End Sub
-
-#End Region
-
- Protected Sub WriteStartElement(tag As String)
- Writer.WriteStartElement(tag)
- End Sub
-
-
- Protected Sub WriteEndElement()
- Writer.WriteEndElement()
- End Sub
-
-
-#Region "Extended Properties"
-
- Protected Sub WriteStartExtendedProperties()
- WriteStartElement("extended-properties")
- End Sub
-
- Protected Sub WriteExtendedProperty(name As String, value As String)
- WriteStartElement("property")
- WriteAttributeString("name", name)
- WriteAttributeString("value", value)
- WriteEndElement()
- End Sub
-
-#End Region
-
-
- Protected Sub WriteAuthor(id As String, name As String, email As String, dateCreated As DateTime, dateModified As DateTime, approved As Boolean)
- WriteStartElement("author")
- WriteNodeAttributes(id, dateCreated, dateModified, approved)
- WriteAttributeString("email", email)
- WriteContent("title", BlogMLContent.Create(name, ContentTypes.Text))
- WriteEndElement()
- End Sub
-
-
- Protected Sub WriteCategory(id As String, title As String, dateCreated As DateTime, dateModified As DateTime, approved As Boolean, description As String, _
- parentRef As String)
- WriteCategory(id, title, ContentTypes.Text, dateCreated, dateModified, approved, _
- description, parentRef)
- End Sub
-
-
- Protected Sub WriteCategory(id As String, title As String, titleContentType As ContentTypes, dateCreated As DateTime, dateModified As DateTime, approved As Boolean, _
- description As String, parentRef As String)
- WriteStartElement("category")
- WriteNodeAttributes(id, dateCreated, dateModified, approved)
- WriteAttributeString("description", description)
- WriteAttributeString("parentref", parentRef)
- WriteContent("title", BlogMLContent.Create(title, titleContentType))
- WriteEndElement()
- End Sub
-
- Protected Sub WriteAuthorReference(refId As String)
- WriteStartElement("author")
- WriteAttributeStringRequired("ref", refId)
- WriteEndElement()
- End Sub
-
- Protected Sub WriteCategoryReference(refId As String)
- WriteStartElement("category")
- WriteAttributeStringRequired("ref", refId)
- WriteEndElement()
- End Sub
-
- Protected Sub WriteStartAuthors()
- WriteStartElement("authors")
- End Sub
-
- Protected Sub WriteStartCategories()
- WriteStartElement("categories")
- End Sub
-
-
- Protected Sub WriteStartPosts()
- WriteStartElement("posts")
- End Sub
-
-
- Protected Sub WriteStartTrackbacks()
- WriteStartElement("trackbacks")
- End Sub
-
-
- Protected Sub WriteStartAttachments()
- WriteStartElement("attachments")
- End Sub
-
-
- Protected Sub WriteNodeAttributes(id As String, dateCreated As DateTime, dateModified As DateTime, approved As Boolean)
- WriteAttributeString("id", id)
- WriteAttributeString("date-created", FormatDateTime(dateCreated))
- WriteAttributeString("date-modified", FormatDateTime(dateModified))
- WriteAttributeString("approved", If(approved, "true", "false"))
- End Sub
-
-
- Protected Function FormatDateTime([date] As DateTime) As String
- Return [date].ToUniversalTime().ToString("s")
- End Function
-
- Protected Sub WriteStartPost(id As String, title As String, dateCreated As DateTime, dateModified As DateTime, approved As Boolean, content As String, _
- postUrl As String)
- WriteStartPost(id, title, ContentTypes.Text, dateCreated, dateModified, approved, _
- content, ContentTypes.Text, postUrl, 0, False, Nothing, _
- ContentTypes.Text, BlogPostTypes.Normal, String.Empty)
- End Sub
-
- Protected Sub WriteStartPost(id As String, title As String, dateCreated As DateTime, dateModified As DateTime, approved As Boolean, content As String, _
- postUrl As String, views As UInt32, blogpostType As BlogPostTypes, postName As String)
- WriteStartPost(id, title, ContentTypes.Text, dateCreated, dateModified, approved, _
- content, ContentTypes.Text, postUrl, views, False, Nothing, _
- ContentTypes.Text, blogpostType, postName)
- End Sub
-
- Protected Sub WriteStartPost(id As String, title As String, dateCreated As DateTime, dateModified As DateTime, approved As Boolean, content As String, _
- postUrl As String, views As UInt32, excerpt As String, blogpostType As BlogPostTypes, postName As String)
- WriteStartPost(id, title, ContentTypes.Text, dateCreated, dateModified, approved, _
- content, ContentTypes.Text, postUrl, views, True, excerpt, _
- ContentTypes.Text, blogpostType, postName)
- End Sub
-
- Protected Sub WriteStartPost(id As String, title As BlogMLContent, dateCreated As DateTime, dateModified As DateTime, approved As Boolean, content As BlogMLContent, _
- postUrl As String, views As UInt32, hasexcerpt As Boolean, excerpt As BlogMLContent, blogpostType As BlogPostTypes, postName As String)
- WriteStartElement("post")
- WriteNodeAttributes(id, dateCreated, dateModified, approved)
- WriteAttributeString("post-url", postUrl)
- WriteAttributeStringRequired("type", blogpostType.ToString().ToLower())
- WriteAttributeStringRequired("hasexcerpt", hasexcerpt.ToString().ToLower())
- WriteAttributeStringRequired("views", views.ToString())
- WriteContent("title", title)
- WriteContent("content", content)
- If postName IsNot Nothing Then
- WriteContent("post-name", BlogMLContent.Create(postName, ContentTypes.Text))
- End If
- If hasexcerpt Then
- WriteContent("excerpt", excerpt)
- End If
- End Sub
-
- Protected Sub WriteStartPost(id As String, title As String, titleContentType As ContentTypes, dateCreated As DateTime, dateModified As DateTime, approved As Boolean, _
- content As String, postContentType As ContentTypes, postUrl As String, views As UInt32, hasexcerpt As Boolean, excerpt As String, _
- excerptContentType As ContentTypes, blogpostType As BlogPostTypes, postName As String)
- WriteStartElement("post")
- WriteNodeAttributes(id, dateCreated, dateModified, approved)
- WriteAttributeString("post-url", postUrl)
- WriteAttributeStringRequired("type", blogpostType.ToString().ToLower())
- WriteAttributeStringRequired("hasexcerpt", hasexcerpt.ToString().ToLower())
- WriteAttributeStringRequired("views", views.ToString())
- WriteContent("title", BlogMLContent.Create(title, titleContentType))
- WriteContent("content", BlogMLContent.Create(content, postContentType))
- If postName IsNot Nothing Then
- WriteContent("post-name", BlogMLContent.Create(postName, ContentTypes.Text))
- End If
- If hasexcerpt Then
- WriteContent("excerpt", BlogMLContent.Create(excerpt, excerptContentType))
- End If
- End Sub
-
- Protected Sub WriteStartComments()
- WriteStartElement("comments")
- End Sub
-
-
- Protected Sub WriteComment(id As String, title As String, dateCreated As DateTime, dateModified As DateTime, approved As Boolean, userName As String, _
- userEmail As String, userUrl As String, content As String)
- WriteComment(id, title, ContentTypes.Text, dateCreated, dateModified, approved, _
- userName, userEmail, userUrl, content, ContentTypes.Text)
- End Sub
-
- Protected Sub WriteComment(id As String, title As BlogMLContent, dateCreated As DateTime, dateModified As DateTime, approved As Boolean, userName As String, _
- userEmail As String, userUrl As String, content As BlogMLContent)
- WriteStartElement("comment")
- WriteNodeAttributes(id, dateCreated, dateModified, approved)
- WriteAttributeStringRequired("user-name", If(userName, ""))
- WriteAttributeString("user-url", If(userUrl, ""))
- WriteAttributeString("user-email", If(userEmail, ""))
- WriteContent("title", title)
- WriteContent("content", content)
- WriteEndElement()
- End Sub
-
-
- Protected Sub WriteComment(id As String, title As String, titleContentType As ContentTypes, dateCreated As DateTime, dateModified As DateTime, approved As Boolean, _
- userName As String, userEmail As String, userUrl As String, content As String, commentContentType As ContentTypes)
- WriteStartElement("comment")
- WriteNodeAttributes(id, dateCreated, dateModified, approved)
- WriteAttributeStringRequired("user-name", If(userName, ""))
- WriteAttributeString("user-url", If(userUrl, ""))
- WriteAttributeString("user-email", If(userEmail, ""))
- WriteContent("title", BlogMLContent.Create(title, titleContentType))
- WriteContent("content", BlogMLContent.Create(content, commentContentType))
- WriteEndElement()
- End Sub
-
-
- Protected Sub WriteTrackback(id As String, title As String, dateCreated As DateTime, dateModified As DateTime, approved As Boolean, url As String)
- WriteTrackback(id, title, ContentTypes.Text, dateCreated, dateModified, approved, _
- url)
- End Sub
-
-
- Protected Sub WriteTrackback(id As String, title As String, titleContentType As ContentTypes, dateCreated As DateTime, dateModified As DateTime, approved As Boolean, _
- url As String)
- WriteStartElement("trackback")
- WriteNodeAttributes(id, dateCreated, dateModified, approved)
- WriteAttributeStringRequired("url", url)
- WriteContent("title", BlogMLContent.Create(title, titleContentType))
- WriteEndElement()
- End Sub
-
-
- Protected Sub WriteAttributeStringRequired(name As String, value As String)
- If String.IsNullOrEmpty(value) Then
- Throw New ArgumentNullException("value", name)
- End If
- Writer.WriteAttributeString(name, value)
- End Sub
-
-
- Protected Sub WriteAttributeString(name As String, value As String)
- If Not String.IsNullOrEmpty(value) Then
- Writer.WriteAttributeString(name, value)
- End If
- End Sub
-
- Protected Sub WriteContent(elementName As String, content As BlogMLContent)
- WriteStartElement(elementName)
- Dim contentType As String = (If([Enum].GetName(GetType(ContentTypes), content.ContentType), "text")).ToLowerInvariant()
- WriteAttributeString("type", contentType)
- Writer.WriteCData(If(content.Text, String.Empty))
- WriteEndElement()
- End Sub
-
- Protected Sub WriteAttachment(externalUri As String, mimeType As String, fullUrl As String)
- WriteAttachment(fullUrl, 0, mimeType, externalUri, False, Nothing)
- End Sub
-
- Protected Sub WriteAttachment(embeddedUrl As String, mimeType As String, inputStream As Stream)
- Using reader As New BinaryReader(inputStream)
- reader.BaseStream.Position = 0
- Dim data As Byte() = reader.ReadBytes(CInt(inputStream.Length))
- WriteAttachment(embeddedUrl, data.Length, mimeType, Nothing, True, data)
- End Using
- End Sub
-
- Protected Sub WriteAttachment(embeddedUrl As String, size As Double, mimeType As String, externalUri As String, embedded As Boolean, data As Byte())
- WriteStartElement("attachment")
-
- Try
-
- WriteAttributeStringRequired("url", embeddedUrl)
-
- If size > 0 Then
- WriteAttributeStringRequired("size", size.ToString())
- End If
-
- If mimeType IsNot Nothing Then
- WriteAttributeStringRequired("mime-type", mimeType)
- End If
-
- If Not String.IsNullOrEmpty(externalUri) Then
- WriteAttributeStringRequired("external-uri", externalUri)
- End If
-
- WriteAttributeString("embedded", If(embedded, "true", "false"))
-
- If embedded Then
- Writer.WriteBase64(data, 0, data.Length)
- End If
- Finally
- WriteEndElement()
- End Try
-
- End Sub
-
-
- Friend Sub CopyStream(src As Stream, dst As Stream)
- Dim buf(4095) As Byte
- While True
- Dim bytesRead As Integer = src.Read(buf, 0, buf.Length)
-
- 'Read returns 0 when reached end of stream.
- If bytesRead = 0 Then
- Exit While
- End If
-
- dst.Write(buf, 0, bytesRead)
- End While
- End Sub
-
-
- Public NotInheritable Class SgmlUtil
- Public Shared Function IsRootUrlOf(rootUrl As String, url As String) As Boolean
-
- If rootUrl Is Nothing Then
- Throw New ArgumentNullException("rootUrl")
- End If
-
- If url Is Nothing Then
- Throw New ArgumentNullException("url")
- End If
-
- rootUrl = rootUrl.Trim().ToLower()
- url = url.Trim().ToLower()
- ' is it a full path
- If url.StartsWith("http://") Then
- Return url.StartsWith(rootUrl)
- End If
-
- ' it's local
- Return True
- End Function
-
- Public Shared Function StripRootUrlPath(rootUrl As String, url As String) As String
- If url.StartsWith(rootUrl) Then
- url = url.Remove(0, rootUrl.Length)
- End If
-
- If url.StartsWith("/") Then
- url.TrimStart("/"c)
- End If
-
- Return url
- End Function
-
- Public Shared Function CleanAttachmentUrls(content As String, oldPath As String, newPath As String) As String
- oldPath = Regex.Escape(oldPath)
-
- content = Regex.Replace(content, oldPath, newPath, RegexOptions.CultureInvariant Or RegexOptions.IgnoreCase Or RegexOptions.Multiline Or RegexOptions.ExplicitCapture)
- Return content
- End Function
-
- Public Shared Function GetAttributeValues(content As String, tag As String, attribute As String) As String()
- Dim srcrx As Regex = CreateAttributeRegex(attribute)
- Dim matches As MatchCollection = CreateTagRegex(tag).Matches(content)
- Dim sources(matches.Count - 1) As String
- For i As Integer = 0 To sources.Length - 1
- Dim m As Match = srcrx.Match(matches(i).Value)
- sources(i) = m.Groups("Value").Value
- Next
- Return sources
- End Function
-
- Public Shared Function CreateTagRegex(name As String) As Regex
-
- Dim pattern As String = "<\s*{0}[^>]+>"
-
- pattern = String.Format(pattern, name)
- Return New Regex(pattern, RegexOptions.CultureInvariant Or RegexOptions.IgnoreCase Or RegexOptions.Multiline Or RegexOptions.ExplicitCapture)
- End Function
-
- Public Shared Function CreateAttributeRegex(name As String) As Regex
- Dim pattern As String = "{0}\s*=\s*['""]?\s*(?[^'"" ]+)"
- pattern = String.Format(pattern, name)
- Return New Regex(pattern, RegexOptions.CultureInvariant Or RegexOptions.IgnoreCase Or RegexOptions.Multiline Or RegexOptions.ExplicitCapture)
- End Function
-
- End Class
-
- End Class
-
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Enumerators/BlogPostTypes.vb b/Server/Blog/Components/BlogML/Enumerators/BlogPostTypes.vb
deleted file mode 100644
index 5c54fbe4..00000000
--- a/Server/Blog/Components/BlogML/Enumerators/BlogPostTypes.vb
+++ /dev/null
@@ -1,8 +0,0 @@
-Namespace BlogML
- Public Enum BlogPostTypes As Short
- _
- Normal = 1
- _
- Article = 2
- End Enum
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Enumerators/CommentModerationTypes.vb b/Server/Blog/Components/BlogML/Enumerators/CommentModerationTypes.vb
deleted file mode 100644
index c44a06c5..00000000
--- a/Server/Blog/Components/BlogML/Enumerators/CommentModerationTypes.vb
+++ /dev/null
@@ -1,7 +0,0 @@
-Namespace BlogML
- Public Enum CommentModerationTypes As Short
- Anonymous = 1
- Enabled = 2
- Disabled = 3
- End Enum
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Enumerators/ContentTypes.vb b/Server/Blog/Components/BlogML/Enumerators/ContentTypes.vb
deleted file mode 100644
index 7eabe110..00000000
--- a/Server/Blog/Components/BlogML/Enumerators/ContentTypes.vb
+++ /dev/null
@@ -1,14 +0,0 @@
-Imports System.Xml.Serialization
-
-Namespace BlogML
- Public Enum ContentTypes As Short
- _
- Html = 1
- _
- Xhtml = 2
- _
- Text = 3
- _
- Base64 = 4
- End Enum
-End Namespace
\ No newline at end of file
diff --git a/Server/Blog/Components/BlogML/Enumerators/SendTrackbackTypes.vb b/Server/Blog/Components/BlogML/Enumerators/SendTrackbackTypes.vb
deleted file mode 100644
index 88b3f2db..00000000
--- a/Server/Blog/Components/BlogML/Enumerators/SendTrackbackTypes.vb
+++ /dev/null
@@ -1,7 +0,0 @@
-
-Namespace BlogML
- Public Enum SendTrackbackTypes As Short
- Yes = 1
- No = 2
- End Enum
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Pair.vb b/Server/Blog/Components/BlogML/Pair.vb
deleted file mode 100644
index ecf12fa3..00000000
--- a/Server/Blog/Components/BlogML/Pair.vb
+++ /dev/null
@@ -1,15 +0,0 @@
-Namespace BlogML
-
- '''
- ''' A serializable keyvalue pair class
- '''
- Public Structure Pair(Of K, V)
- Public Key As K
- Public Value As V
- Public Sub New(key As K, value As V)
- Me.Key = key
- Me.Value = value
- End Sub
- End Structure
-
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Xml/BlogMLAttachment.vb b/Server/Blog/Components/BlogML/Xml/BlogMLAttachment.vb
deleted file mode 100644
index 02484a60..00000000
--- a/Server/Blog/Components/BlogML/Xml/BlogMLAttachment.vb
+++ /dev/null
@@ -1,23 +0,0 @@
-Imports System.Xml.Serialization
-
-Namespace BlogML.Xml
-
- Public NotInheritable Class BlogMLAttachment
-
-
- Public Property Embedded As Boolean = False
-
-
- Public Property Url As String
-
-
- Public Property Path As String
-
-
- Public Property MimeType As String
-
-
- Public Property Data As Byte()
-
- End Class
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Xml/BlogMLAuthor.vb b/Server/Blog/Components/BlogML/Xml/BlogMLAuthor.vb
deleted file mode 100644
index a0a0d28a..00000000
--- a/Server/Blog/Components/BlogML/Xml/BlogMLAuthor.vb
+++ /dev/null
@@ -1,12 +0,0 @@
-Imports System.Xml.Serialization
-
-Namespace BlogML.Xml
-
- Public NotInheritable Class BlogMLAuthor
- Inherits BlogMLNode
-
-
- Public Property Email As String
-
- End Class
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Xml/BlogMLAuthorReference.vb b/Server/Blog/Components/BlogML/Xml/BlogMLAuthorReference.vb
deleted file mode 100644
index 8486fa3a..00000000
--- a/Server/Blog/Components/BlogML/Xml/BlogMLAuthorReference.vb
+++ /dev/null
@@ -1,11 +0,0 @@
-Imports System.Xml.Serialization
-
-Namespace BlogML.Xml
-
- Public NotInheritable Class BlogMLAuthorReference
-
-
- Public Property Ref As String
-
- End Class
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Xml/BlogMLBlog.vb b/Server/Blog/Components/BlogML/Xml/BlogMLBlog.vb
deleted file mode 100644
index 09c4fbd1..00000000
--- a/Server/Blog/Components/BlogML/Xml/BlogMLBlog.vb
+++ /dev/null
@@ -1,56 +0,0 @@
-Imports System.Xml.Serialization
-
-Namespace BlogML.Xml
-
-
- Public NotInheritable Class BlogMLBlog
-
-
- Public Property RootUrl As String
-
-
- Public Property Title As String
-
-
- Public Property SubTitle As String
-
-
- Public Property DateCreated As DateTime = DateTime.Now
-
-
-
- Public Property ExtendedProperties As New ExtendedPropertiesCollection
-
-
-
- Public Property Authors As New AuthorCollection
-
-
-
- Public Property Posts As New PostCollection
-
-
-
- Public Property Categories As New CategoryCollection
-
-
- Public NotInheritable Class AuthorCollection
- Inherits List(Of BlogMLAuthor)
- End Class
-
-
- Public NotInheritable Class PostCollection
- Inherits List(Of BlogMLPost)
- End Class
-
-
- Public NotInheritable Class CategoryCollection
- Inherits List(Of BlogMLCategory)
- End Class
-
-
- Public NotInheritable Class ExtendedPropertiesCollection
- Inherits List(Of Pair(Of String, String))
- End Class
- End Class
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Xml/BlogMLCategory.vb b/Server/Blog/Components/BlogML/Xml/BlogMLCategory.vb
deleted file mode 100644
index 97042a01..00000000
--- a/Server/Blog/Components/BlogML/Xml/BlogMLCategory.vb
+++ /dev/null
@@ -1,15 +0,0 @@
-Imports System.Xml.Serialization
-
-Namespace BlogML.Xml
-
- Public NotInheritable Class BlogMLCategory
- Inherits BlogMLNode
-
-
- Public Property Description As String
-
-
- Public Property ParentRef As String
-
- End Class
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Xml/BlogMLCategoryReference.vb b/Server/Blog/Components/BlogML/Xml/BlogMLCategoryReference.vb
deleted file mode 100644
index a2522914..00000000
--- a/Server/Blog/Components/BlogML/Xml/BlogMLCategoryReference.vb
+++ /dev/null
@@ -1,11 +0,0 @@
-Imports System.Xml.Serialization
-
-Namespace BlogML.Xml
-
- Public NotInheritable Class BlogMLCategoryReference
-
-
- Public Property Ref As String
-
- End Class
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Xml/BlogMLComment.vb b/Server/Blog/Components/BlogML/Xml/BlogMLComment.vb
deleted file mode 100644
index a6b3f732..00000000
--- a/Server/Blog/Components/BlogML/Xml/BlogMLComment.vb
+++ /dev/null
@@ -1,25 +0,0 @@
-Imports System.Xml.Serialization
-
-Namespace BlogML.Xml
-
- Public NotInheritable Class BlogMLComment
- Inherits BlogMLNode
- Private m_userName As String
- Private m_userEmail As String
- Private m_userUrl As String
- Private m_content As New BlogMLContent
-
-
- Public Property UserName As String
-
-
- Public Property UserUrl As String
-
-
- Public Property UserEMail As String
-
-
- Public Property Content As BlogMLContent
-
- End Class
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Xml/BlogMLContent.vb b/Server/Blog/Components/BlogML/Xml/BlogMLContent.vb
deleted file mode 100644
index 5560c8f2..00000000
--- a/Server/Blog/Components/BlogML/Xml/BlogMLContent.vb
+++ /dev/null
@@ -1,68 +0,0 @@
-Imports System.Xml.Serialization
-
-Namespace BlogML.Xml
-
- Public NotInheritable Class BlogMLContent
- Private ReadOnly Property Base64Encoded As Boolean
- Get
- Return ContentType = ContentTypes.Base64
- End Get
- End Property
-
- Private ReadOnly Property HtmlEncoded As Boolean
- Get
- Return ContentType = ContentTypes.Html OrElse ContentType = ContentTypes.Xhtml
- End Get
- End Property
-
-
- Public Property ContentType As ContentTypes
- Get
- Return m_ContentType
- End Get
- Set(value As ContentTypes)
- m_ContentType = value
- End Set
- End Property
- Private m_ContentType As ContentTypes = ContentTypes.Text
-
- ' Encoded Text
-
- Public Property Text As String
- Get
- Return m_Text
- End Get
- Set(value As String)
- m_Text = value
- End Set
- End Property
- Private m_Text As String
-
-
- Public ReadOnly Property UncodedText As String
- Get
- If Base64Encoded Then
- Dim byteArray As Byte() = Convert.FromBase64String(Text)
- Return Encoding.UTF8.GetString(byteArray)
- End If
- If HtmlEncoded Then
- Return HttpUtility.HtmlDecode(Text)
- End If
- Return Text
- End Get
- End Property
-
- Public Shared Function Create(unencodedText As String, contentType As ContentTypes) As BlogMLContent
- Dim content As New BlogMLContent With {.ContentType = contentType}
- If content.Base64Encoded Then
- Dim byteArray As Byte() = Encoding.UTF8.GetBytes(unencodedText)
- content.Text = Convert.ToBase64String(byteArray)
- ElseIf content.HtmlEncoded Then
- content.Text = HttpUtility.HtmlEncode(unencodedText)
- Else
- content.Text = unencodedText
- End If
- Return content
- End Function
- End Class
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Xml/BlogMLMeta.vb b/Server/Blog/Components/BlogML/Xml/BlogMLMeta.vb
deleted file mode 100644
index f5baf4e0..00000000
--- a/Server/Blog/Components/BlogML/Xml/BlogMLMeta.vb
+++ /dev/null
@@ -1,14 +0,0 @@
-Imports System.Xml.Serialization
-
-Namespace BlogML.Xml
- ")>
- Public NotInheritable Class Meta
-
-
- Public Property Type As String
-
-
- Public Property Value As String
-
- End Class
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Xml/BlogMLNode.vb b/Server/Blog/Components/BlogML/Xml/BlogMLNode.vb
deleted file mode 100644
index fce3baa9..00000000
--- a/Server/Blog/Components/BlogML/Xml/BlogMLNode.vb
+++ /dev/null
@@ -1,23 +0,0 @@
-Imports System.Xml.Serialization
-
-Namespace BlogML.Xml
-
- Public MustInherit Class BlogMLNode
-
-
- Public Property ID As String
-
-
- Public Property Title As String
-
-
- Public Property DateCreated As DateTime = Now
-
-
- Public Property DateModified As DateTime = Now
-
-
- Public Property Approved As Boolean = True
-
- End Class
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Xml/BlogMLPost.vb b/Server/Blog/Components/BlogML/Xml/BlogMLPost.vb
deleted file mode 100644
index 921dc352..00000000
--- a/Server/Blog/Components/BlogML/Xml/BlogMLPost.vb
+++ /dev/null
@@ -1,148 +0,0 @@
-Imports System.Xml.Serialization
-
-Namespace BlogML.Xml
-
- Public NotInheritable Class BlogMLPost
- Inherits BlogMLNode
-
-
- Public Property PostUrl As String
-
-
- Public Property HasExcerpt As Boolean = False
-
-
- Public Property PostType As New BlogPostTypes
-
-
- Public Property Views As UInt32 = 0
-
-
- Public Property Image As String
-
-
- Public Property AllowComments As Boolean = True
-
-
- Public Property DisplayCopyright As Boolean = False
-
-
- Public Property Copyright As String
-
-
- Public Property Locale As String
-
-
- Public Property PostName As String
-
-
- Public Property Content As New BlogMLContent
-
-
- Public Property Excerpt As New BlogMLContent
-
-
-
- Public Property Authors As New AuthorReferenceCollection
-
-
-
- Public Property Categories As New CategoryReferenceCollection
-
-
-
- Public Property Comments As New CommentCollection
-
-
-
- Public Property Trackbacks As New TrackbackCollection
-
-
-
- Public Property Attachments As New AttachmentCollection
-
-
- Public NotInheritable Class AuthorReferenceCollection
- Inherits ArrayList
- Default Public Shadows ReadOnly Property Item(index As Integer) As BlogMLAuthorReference
- Get
- Return TryCast(MyBase.Item(index), BlogMLAuthorReference)
- End Get
- End Property
-
- Public Overloads Sub Add(value As BlogMLAuthorReference)
- MyBase.Add(value)
- End Sub
-
- Public Overloads Function Add(authorID As String) As BlogMLAuthorReference
- Dim item As New BlogMLAuthorReference
- item.Ref = authorID
- MyBase.Add(item)
- Return item
- End Function
- End Class
-
-
- Public NotInheritable Class CommentCollection
- Inherits ArrayList
- Default Public Shadows ReadOnly Property Item(index As Integer) As BlogMLComment
- Get
- Return TryCast(MyBase.Item(index), BlogMLComment)
- End Get
- End Property
-
- Public Overloads Sub Add(value As BlogMLComment)
- MyBase.Add(value)
- End Sub
- End Class
-
-
- Public NotInheritable Class TrackbackCollection
- Inherits ArrayList
- Default Public Shadows ReadOnly Property Item(index As Integer) As BlogMLTrackback
- Get
- Return TryCast(MyBase.Item(index), BlogMLTrackback)
- End Get
- End Property
-
- Public Overloads Sub Add(value As BlogMLTrackback)
- MyBase.Add(value)
- End Sub
- End Class
-
-
- Public NotInheritable Class CategoryReferenceCollection
- Inherits ArrayList
- Default Public Shadows ReadOnly Property Item(index As Integer) As BlogMLCategoryReference
- Get
- Return TryCast(MyBase.Item(index), BlogMLCategoryReference)
- End Get
- End Property
-
- Public Overloads Sub Add(value As BlogMLCategoryReference)
- MyBase.Add(value)
- End Sub
-
- Public Overloads Function Add(categoryID As String) As BlogMLCategoryReference
- Dim item As New BlogMLCategoryReference
- item.Ref = categoryID
- MyBase.Add(item)
- Return item
- End Function
- End Class
-
-
- Public NotInheritable Class AttachmentCollection
- Inherits ArrayList
- Default Public Shadows ReadOnly Property Item(index As Integer) As BlogMLAttachment
- Get
- Return TryCast(MyBase.Item(index), BlogMLAttachment)
- End Get
- End Property
-
- Public Overloads Sub Add(value As BlogMLAttachment)
- MyBase.Add(value)
- End Sub
- End Class
- End Class
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Xml/BlogMLSerializer.vb b/Server/Blog/Components/BlogML/Xml/BlogMLSerializer.vb
deleted file mode 100644
index b5ab7eb2..00000000
--- a/Server/Blog/Components/BlogML/Xml/BlogMLSerializer.vb
+++ /dev/null
@@ -1,53 +0,0 @@
-Imports System.IO
-Imports System.Xml.Serialization
-Imports System.Xml
-
-Namespace BlogML.Xml
- Public Class BlogMLSerializer
- Private Shared ReadOnly syncRoot As New Object
- Private Shared m_serializer As XmlSerializer
-
- Public Shared ReadOnly Property Serializer As XmlSerializer
- Get
- SyncLock syncRoot
- If m_serializer Is Nothing Then
- m_serializer = New XmlSerializer(GetType(BlogMLBlog))
- End If
- Return m_serializer
- End SyncLock
- End Get
- End Property
-
- Public Shared ReadOnly Property Namespaces As XmlSerializerNamespaces
- Get
- Dim ns As New XmlSerializerNamespaces()
- ns.Add("dnn", "http://dnn-connect.org/blog/")
- Return ns
- End Get
- End Property
-
- Public Shared Function Deserialize(stream As Stream) As BlogMLBlog
- Return TryCast(Serializer.Deserialize(stream), BlogMLBlog)
- End Function
-
- Public Shared Function Deserialize(reader As TextReader) As BlogMLBlog
- Return TryCast(Serializer.Deserialize(reader), BlogMLBlog)
- End Function
-
- Public Shared Function Deserialize(reader As XmlReader) As BlogMLBlog
- Return TryCast(Serializer.Deserialize(reader), BlogMLBlog)
- End Function
-
- Public Shared Sub Serialize(stream As Stream, blog As BlogMLBlog)
- Serializer.Serialize(stream, blog, Namespaces)
- End Sub
-
- Public Shared Sub Serialize(writer As TextWriter, blog As BlogMLBlog)
- Serializer.Serialize(writer, blog, Namespaces)
- End Sub
-
- Public Shared Sub Serialize(writer As XmlWriter, blog As BlogMLBlog)
- Serializer.Serialize(writer, blog, Namespaces)
- End Sub
- End Class
-End Namespace
diff --git a/Server/Blog/Components/BlogML/Xml/BlogMLTrackback.vb b/Server/Blog/Components/BlogML/Xml/BlogMLTrackback.vb
deleted file mode 100644
index 40b67bf6..00000000
--- a/Server/Blog/Components/BlogML/Xml/BlogMLTrackback.vb
+++ /dev/null
@@ -1,12 +0,0 @@
-Imports System.Xml.Serialization
-
-Namespace BlogML.Xml
-
- Public NotInheritable Class BlogMLTrackback
- Inherits BlogMLNode
-
-
- Public Property Url As String
-
- End Class
-End Namespace
diff --git a/Server/Blog/Components/Common/BlogContextInfo.vb b/Server/Blog/Components/Common/BlogContextInfo.vb
deleted file mode 100644
index b75d98b6..00000000
--- a/Server/Blog/Components/Common/BlogContextInfo.vb
+++ /dev/null
@@ -1,250 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-Imports DotNetNuke.Modules.Blog.Security
-Imports DotNetNuke.Modules.Blog.Common.Globals
-Imports DotNetNuke.Services.Tokens
-
-Namespace Common
-
- Public Class BlogContextInfo
- Implements IPropertyAccess
-
-#Region " Private Members "
- Private Property RequestParams As NameValueCollection
-#End Region
-
-#Region " Public Methods "
- Public Sub New(context As HttpContext, blogModule As BlogModuleBase)
-
- BlogModuleId = blogModule.ModuleId
-
- ' Initialize values from View Settings
- If blogModule.ViewSettings.BlogModuleId <> -1 Then
- BlogModuleId = blogModule.ViewSettings.BlogModuleId
- parentModule = (New DotNetNuke.Entities.Modules.ModuleController).GetModule(BlogModuleId)
- End If
- BlogId = blogModule.ViewSettings.BlogId
- Categories = blogModule.ViewSettings.Categories
- AuthorId = blogModule.ViewSettings.AuthorId
-
- Locale = Threading.Thread.CurrentThread.CurrentCulture.Name
- If context.Request.UrlReferrer IsNot Nothing Then Referrer = context.Request.UrlReferrer.PathAndQuery
- RequestParams = context.Request.Params
-
- context.Request.Params.ReadValue("Blog", BlogId)
- context.Request.Params.ReadValue("Post", ContentItemId)
- context.Request.Params.ReadValue("Term", TermId)
- context.Request.Params.ReadValue("Categories", Categories)
- context.Request.Params.ReadValue("User", AuthorId)
- context.Request.Params.ReadValue("uid", AuthorId)
- context.Request.Params.ReadValue("UserId", AuthorId)
- context.Request.Params.ReadValue("Author", AuthorId)
- context.Request.Params.ReadValue("end", EndDate)
- context.Request.Params.ReadValue("search", SearchString)
- context.Request.Params.ReadValue("t", SearchTitle)
- context.Request.Params.ReadValue("c", SearchContents)
- context.Request.Params.ReadValue("u", SearchUnpublished)
- context.Request.Params.ReadValue("EntryId", LegacyEntryId)
- If ContentItemId > -1 Then Post = Entities.Posts.PostsController.GetPost(ContentItemId, BlogModuleId, Locale)
- If BlogId > -1 And Post IsNot Nothing AndAlso Post.BlogID <> BlogId Then Post = Nothing ' double check in case someone is hacking to retrieve an Post from another blog
- If BlogId = -1 And Post IsNot Nothing Then BlogId = Post.BlogID
- If BlogId > -1 Then Blog = Entities.Blogs.BlogsController.GetBlog(BlogId, blogModule.UserInfo.UserID, Locale)
- If BlogId > -1 Then BlogMapPath = GetBlogDirectoryMapPath(BlogId)
- If BlogMapPath <> "" AndAlso Not IO.Directory.Exists(BlogMapPath) Then IO.Directory.CreateDirectory(BlogMapPath)
- If ContentItemId > -1 Then PostMapPath = GetPostDirectoryMapPath(BlogId, ContentItemId)
- If PostMapPath <> "" AndAlso Not IO.Directory.Exists(PostMapPath) Then IO.Directory.CreateDirectory(PostMapPath)
- If TermId > -1 Then Term = Entities.Terms.TermsController.GetTerm(TermId, BlogModuleId, Locale)
- If AuthorId > -1 Then Author = DotNetNuke.Entities.Users.UserController.GetUserById(blogModule.PortalId, AuthorId)
- If context.Request.UserAgent IsNot Nothing Then
- WLWRequest = CBool(context.Request.UserAgent.IndexOf("Windows Live Writer") > -1)
- End If
- Security = New ContextSecurity(BlogModuleId, blogModule.TabId, Blog, blogModule.UserInfo)
- If EndDate < Now.AddDays(-1) Then
- EndDate = EndDate.Date.AddDays(1).AddMinutes(-1)
- EndDateOrNow = EndDate
- ElseIf Security.CanAddPost Then
- EndDate = Nothing
- Else
- EndDate = DateTime.Now.ToUniversalTime ' security measure to stop people prying into future posts
- EndDateOrNow = EndDate
- End If
-
- ' security
- Dim isStylePostRequest As Boolean = False
- If Post IsNot Nothing AndAlso Not (Post.Published Or Security.CanEditThisPost(Post)) AndAlso Not Security.IsEditor Then
- If Post.Title.Contains("3bfe001a-32de-4114-a6b4-4005b770f6d7") And WLWRequest Then
- isStylePostRequest = True
- Else
- Post = Nothing
- ContentItemId = -1
- End If
- End If
- If Blog IsNot Nothing AndAlso Not Blog.Published AndAlso Not Security.IsOwner AndAlso Not Security.UserIsAdmin AndAlso Not isStylePostRequest Then
- Blog = Nothing
- BlogId = -1
- End If
-
- ' set urls for use in module
- If ParentModule Is Nothing Then
- ModuleUrls = New ModuleUrls(blogModule.TabId, BlogId, ContentItemId, TermId, AuthorId)
- Else
- ModuleUrls = New ModuleUrls(blogModule.TabId, ParentModule.TabID, BlogId, ContentItemId, TermId, AuthorId)
- End If
- IsMultiLingualSite = CBool(DotNetNuke.Services.Localization.LocaleController.Instance.GetLocales(blogModule.PortalId).Count > 1)
- If Not blogModule.ViewSettings.ShowAllLocales Then
- ShowLocale = Locale
- End If
- If Referrer.Contains("/ctl/") Or Referrer.Contains("&ctl=") Then
- Referrer = DotNetNuke.Common.NavigateURL(blogModule.TabId) ' just catch 99% of bad referrals to edit pages
- End If
-
- UiTimeZone = blogModule.ModuleContext.PortalSettings.TimeZone
- If blogModule.UserInfo.Profile.PreferredTimeZone IsNot Nothing Then
- UiTimeZone = blogModule.UserInfo.Profile.PreferredTimeZone
- End If
-
- End Sub
-
- Public Shared Function GetBlogContext(ByRef context As HttpContext, blogModule As BlogModuleBase) As BlogContextInfo
- Dim res As BlogContextInfo
- If context.Items("BlogContext" & blogModule.TabModuleId.ToString) Is Nothing Then
- res = New BlogContextInfo(context, blogModule)
- context.Items("BlogContext" & blogModule.TabModuleId.ToString) = res
- Else
- res = CType(context.Items("BlogContext" & blogModule.TabModuleId.ToString), BlogContextInfo)
- End If
- Return res
- End Function
-#End Region
-
-#Region " Public Properties "
- Public Property BlogModuleId As Integer = -1
- Public Property ParentModule As DotNetNuke.Entities.Modules.ModuleInfo = Nothing
- Public Property BlogId As Integer = -1
- Public Property ContentItemId As Integer = -1
- Public Property TermId As Integer = -1
- Public Property Categories As String = ""
- Public Property AuthorId As Integer = -1
- Public Property EndDate As Date = DateTime.Now.ToUniversalTime
- Public Property EndDateOrNow As Date = DateTime.Now
- Public Property Blog As Entities.Blogs.BlogInfo = Nothing
- Public Property Post As Entities.Posts.PostInfo = Nothing
- Public Property Term As Entities.Terms.TermInfo = Nothing
- Public Property Author As DotNetNuke.Entities.Users.UserInfo = Nothing
- Public Property BlogMapPath As String = ""
- Public Property PostMapPath As String = ""
- Public Property OutputAdditionalFiles As Boolean
- Public Property ModuleUrls As ModuleUrls = Nothing
- Public Property SearchString As String = ""
- Public Property SearchTitle As Boolean = True
- Public Property SearchContents As Boolean = False
- Public Property SearchUnpublished As Boolean = False
- Public Property IsMultiLingualSite As Boolean = False
- Public Property ShowLocale As String = Nothing
- Public Property Locale As String = ""
- Public Property Referrer As String = ""
- Public Property WLWRequest As Boolean = False
- Public Property UiTimeZone As TimeZoneInfo
- Public Property Security As ContextSecurity
- Public Property LegacyEntryId As Integer = -1
-#End Region
-
-#Region " IPropertyAccess Implementation "
- Public Function GetProperty(strPropertyName As String, strFormat As String, formatProvider As System.Globalization.CultureInfo, AccessingUser As DotNetNuke.Entities.Users.UserInfo, AccessLevel As DotNetNuke.Services.Tokens.Scope, ByRef PropertyNotFound As Boolean) As String Implements IPropertyAccess.GetProperty
- Dim OutputFormat As String = String.Empty
- Dim portalSettings As DotNetNuke.Entities.Portals.PortalSettings = DotNetNuke.Entities.Portals.PortalController.Instance.GetCurrentPortalSettings
- If strFormat = String.Empty Then
- OutputFormat = "D"
- Else
- OutputFormat = strFormat
- End If
- Select Case strPropertyName.ToLower
- Case "blogmoduleid"
- Return (BlogModuleId.ToString(OutputFormat, formatProvider))
- Case "blogid"
- Return (BlogId.ToString(OutputFormat, formatProvider))
- Case "Postid", "contentitemid", "postid", "post"
- Return (ContentItemId.ToString(OutputFormat, formatProvider))
- Case "termid", "term"
- Return (TermId.ToString(OutputFormat, formatProvider))
- Case "categories"
- Return Categories
- Case "authorid", "author"
- Return (AuthorId.ToString(OutputFormat, formatProvider))
- Case "enddate"
- Return (EndDate.ToString(OutputFormat, formatProvider))
- Case "enddateornow"
- Return (EndDateOrNow.ToString(OutputFormat, formatProvider))
- Case "blogselected"
- Return CBool(BlogId > -1).ToString()
- Case "postselected"
- Return CBool(ContentItemId > -1).ToString()
- Case "termselected"
- Return CBool(TermId > -1).ToString()
- Case "authorselected"
- Return CBool(AuthorId > -1).ToString()
- Case "ismultilingualsite"
- Return IsMultiLingualSite.ToString()
- Case "showlocale"
- Return ShowLocale
- Case "locale"
- Select Case strFormat.ToLower
- Case "3"
- Return Threading.Thread.CurrentThread.CurrentCulture.ThreeLetterISOLanguageName
- Case "ietf"
- Return Threading.Thread.CurrentThread.CurrentCulture.IetfLanguageTag
- Case "displayname", "display"
- Return Threading.Thread.CurrentThread.CurrentCulture.DisplayName
- Case "englishname", "english"
- Return Threading.Thread.CurrentThread.CurrentCulture.EnglishName
- Case "nativename", "native"
- Return Threading.Thread.CurrentThread.CurrentCulture.NativeName
- Case "generic", "2"
- Return Threading.Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName
- Case Else
- Return Locale
- End Select
- Case "searchstring"
- Return SearchString
- Case "issearch"
- Return CBool(SearchString <> "").ToString()
- Case "referrer"
- Return Referrer
- Case Else
- If RequestParams(strPropertyName) IsNot Nothing Then
- Return RequestParams(strPropertyName)
- Else
- PropertyNotFound = True
- End If
- End Select
- Return DotNetNuke.Common.Utilities.Null.NullString
- End Function
-
- Public ReadOnly Property Cacheability() As DotNetNuke.Services.Tokens.CacheLevel Implements IPropertyAccess.Cacheability
- Get
- Return CacheLevel.fullyCacheable
- End Get
- End Property
-#End Region
-
- End Class
-
-End Namespace
\ No newline at end of file
diff --git a/Server/Blog/Components/Common/BlogModuleBase.vb b/Server/Blog/Components/Common/BlogModuleBase.vb
deleted file mode 100644
index bd6ef901..00000000
--- a/Server/Blog/Components/Common/BlogModuleBase.vb
+++ /dev/null
@@ -1,184 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-Imports DotNetNuke.Web.Client.ClientResourceManagement
-Imports DotNetNuke.Entities.Modules
-Imports DotNetNuke.Framework
-Imports DotNetNuke.Modules.Blog.Common.Globals
-Imports DotNetNuke.Modules.Blog.Entities.Terms
-Imports DotNetNuke.Modules.Blog.Templating
-Imports DotNetNuke.Services.Localization
-Imports DotNetNuke.UI.Utilities
-Imports DotNetNuke.Web.Client
-Imports DotNetNuke.Framework.JavaScriptLibraries
-
-Namespace Common
-
- Public Class BlogModuleBase
- Inherits PortalModuleBase
-
-#Region " Private Members "
-#End Region
-
-#Region " Properties "
- Private _blogContext As BlogContextInfo
- Public Property BlogContext() As BlogContextInfo
- Get
- If _blogContext Is Nothing Then
- _blogContext = BlogContextInfo.GetBlogContext(Context, Me)
- End If
- Return _blogContext
- End Get
- Set(ByVal value As BlogContextInfo)
- _blogContext = value
- End Set
- End Property
-
- Private _settings As ModuleSettings
- Public Shadows Property Settings() As ModuleSettings
- Get
- If _settings Is Nothing Then
- If ViewSettings.BlogModuleId = -1 Then
- _settings = ModuleSettings.GetModuleSettings(ModuleConfiguration.ModuleID)
- Else
- _settings = ModuleSettings.GetModuleSettings(ViewSettings.BlogModuleId)
- End If
- End If
- Return _settings
- End Get
- Set(ByVal value As ModuleSettings)
- _settings = value
- End Set
- End Property
-
- Private _categories As Dictionary(Of String, TermInfo)
- Public Property Categories() As Dictionary(Of String, TermInfo)
- Get
- If _categories Is Nothing Then
- _categories = TermsController.GetTermsByVocabulary(ModuleId, Settings.VocabularyId, BlogContext.Locale)
- End If
- Return _categories
- End Get
- Set(ByVal value As Dictionary(Of String, TermInfo))
- _categories = value
- End Set
- End Property
-
- Private _viewSettings As ViewSettings
- Public Property ViewSettings() As ViewSettings
- Get
- If _viewSettings Is Nothing Then _viewSettings = ViewSettings.GetViewSettings(TabModuleId)
- Return _viewSettings
- End Get
- Set(ByVal value As ViewSettings)
- _viewSettings = value
- End Set
- End Property
-
- Public Shadows ReadOnly Property Page As CDefault
- Get
- Return CType(MyBase.Page, CDefault)
- End Get
- End Property
-
- Private _BlogModuleMapPath As String = ""
- Public ReadOnly Property BlogModuleMapPath As String
- Get
- If String.IsNullOrEmpty(_BlogModuleMapPath) Then
- _BlogModuleMapPath = Server.MapPath("~/DesktopModules/Blog") & "\"
- End If
- Return _BlogModuleMapPath
- End Get
- End Property
-#End Region
-
-#Region " Event Handlers "
- Private Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
-
- If Context.Items("BlogModuleBaseInitialized") Is Nothing Then
-
- JavaScript.RequestRegistration(CommonJs.jQuery)
- JavaScript.RequestRegistration(CommonJs.jQueryUI)
- Dim script As New StringBuilder
- script.AppendLine("")
- ClientAPI.RegisterClientScriptBlock(Page, "blogAppPath", script.ToString)
- AddBlogService()
-
- Context.Items("BlogModuleBaseInitialized") = True
- End If
-
- End Sub
-#End Region
-
-#Region " Public Methods "
- Public Sub AddBlogService()
-
- If Context.Items("BlogServiceAdded") Is Nothing Then
-
- JavaScript.RequestRegistration(CommonJs.DnnPlugins)
- ServicesFramework.Instance.RequestAjaxScriptSupport()
- ServicesFramework.Instance.RequestAjaxAntiForgerySupport()
- AddJavascriptFile("dotnetnuke.blog.js", 70)
-
- ' Load initialization snippet
- Dim scriptBlock As String = ReadFile(DotNetNuke.Common.ApplicationMapPath & "\DesktopModules\Blog\js\dotnetnuke.blog.pagescript.js")
- Dim tr As New BlogTokenReplace(BlogContext.BlogModuleId)
- tr.AddResources("~/DesktopModules/Blog/App_LocalResources/SharedResources.resx")
- scriptBlock = tr.ReplaceTokens(scriptBlock)
- scriptBlock = ""
- Page.ClientScript.RegisterClientScriptBlock([GetType], "BlogServiceScript", scriptBlock)
-
- Context.Items("BlogServiceAdded") = True
- End If
-
- End Sub
-
- Public Sub AddJavascriptFile(jsFilename As String, priority As Integer)
- Page.AddJavascriptFile(Settings.Version, jsFilename, priority)
- End Sub
-
- Public Sub AddJavascriptFile(jsFilename As String, name As String, version As String, priority As Integer)
- Page.AddJavascriptFile(Settings.Version, jsFilename, name, version, priority)
- End Sub
-
- Public Sub AddCssFile(cssFilename As String)
- Page.AddCssFile(Settings.Version, cssFilename)
- End Sub
-
- Public Sub AddCssFile(cssFilename As String, name As String, version As String)
- Page.AddCssFile(Settings.Version, cssFilename, name, version)
- End Sub
-
- Public Function LocalizeJSString(resourceKey As String) As String
- Return ClientAPI.GetSafeJSString(LocalizeString(resourceKey))
- End Function
-
- Public Function LocalizeJSString(resourceKey As String, resourceFile As String) As String
- Return ClientAPI.GetSafeJSString(Localization.GetString(resourceKey, resourceFile))
- End Function
-#End Region
-
- End Class
-
-End Namespace
\ No newline at end of file
diff --git a/Server/Blog/Components/Common/DynatreeItem.vb b/Server/Blog/Components/Common/DynatreeItem.vb
deleted file mode 100644
index 2cee91ab..00000000
--- a/Server/Blog/Components/Common/DynatreeItem.vb
+++ /dev/null
@@ -1,31 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-Namespace Common
- Public Class DynatreeItem
- Public Property title As String = ""
- Public Property key As String = ""
- Public Property icon As Boolean = False
- Public Property expand As Boolean = True
- Public Property isFolder As Boolean = True
- Public Property [select] As Boolean = False
- Public Property children As New List(Of DynatreeItem)
- End Class
-End Namespace
diff --git a/Server/Blog/Components/Common/Extensions.vb b/Server/Blog/Components/Common/Extensions.vb
index 3abd096c..fb8cae79 100644
--- a/Server/Blog/Components/Common/Extensions.vb
+++ b/Server/Blog/Components/Common/Extensions.vb
@@ -18,434 +18,11 @@
' DEALINGS IN THE SOFTWARE.
'
-Imports System.Linq
-Imports DotNetNuke.Modules.Blog.Common.Globals
-Imports DotNetNuke.Modules.Blog.Entities.Terms
-Imports System.Xml
Imports System.Runtime.CompilerServices
-Imports DotNetNuke.Web.Client.ClientResourceManagement
-Imports DotNetNuke.Web.Client
-Imports System.Globalization
Namespace Common
Module Extensions
-#Region " Collection Read Extensions "
-
- Public Sub ReadValue(ByRef ValueTable As Hashtable, ValueName As String, ByRef Variable As Integer)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.Item(ValueName), Integer)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As Hashtable, ValueName As String, ByRef Variable As Long)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.Item(ValueName), Long)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As Hashtable, ValueName As String, ByRef Variable As String)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.Item(ValueName), String)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As Hashtable, ValueName As String, ByRef Variable As Boolean)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.Item(ValueName), Boolean)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As Hashtable, ValueName As String, ByRef Variable As Date)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.Item(ValueName), Date)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As Hashtable, ValueName As String, ByRef Variable As SummaryType)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(CType(ValueTable.Item(ValueName), Integer), SummaryType)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As Hashtable, ValueName As String, ByRef Variable As LocalizationType)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(CType(ValueTable.Item(ValueName), Integer), LocalizationType)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As Hashtable, ValueName As String, ByRef Variable As TimeSpan)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = TimeSpan.Parse(CType(ValueTable.Item(ValueName), String))
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As NameValueCollection, ValueName As String, ByRef Variable As Integer)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.Item(ValueName), Integer)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As NameValueCollection, ValueName As String, ByRef Variable As Long)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.Item(ValueName), Long)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As NameValueCollection, ValueName As String, ByRef Variable As String)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.Item(ValueName), String)
- Variable = (New DotNetNuke.Security.PortalSecurity).InputFilter(Variable, DotNetNuke.Security.PortalSecurity.FilterFlag.NoMarkup Or DotNetNuke.Security.PortalSecurity.FilterFlag.NoScripting)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As NameValueCollection, ValueName As String, ByRef Variable As Boolean)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.Item(ValueName), Boolean)
- Catch ex As Exception
- Select Case ValueTable.Item(ValueName).ToLower
- Case "on", "yes"
- Variable = True
- Case Else
- Variable = False
- End Select
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As NameValueCollection, ValueName As String, ByRef Variable As Date)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.Item(ValueName), Date)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As NameValueCollection, ValueName As String, ByRef Variable As TimeSpan)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = TimeSpan.Parse(CType(ValueTable.Item(ValueName), String))
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ValueTable As Dictionary(Of String, String), ValueName As String, ByRef Variable As Integer)
- If ValueTable.ContainsKey(ValueName) Then
- Try
- Variable = CType(ValueTable.Item(ValueName), Integer)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ValueTable As Dictionary(Of String, String), ValueName As String, ByRef Variable As String)
- If ValueTable.ContainsKey(ValueName) Then
- Try
- Variable = CType(ValueTable.Item(ValueName), String)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ValueTable As Dictionary(Of String, String), ValueName As String, ByRef Variable As Boolean)
- If ValueTable.ContainsKey(ValueName) Then
- Try
- Variable = CType(ValueTable.Item(ValueName), Boolean)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ValueTable As Dictionary(Of String, String), ValueName As String, ByRef Variable As Date)
- If ValueTable.ContainsKey(ValueName) Then
- Try
- Variable = CType(ValueTable.Item(ValueName), Date)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ValueTable As Dictionary(Of String, String), ValueName As String, ByRef Variable As TimeSpan)
- If ValueTable.ContainsKey(ValueName) Then
- Try
- Variable = TimeSpan.Parse(CType(ValueTable.Item(ValueName), String))
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As StateBag, ValueName As String, ByRef Variable As Integer)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.Item(ValueName), Integer)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As StateBag, ValueName As String, ByRef Variable As Long)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.Item(ValueName), Long)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As StateBag, ValueName As String, ByRef Variable As String)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.Item(ValueName), String)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As StateBag, ValueName As String, ByRef Variable As Boolean)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.Item(ValueName), Boolean)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As StateBag, ValueName As String, ByRef Variable As Date)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.Item(ValueName), Date)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As StateBag, ValueName As String, ByRef Variable As TimeSpan)
- If Not ValueTable.Item(ValueName) Is Nothing Then
- Try
- Variable = TimeSpan.Parse(CType(ValueTable.Item(ValueName), String))
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As XmlNode, ValueName As String, ByRef Variable As Integer)
- If Not ValueTable.SelectSingleNode(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.SelectSingleNode(ValueName).InnerText, Integer)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As XmlNode, ValueName As String, ByRef Variable As Long)
- If Not ValueTable.SelectSingleNode(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.SelectSingleNode(ValueName).InnerText, Long)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As XmlNode, ValueName As String, ByRef Variable As String)
- If Not ValueTable.SelectSingleNode(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.SelectSingleNode(ValueName).InnerText, String)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As XmlNode, ValueName As String, ByRef Variable As Boolean)
- If Not ValueTable.SelectSingleNode(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.SelectSingleNode(ValueName).InnerText, Boolean)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As XmlNode, ValueName As String, ByRef Variable As Date)
- If Not ValueTable.SelectSingleNode(ValueName) Is Nothing Then
- Try
- Variable = CType(ValueTable.SelectSingleNode(ValueName).InnerText, Date)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As XmlNode, ValueName As String, ByRef Variable As SummaryType)
- If Not ValueTable.SelectSingleNode(ValueName) Is Nothing Then
- Try
- Variable = CType(CType(ValueTable.SelectSingleNode(ValueName).InnerText, Integer), SummaryType)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As XmlNode, ValueName As String, ByRef Variable As LocalizationType)
- If Not ValueTable.SelectSingleNode(ValueName) Is Nothing Then
- Try
- Variable = CType(CType(ValueTable.SelectSingleNode(ValueName).InnerText, Integer), LocalizationType)
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As XmlNode, ValueName As String, ByRef Variable As TimeSpan)
- If Not ValueTable.SelectSingleNode(ValueName) Is Nothing Then
- Try
- Variable = TimeSpan.Parse(CType(ValueTable.SelectSingleNode(ValueName).InnerText, String))
- Catch ex As Exception
- End Try
- End If
- End Sub
-
-
- Public Sub ReadValue(ByRef ValueTable As XmlNode, ValueName As String, ByRef Variable As LocalizedText)
- If Not ValueTable.SelectSingleNode(ValueName) Is Nothing Then
- If Not ValueTable.SelectSingleNode(ValueName).SelectSingleNode("MLText") Is Nothing Then
- If Variable Is Nothing Then Variable = New LocalizedText
- For Each t As XmlNode In ValueTable.SelectSingleNode(ValueName).SelectSingleNode("MLText").SelectNodes("Text")
- Variable.Add(t.Attributes("Locale").InnerText, t.InnerText)
- Next
- End If
- End If
- End Sub
-#End Region
-
-#Region " Conversion Extensions "
-
- Public Function ToInt(var As Boolean) As Integer
- If var Then
- Return 1
- Else
- Return 0
- End If
- End Function
-
-
- Public Function ToYesNo(var As Boolean) As String
- If var Then
- Return "Yes"
- Else
- Return "No"
- End If
- End Function
-
-
- Public Function ToInt(var As String) As Integer
- If IsNumeric(var) Then
- Return Integer.Parse(var)
- Else
- Return -1
- End If
- End Function
-
-
- Public Function ToBool(var As Integer) As Boolean
- Return CBool(var > 0)
- End Function
-
-
- Public Function ToStringArray(terms As List(Of TermInfo)) As String()
- Return terms.Select(Function(x)
- Return x.Name
- End Function).ToArray
- End Function
-
-
- Public Function ToTermIDString(terms As List(Of TermInfo)) As String
- Return ToTermIDString(terms, ";")
- End Function
-
-
- Public Function ToTermIDString(terms As List(Of TermInfo), separator As String) As String
- Dim res As New List(Of String)
- For Each t As TermInfo In terms
- res.Add(t.TermId.ToString)
- Next
- Return String.Join(separator, res.ToArray)
- End Function
-
-
- Public Function ToStringOrZero(value As Integer?) As String
- If value Is Nothing Then
- Return "0"
- Else
- Return value.ToString
- End If
- End Function
-#End Region
-
-#Region " Other "
Public Function FindControlByID(Control As Control, id As String) As Control
Dim found As Control = Nothing
@@ -475,109 +52,87 @@ Namespace Common
Return found
End Function
-
- Public Function OutputHtml(encodedHtml As String, strFormat As String) As String
- Select Case strFormat.ToLower
- Case ""
- Return HttpUtility.HtmlDecode(encodedHtml)
- Case "js"
- Return HttpUtility.HtmlDecode(encodedHtml).Replace("""", "\""").Replace("'", "\'").Replace(vbCrLf, "\r\n")
- Case Else
- If IsNumeric(strFormat) Then
- Return RemoveHtmlTags(HttpUtility.HtmlDecode(encodedHtml)).SubstringWithoutException(0, Integer.Parse(strFormat))
- Else
- Return HttpUtility.HtmlDecode(encodedHtml)
- End If
- End Select
- End Function
-
-
- Public Function SubstringWithoutException(input As String, startIndex As Integer, length As Integer) As String
- If String.IsNullOrEmpty(input) Then Return ""
- If startIndex > 0 Then
- If startIndex >= input.Length Then
- Return ""
- End If
- If startIndex + length > input.Length Then
- Return input.Substring(startIndex, input.Length - startIndex)
- Else
- Return input.Substring(startIndex, length)
- End If
- Else
- If length > input.Length Then
- Return input.Substring(0, input.Length - startIndex)
- Else
- Return input.Substring(0, length)
- End If
- End If
- End Function
-
-
- Public Sub WriteAttachmentToXml(attachment As BlogML.Xml.BlogMLAttachment, writer As System.Xml.XmlWriter)
- writer.WriteStartElement("File")
- writer.WriteElementString("Path", attachment.Path)
- writer.WriteStartElement("Data")
- writer.WriteBase64(attachment.Data, 0, attachment.Data.Length - 1)
- writer.WriteEndElement() ' Data
- writer.WriteEndElement() ' File
- End Sub
-
-
- Public Sub AddJavascriptFile(page As Page, moduleVersion As String, jsFilename As String, priority As Integer)
- If DotNetNuke.Entities.Host.Host.CrmEnableCompositeFiles Then
- ClientResourceManager.RegisterScript(page, DotNetNuke.Common.ResolveUrl("~/DesktopModules/Blog/js/" & jsFilename), priority)
- Else
- ClientResourceManager.RegisterScript(page, DotNetNuke.Common.ResolveUrl("~/DesktopModules/Blog/js/" & jsFilename) + "?_=" + moduleVersion, priority)
- End If
- End Sub
-
-
- Public Sub AddJavascriptFile(page As Page, moduleVersion As String, jsFilename As String, name As String, version As String, priority As Integer)
- If DotNetNuke.Entities.Host.Host.CrmEnableCompositeFiles Then
- ClientResourceManager.RegisterScript(page, DotNetNuke.Common.ResolveUrl("~/DesktopModules/Blog/js/" & jsFilename), priority, "DnnBodyProvider", name, version)
- Else
- ClientResourceManager.RegisterScript(page, DotNetNuke.Common.ResolveUrl("~/DesktopModules/Blog/js/" & jsFilename) + "?_=" + moduleVersion, priority, "DnnBodyProvider", name, version)
- End If
- End Sub
-
-
- Public Sub AddCssFile(page As Page, moduleVersion As String, cssFilename As String)
- If DotNetNuke.Entities.Host.Host.CrmEnableCompositeFiles Then
- ClientResourceManager.RegisterStyleSheet(page, DotNetNuke.Common.ResolveUrl("~/DesktopModules/Blog/css/" & cssFilename), FileOrder.Css.ModuleCss)
- Else
- ClientResourceManager.RegisterStyleSheet(page, DotNetNuke.Common.ResolveUrl("~/DesktopModules/Blog/css/" & cssFilename) + "?_=" + moduleVersion, FileOrder.Css.ModuleCss)
- End If
- End Sub
-
-
- Public Sub AddCssFile(page As Page, moduleVersion As String, cssFilename As String, name As String, version As String)
- If DotNetNuke.Entities.Host.Host.CrmEnableCompositeFiles Then
- ClientResourceManager.RegisterStyleSheet(page, DotNetNuke.Common.ResolveUrl("~/DesktopModules/Blog/css/" & cssFilename), FileOrder.Css.ModuleCss, "DnnPageHeaderProvider", name, version)
- Else
- ClientResourceManager.RegisterStyleSheet(page, DotNetNuke.Common.ResolveUrl("~/DesktopModules/Blog/css/" & cssFilename) + "?_=" + moduleVersion, FileOrder.Css.ModuleCss, "DnnPageHeaderProvider", name, version)
- End If
- End Sub
-
-
- Public Function RemoveDiacritics(ByVal text As String) As String
- If String.IsNullOrEmpty(text) Then
- Return text
- End If
-
- Dim normalizedString As String = text.Normalize(NormalizationForm.FormD)
- Dim stringBuilder As StringBuilder = New StringBuilder()
-
- For Each c As Char In normalizedString
- Dim unicodeCategory As UnicodeCategory = CharUnicodeInfo.GetUnicodeCategory(c)
-
- If unicodeCategory <> UnicodeCategory.NonSpacingMark Then
- stringBuilder.Append(c)
- End If
- Next
-
- Return stringBuilder.ToString().Normalize(NormalizationForm.FormC)
- End Function
-#End Region
-
+ '
+ 'Public Function OutputHtml(encodedHtml As String, strFormat As String) As String
+ ' Select Case strFormat.ToLower
+ ' Case ""
+ ' Return HttpUtility.HtmlDecode(encodedHtml)
+ ' Case "js"
+ ' Return HttpUtility.HtmlDecode(encodedHtml).Replace("""", "\""").Replace("'", "\'").Replace(vbCrLf, "\r\n")
+ ' Case Else
+ ' If IsNumeric(strFormat) Then
+ ' Return RemoveHtmlTags(HttpUtility.HtmlDecode(encodedHtml)).SubstringWithoutException(0, Integer.Parse(strFormat))
+ ' Else
+ ' Return HttpUtility.HtmlDecode(encodedHtml)
+ ' End If
+ ' End Select
+ 'End Function
+
+ '
+ 'Public Function SubstringWithoutException(input As String, startIndex As Integer, length As Integer) As String
+ ' If String.IsNullOrEmpty(input) Then Return ""
+ ' If startIndex > 0 Then
+ ' If startIndex >= input.Length Then
+ ' Return ""
+ ' End If
+ ' If startIndex + length > input.Length Then
+ ' Return input.Substring(startIndex, input.Length - startIndex)
+ ' Else
+ ' Return input.Substring(startIndex, length)
+ ' End If
+ ' Else
+ ' If length > input.Length Then
+ ' Return input.Substring(0, input.Length - startIndex)
+ ' Else
+ ' Return input.Substring(0, length)
+ ' End If
+ ' End If
+ 'End Function
+
+ '
+ 'Public Sub WriteAttachmentToXml(attachment As BlogML.Xml.BlogMLAttachment, writer As System.Xml.XmlWriter)
+ ' writer.WriteStartElement("File")
+ ' writer.WriteElementString("Path", attachment.Path)
+ ' writer.WriteStartElement("Data")
+ ' writer.WriteBase64(attachment.Data, 0, attachment.Data.Length - 1)
+ ' writer.WriteEndElement() ' Data
+ ' writer.WriteEndElement() ' File
+ 'End Sub
+
+ '
+ 'Public Sub AddJavascriptFile(page As Page, moduleVersion As String, jsFilename As String, priority As Integer)
+ ' If DotNetNuke.Entities.Host.Host.CrmEnableCompositeFiles Then
+ ' ClientResourceManager.RegisterScript(page, DotNetNuke.Common.ResolveUrl("~/DesktopModules/Blog/js/" & jsFilename), priority)
+ ' Else
+ ' ClientResourceManager.RegisterScript(page, DotNetNuke.Common.ResolveUrl("~/DesktopModules/Blog/js/" & jsFilename) + "?_=" + moduleVersion, priority)
+ ' End If
+ 'End Sub
+
+ '
+ 'Public Sub AddJavascriptFile(page As Page, moduleVersion As String, jsFilename As String, name As String, version As String, priority As Integer)
+ ' If DotNetNuke.Entities.Host.Host.CrmEnableCompositeFiles Then
+ ' ClientResourceManager.RegisterScript(page, DotNetNuke.Common.ResolveUrl("~/DesktopModules/Blog/js/" & jsFilename), priority, "DnnBodyProvider", name, version)
+ ' Else
+ ' ClientResourceManager.RegisterScript(page, DotNetNuke.Common.ResolveUrl("~/DesktopModules/Blog/js/" & jsFilename) + "?_=" + moduleVersion, priority, "DnnBodyProvider", name, version)
+ ' End If
+ 'End Sub
+
+ '
+ 'Public Sub AddCssFile(page As Page, moduleVersion As String, cssFilename As String)
+ ' If DotNetNuke.Entities.Host.Host.CrmEnableCompositeFiles Then
+ ' ClientResourceManager.RegisterStyleSheet(page, DotNetNuke.Common.ResolveUrl("~/DesktopModules/Blog/css/" & cssFilename), FileOrder.Css.ModuleCss)
+ ' Else
+ ' ClientResourceManager.RegisterStyleSheet(page, DotNetNuke.Common.ResolveUrl("~/DesktopModules/Blog/css/" & cssFilename) + "?_=" + moduleVersion, FileOrder.Css.ModuleCss)
+ ' End If
+ 'End Sub
+
+ '
+ 'Public Sub AddCssFile(page As Page, moduleVersion As String, cssFilename As String, name As String, version As String)
+ ' If DotNetNuke.Entities.Host.Host.CrmEnableCompositeFiles Then
+ ' ClientResourceManager.RegisterStyleSheet(page, DotNetNuke.Common.ResolveUrl("~/DesktopModules/Blog/css/" & cssFilename), FileOrder.Css.ModuleCss, "DnnPageHeaderProvider", name, version)
+ ' Else
+ ' ClientResourceManager.RegisterStyleSheet(page, DotNetNuke.Common.ResolveUrl("~/DesktopModules/Blog/css/" & cssFilename) + "?_=" + moduleVersion, FileOrder.Css.ModuleCss, "DnnPageHeaderProvider", name, version)
+ ' End If
+ 'End Sub
End Module
End Namespace
diff --git a/Server/Blog/Components/Common/Globals.vb b/Server/Blog/Components/Common/Globals.vb
index c30fe26f..3fc64394 100644
--- a/Server/Blog/Components/Common/Globals.vb
+++ b/Server/Blog/Components/Common/Globals.vb
@@ -18,123 +18,9 @@
' DEALINGS IN THE SOFTWARE.
'
-Imports System.Linq
-Imports DotNetNuke.Entities.Content.Taxonomy
-
Namespace Common
Public Class Globals
-
-#Region " Constants "
- Public Const SharedResourceFileName As String = "~/DesktopModules/Blog/App_LocalResources/SharedResources.resx"
- Public Const glbAppName As String = "Blog"
- Public Const glbImageHandlerPath As String = "~/DesktopModules/Blog/BlogImage.ashx"
- Public Const glbPermittedFileExtensions As String = ".jpg,.png,.gif,.bmp,"
- Public Const glbTemplatesPath As String = "~/DesktopModules/Blog/Templates/"
- Public Const glbServicesPath As String = "~/DesktopModules/Blog/API/"
- Public Const BloggerPermission As String = "BLOGGER"
-
- Public Enum SummaryType
- PlainTextIndependent = 0
- HtmlIndependent = 1
- HtmlPrecedesPost = 2
- End Enum
-
- Public Enum LocalizationType
- None = 0
- Loose = 1
- Strict = 2
- End Enum
-#End Region
-
-#Region " Dates "
- Public Shared Function UtcToLocalTime(utcTime As Date, TimeZone As TimeZoneInfo) As Date
- Return TimeZoneInfo.ConvertTimeFromUtc(utcTime, TimeZone)
- End Function
-
- Public Shared Function ParseDate(DateString As String, Culture As String) As DateTime
- Dim dtf As System.Globalization.DateTimeFormatInfo = New System.Globalization.CultureInfo(Culture, False).DateTimeFormat
- Try
- Return Date.Parse(DateString, dtf)
- Catch ex As Exception
- Return Nothing
- End Try
- End Function
-
- Public Shared Function IsValidDate(DateString As String, Culture As String) As Boolean
- Dim dtf As System.Globalization.DateTimeFormatInfo = New System.Globalization.CultureInfo(Culture, False).DateTimeFormat
- Try
- Dim oDate As Date = Date.Parse(DateString, dtf)
- Return True
- Catch ex As Exception
- Return False
- End Try
- End Function
-
- Public Shared Function GetLocalAddedTime(AddedDate As DateTime, PortalId As Integer, user As DotNetNuke.Entities.Users.UserInfo) As DateTime
- Return TimeZoneInfo.ConvertTimeToUtc(AddedDate, user.Profile.PreferredTimeZone)
- End Function
-#End Region
-
-#Region " Other "
- Public Shared Function GetBlogDirectoryMapPath(blogId As Integer) As String
- Return String.Format("{0}Blog\Files\{1}\", DotNetNuke.Entities.Portals.PortalSettings.Current.HomeDirectoryMapPath, blogId)
- End Function
- Public Shared Function GetBlogDirectoryPath(blogId As Integer) As String
- Return String.Format("{0}Blog/Files/{1}/", DotNetNuke.Entities.Portals.PortalSettings.Current.HomeDirectory, blogId)
- End Function
- Public Shared Function GetPostDirectoryMapPath(blogId As Integer, postId As Integer) As String
- Return String.Format("{0}Blog\Files\{1}\{2}\", DotNetNuke.Entities.Portals.PortalSettings.Current.HomeDirectoryMapPath, blogId, postId)
- End Function
- Public Shared Function GetPostDirectoryPath(blogId As Integer, postId As Integer) As String
- Return String.Format("{0}Blog/Files/{1}/{2}/", DotNetNuke.Entities.Portals.PortalSettings.Current.HomeDirectory, blogId, postId)
- End Function
- Public Shared Function GetPostDirectoryMapPath(post As Entities.Posts.PostInfo) As String
- Return GetPostDirectoryMapPath(post.BlogID, post.ContentItemId)
- End Function
- Public Shared Function GetPostDirectoryPath(post As Entities.Posts.PostInfo) As String
- Return GetPostDirectoryPath(post.BlogID, post.ContentItemId)
- End Function
- Public Shared Function GetTempPostDirectoryMapPath(blogId As Integer) As String
- Return String.Format("{0}Blog\Files\{1}\_temp_images\", DotNetNuke.Entities.Portals.PortalSettings.Current.HomeDirectoryMapPath, blogId)
- End Function
- Public Shared Function GetTempPostDirectoryPath(blogId As Integer) As String
- Return String.Format("{0}Blog/Files/{1}/_temp_images/", DotNetNuke.Entities.Portals.PortalSettings.Current.HomeDirectory, blogId)
- End Function
-
- Public Shared Function ManifestFilePath(tabId As Integer, moduleId As Integer) As String
- Return String.Format("~/DesktopModules/Blog/API/Modules/Manifest?TabId={0}&ModuleId={1}", tabId, moduleId)
- End Function
-
- Public Shared Function GetAString(Value As Object) As String
- If Value Is Nothing Then
- Return ""
- Else
- If Value Is DBNull.Value Then
- Return ""
- Else
- Return CType(Value, String)
- End If
- End If
- End Function
-
- Public Shared Function ReadFile(fileName As String) As String
- If Not IO.File.Exists(fileName) Then Return ""
- Using sr As New IO.StreamReader(fileName)
- Return sr.ReadToEnd
- End Using
- End Function
-
- Public Shared Sub WriteToFile(filePath As String, text As String)
- WriteToFile(filePath, text, False)
- End Sub
- Public Shared Sub WriteToFile(filePath As String, text As String, append As Boolean)
- Using sw As New IO.StreamWriter(filePath, append)
- sw.Write(text)
- sw.Flush()
- End Using
- End Sub
-
Public Shared Function GetResource(resourceName As String) As String
Dim res As String = ""
Using stream As IO.Stream = System.Reflection.Assembly.GetExecutingAssembly.GetManifestResourceStream(resourceName)
@@ -144,143 +30,5 @@ Namespace Common
End Using
Return res
End Function
-
- Public Shared Function FormatBoolean(value As Boolean, format As String) As String
- If String.IsNullOrEmpty(format) Then
- Return value.ToString
- End If
- If format.Contains(";") Then
- If value Then
- Return Left(format, format.IndexOf(";"))
- Else
- Return Mid(format, format.IndexOf(";") + 2)
- End If
- End If
- Return value.ToString
- End Function
-
- Public Shared Function GetSummary(body As String, autoGenerateLength As Integer, summaryModel As SummaryType, encoded As Boolean) As String
- If String.IsNullOrEmpty(body) Then Return ""
- Dim res As String = body
- If encoded Then
- res = HttpUtility.HtmlDecode(res)
- End If
- res = TryToGetFirstParagraph(res)
- res = RemoveHtmlTags(res).SubstringWithoutException(0, autoGenerateLength)
- If res.Length >= autoGenerateLength Then res &= " ..."
- If Not summaryModel = SummaryType.PlainTextIndependent Then
- res = String.Format("
{0}
", res)
- End If
- If encoded Then
- Return HttpUtility.HtmlEncode(res)
- Else
- Return res
- End If
- End Function
-
- Public Shared Function TryToGetFirstParagraph(inputString As String) As String
- Dim m As Match = Regex.Match(inputString, "(?s)(?i)
]*>((?:(?!
).)*)(?-i)(?-s)")
- If m.Success Then
- Return m.Groups(1).Value
- End If
- Return inputString
- End Function
-
- Public Shared Function RemoveHtmlTags(inputString As String) As String
- inputString = Regex.Replace(inputString, "<[^>]+>", "")
- Return (New DotNetNuke.Security.PortalSecurity).InputFilter(inputString, DotNetNuke.Security.PortalSecurity.FilterFlag.NoScripting Or DotNetNuke.Security.PortalSecurity.FilterFlag.NoMarkup)
- End Function
-
- Friend Shared Function GetPortalVocabularies(portalId As Integer) As List(Of Vocabulary)
- Dim cntVocab As IVocabularyController = DotNetNuke.Entities.Content.Common.Util.GetVocabularyController()
- Dim colVocabularies As IQueryable(Of Vocabulary) = cntVocab.GetVocabularies()
- Dim portalVocabularies As IQueryable(Of Vocabulary) = From v In colVocabularies Where v.ScopeTypeId = 2 And v.ScopeId = portalId
- Return portalVocabularies.ToList()
- End Function
-
- Public Shared Function GetSafePageName(pageName As String) As String
- Return Regex.Replace(Regex.Replace(pageName, "[^\w^\d]", "-").Trim("-"c), "-+", "-").RemoveDiacritics()
- End Function
-
- Public Shared Sub RemoveOldTimeStampedFiles(dir As IO.DirectoryInfo)
- Dim today As String = Date.Now.ToString("yyyy-MM-dd")
- Dim deleteList As New List(Of String)
- For Each f As IO.FileInfo In dir.GetFiles
- Dim m As Match = Regex.Match(f.Name, "^(\d\d\d\d-\d\d-\d\d)-")
- If m.Success Then
- If m.Groups(1).Value < today Then
- deleteList.Add(f.FullName)
- End If
- End If
- Next
- For Each f As String In deleteList
- Try
- IO.File.Delete(f)
- Catch ex As Exception
- End Try
- Next
- End Sub
-
- Public Shared Function GetRolesByGroup(portalId As Integer, roleGroupId As Integer) As List(Of DotNetNuke.Security.Roles.RoleInfo)
- Return DotNetNuke.Security.Roles.RoleProvider.Instance.GetRoles(portalId).Cast(Of DotNetNuke.Security.Roles.RoleInfo).Where(Function(r) r.RoleGroupID = roleGroupId).ToList
- End Function
-
- Public Shared Function GetRolesByPortal(portalId As Integer) As List(Of DotNetNuke.Security.Roles.RoleInfo)
- Return DotNetNuke.Security.Roles.RoleProvider.Instance.GetRoles(portalId).Cast(Of DotNetNuke.Security.Roles.RoleInfo).ToList
- End Function
-
- Public Shared Function SafeString(input As String, filter As DotNetNuke.Security.PortalSecurity.FilterFlag) As String
- Dim ps As New DotNetNuke.Security.PortalSecurity
- Return ps.InputFilter(input, filter)
- End Function
-
- Public Shared Function SafeString(input As String) As String
- Return SafeString(input, DotNetNuke.Security.PortalSecurity.FilterFlag.NoMarkup And DotNetNuke.Security.PortalSecurity.FilterFlag.NoProfanity And DotNetNuke.Security.PortalSecurity.FilterFlag.NoScripting And DotNetNuke.Security.PortalSecurity.FilterFlag.NoSQL)
- End Function
-
- Public Shared Function SafeHtml(input As String) As String
- Return SafeString(input, DotNetNuke.Security.PortalSecurity.FilterFlag.NoProfanity And DotNetNuke.Security.PortalSecurity.FilterFlag.NoScripting And DotNetNuke.Security.PortalSecurity.FilterFlag.NoSQL)
- End Function
-
- Public Shared Function SafeStringSimpleHtml(input As String) As String
- input = SafeString(input)
- input = Regex.Replace(input, "(?#Protocol)(?:(?:ht|f)tp(?:s?)\:\/\/|~\/|\/)?(?#Username:Password)(?:\w+:\w+@)?(?#Subdomains)(?:(?:[-\w]+\.)+(?#TopLevel Domains)(?:com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel|[a-z]{2}))(?#Port)(?::[\d]{1,5})?(?#Directories)(?:(?:(?:\/(?:[-\w~!$+|.,=]|%[a-f\d]{2})+)+|\/)+|\?|#)?(?#Query)(?:(?:\?(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)(?:&(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=?(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(?#Anchor)(?:#(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)?", AddressOf ReplaceLink)
- input = input.Replace(vbCrLf, " ")
- Return input
- End Function
-
- Public Shared Function CleanStringForXmlAttribute(input As String) As String
- Return input.Replace("&", "and").Replace("""", """)
- End Function
-
- Public Shared Function ReplaceLink(m As Match) As String
- Dim link As String = m.Value
- Return String.Format("{0}", link)
- End Function
-
- Public Shared Function readElement(reader As System.Xml.XmlReader, ElementName As String) As String
- If (Not reader.NodeType = System.Xml.XmlNodeType.Element) OrElse reader.Name <> ElementName Then
- reader.ReadToFollowing(ElementName)
- End If
- If reader.NodeType = System.Xml.XmlNodeType.Element Then
- Return reader.ReadElementContentAsString
- Else
- Return ""
- End If
- End Function
-
- Public Shared Function readAttribute(reader As System.Xml.XmlReader, attributeName As String) As String
- If (Not reader.NodeType = System.Xml.XmlNodeType.Attribute) OrElse reader.Name <> attributeName Then
- reader.ReadToFollowing(attributeName)
- End If
- If reader.NodeType = System.Xml.XmlNodeType.Attribute Then
- Return reader.ReadContentAsString
- Else
- Return ""
- End If
- End Function
-#End Region
-
End Class
-
End Namespace
\ No newline at end of file
diff --git a/Server/Blog/Components/Common/Image.vb b/Server/Blog/Components/Common/Image.vb
deleted file mode 100644
index 5fbd7f12..00000000
--- a/Server/Blog/Components/Common/Image.vb
+++ /dev/null
@@ -1,175 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-Imports System.Drawing.Imaging
-Imports System.Drawing
-
-Namespace Common
- Public Class Image
-
- Public Const glbJpegFileType As String = ".jpg"
- Public Const glbPngFileType As String = ".png"
- Public Const glbGifFileType As String = ".gif"
-
- Private _thisImage As Bitmap
- Private _imgFormat As ImageFormat
- Private _imgRatio As Single
- Private _extension As String = ""
- Private _newExtension As String = ""
- Private _originalFile As String = ""
-
- Public Property IsValidExtension As Boolean = True
- Public Property MimeType As String = "image/jpeg"
- Public Property OriginalWidth As Integer
- Public Property OriginalHeight As Integer
- Public Property Scale As Double
- Public Property NewHeight As Integer
- Public Property NewWidth As Integer
-
- Public Sub New(originalFilePath As String)
- _originalFile = originalFilePath
- _extension = IO.Path.GetExtension(originalFilePath).ToLower
- If _extension = glbGifFileType Or _extension = glbJpegFileType Or _extension = glbPngFileType Then
- _thisImage = New Bitmap(originalFilePath)
- _imgFormat = _thisImage.RawFormat
- OriginalWidth = _thisImage.Width
- OriginalHeight = _thisImage.Height
- _imgRatio = Convert.ToSingle(OriginalHeight / OriginalWidth)
- Select Case _extension
- Case glbGifFileType
- MimeType = "image/gif"
- Case glbPngFileType
- MimeType = "image/png"
- End Select
- Else
- IsValidExtension = False
- End If
- End Sub
-
- Public Function ResizeImage(maxWidth As Integer, maxHeight As Integer, crop As Boolean) As String
-
- Select Case _extension
- Case glbGifFileType.ToLower
- _newExtension = glbGifFileType
- Return ResizeImage(maxWidth, maxHeight, crop, ImageFormat.Gif)
- Case glbPngFileType.ToLower
- _newExtension = glbPngFileType
- Return ResizeImage(maxWidth, maxHeight, crop, ImageFormat.Png)
- Case Else ' jpg
- _newExtension = glbJpegFileType
- Return ResizeImage(maxWidth, maxHeight, crop, ImageFormat.Jpeg)
- End Select
-
- End Function
-
- Public Function ResizeImage(maxWidth As Integer, maxHeight As Integer, crop As Boolean, format As ImageFormat) As String
-
- Try
-
- Dim backBuffer As Bitmap = Nothing
- Dim backBufferGraphics As Graphics = Nothing
-
- If maxHeight = -1 Then
-
- NewHeight = CInt(Math.Floor(_imgRatio * maxWidth))
- Scale = maxWidth / OriginalWidth
- backBuffer = New Bitmap(maxWidth, NewHeight, Drawing.Imaging.PixelFormat.Format32bppRgb)
- backBufferGraphics = Graphics.FromImage(backBuffer)
- backBufferGraphics.InterpolationMode = Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
- backBufferGraphics.SmoothingMode = Drawing.Drawing2D.SmoothingMode.AntiAlias
- backBufferGraphics.DrawImage(_thisImage, 0, 0, maxWidth, NewHeight)
-
- ElseIf maxWidth = -1 Then
-
- NewWidth = CInt(Math.Floor(maxHeight / _imgRatio))
- Scale = maxHeight / OriginalHeight
- backBuffer = New Bitmap(NewWidth, maxHeight, Drawing.Imaging.PixelFormat.Format32bppRgb)
- backBufferGraphics = Graphics.FromImage(backBuffer)
- backBufferGraphics.InterpolationMode = Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
- backBufferGraphics.SmoothingMode = Drawing.Drawing2D.SmoothingMode.AntiAlias
- backBufferGraphics.DrawImage(_thisImage, 0, 0, NewWidth, maxHeight)
-
- ElseIf crop Then
-
- Dim WidthOverflow As Boolean = False
- Scale = maxWidth / OriginalWidth
- If (maxHeight / OriginalHeight) > Scale Then
- Scale = (maxHeight / OriginalHeight)
- WidthOverflow = True
- End If
- NewHeight = maxHeight
- NewWidth = maxWidth
- backBuffer = New Bitmap(NewWidth, NewHeight, Drawing.Imaging.PixelFormat.Format32bppRgb)
- backBufferGraphics = Graphics.FromImage(backBuffer)
- backBufferGraphics.InterpolationMode = Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
- backBufferGraphics.SmoothingMode = Drawing.Drawing2D.SmoothingMode.AntiAlias
- If WidthOverflow Then
- Dim Overflow As Integer = Convert.ToInt32(((Scale * OriginalWidth) - maxWidth) / 2)
- backBufferGraphics.DrawImage(_thisImage, -1 * Overflow, 0, Convert.ToInt32(OriginalWidth * Scale), NewHeight)
- Else
- Dim Overflow As Integer = Convert.ToInt32(((Scale * OriginalHeight) - maxHeight) / 2)
- backBufferGraphics.DrawImage(_thisImage, 0, -1 * Overflow, NewWidth, Convert.ToInt32(OriginalHeight * Scale))
- End If
-
- Else
-
- Scale = maxWidth / OriginalWidth
- If (maxHeight / OriginalHeight) < Scale Then
- Scale = (maxHeight / OriginalHeight)
- End If
- If Scale > 1 Then
- Scale = 1
- NewHeight = OriginalHeight
- NewWidth = OriginalWidth
- Else
- NewHeight = Convert.ToInt32(OriginalHeight * Scale)
- NewWidth = Convert.ToInt32(OriginalWidth * Scale)
- End If
- backBuffer = New Bitmap(NewWidth, NewHeight, Drawing.Imaging.PixelFormat.Format32bppRgb)
- backBufferGraphics = Graphics.FromImage(backBuffer)
- backBufferGraphics.InterpolationMode = Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
- backBufferGraphics.SmoothingMode = Drawing.Drawing2D.SmoothingMode.AntiAlias
- backBufferGraphics.DrawImage(_thisImage, 0, 0, NewWidth, NewHeight)
-
- End If
-
- Dim newFilePath As String = _originalFile.Substring(0, _originalFile.LastIndexOf(".")) & String.Format("-{0}-{1}-{2}", maxWidth, maxHeight, crop) & _newExtension
- backBuffer.Save(newFilePath, _imgFormat)
- Return newFilePath
-
- Catch ex As Exception
-
- Throw New Exception(ex.Message)
-
- End Try
-
- End Function
-
- Public Sub Dispose()
- Try
- _thisImage.Dispose()
- _thisImage = Nothing
- Catch
- End Try
- End Sub
-
-
- End Class
-End Namespace
diff --git a/Server/Blog/Components/Common/LocalizedText.vb b/Server/Blog/Components/Common/LocalizedText.vb
deleted file mode 100644
index 8b465a8c..00000000
--- a/Server/Blog/Components/Common/LocalizedText.vb
+++ /dev/null
@@ -1,221 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-Imports System.Xml
-Imports System.Xml.Schema
-Imports System.Xml.Serialization
-
-Namespace Common
- _
- Public Class LocalizedText
- Implements IXmlSerializable
-
-#Region " Properties "
- Private _texts As New Dictionary(Of String, String)
- Public ReadOnly Property Locales As List(Of String)
- Get
- Dim res As New List(Of String)
- For Each k As String In _texts.Keys
- res.Add(k)
- Next
- Return res
- End Get
- End Property
- Default Public Property Item(ByVal key As String) As String
- Get
- If ContainsKey(key) Then
- Return _texts.Item(key)
- Else
- Return ""
- End If
- End Get
- Set(ByVal value As String)
- _texts.Item(key) = value
- End Set
- End Property
-#End Region
-
-#Region " Public Methods "
- Public Function GetDictionary() As Dictionary(Of String, String)
- Return _texts
- End Function
- Public Function ContainsKey(ByVal key As String) As Boolean
- Return _texts.ContainsKey(key)
- End Function
- Public Sub Add(ByVal key As String, ByVal value As String)
- _texts.Add(key, value)
- End Sub
- Public Function Remove(ByVal key As String) As Boolean
- Return _texts.Remove(key)
- End Function
-#End Region
-
-#Region " Constructors "
- Public Sub New()
- MyBase.New()
- End Sub
-
- Public Sub New(ByVal ir As IDataReader, ByVal FieldName As String)
- MyBase.New()
- Do While ir.Read
- If ir.Item(FieldName) IsNot DBNull.Value Then
- _texts.Add(CStr(ir.Item("Locale")), CStr(ir.Item(FieldName)))
- End If
- Loop
- ir.Close()
- ir.Dispose()
- End Sub
-#End Region
-
-#Region " (De)Serialization "
- Public Function ToJSONArray(ByVal DefaultLocale As String, ByVal DefaultText As String) As String
- Dim res As String = ""
- For Each localeCode As String In _texts.Keys
- res &= ", """ & localeCode.Replace("-", "_") & """: """
- res &= CStr(_texts.Item(localeCode))
- res &= """"
- Next
- res &= ", """ & DefaultLocale.Replace("-", "_") & """: """
- res &= DefaultText
- res &= """"
- Return res
- End Function
-
- Public Overrides Function ToString() As String
- Dim res As New StringBuilder
- Dim xw As XmlWriter = XmlTextWriter.Create(res)
- xw.WriteStartElement("MLText")
- For Each l As String In _texts.Keys
- xw.WriteStartElement("Text")
- xw.WriteAttributeString("Locale", l)
- xw.WriteString(_texts.Item(l))
- xw.WriteEndElement()
- Next
- xw.WriteEndElement()
- xw.Flush()
- Return res.ToString
- End Function
-
- Public Sub Deserialize(ByVal xml As String)
- Dim str As New IO.StringReader(xml)
- Dim xr As XmlReader = XmlTextReader.Create(str)
- xr.MoveToContent()
- Do While xr.ReadToFollowing("Text")
- If xr.MoveToAttribute("Locale") Then
- Dim l As String = xr.ReadContentAsString
- xr.MoveToContent()
- Dim s As String = xr.ReadElementContentAsString
- _texts.Add(l, s)
- End If
- Loop
- End Sub
-
- Public Sub FromXml(xml As XmlNode)
- If xml Is Nothing Then Exit Sub
-
- End Sub
-
- Public Function ToConcatenatedString() As String
- Dim res As New StringBuilder
- For Each l As String In _texts.Keys
- res.Append(_texts.Item(l))
- res.Append(" ")
- Next
- Return res.ToString
- End Function
-#End Region
-
-#Region " IXmlSerializable Implementation "
- Public Function GetSchema() As XmlSchema Implements IXmlSerializable.GetSchema
- Return Nothing
- End Function
-
- Private Function readElement(ByVal reader As XmlReader, ByVal ElementName As String) As String
- If (Not reader.NodeType = XmlNodeType.Element) OrElse reader.Name <> ElementName Then
- reader.ReadToFollowing(ElementName)
- End If
- If reader.NodeType = XmlNodeType.Element Then
- Return reader.ReadElementContentAsString
- Else
- Return ""
- End If
- End Function
-
- Private Function readAttribute(ByVal reader As XmlReader, ByVal AttributeName As String) As String
- If reader.HasAttributes Then
- reader.MoveToAttribute(AttributeName)
- Return reader.Value
- Else
- Return ""
- End If
- End Function
-
- ''' -----------------------------------------------------------------------------
- '''
- ''' ReadXml fills the object (de-serializes it) from the XmlReader passed
- '''
- '''
- ''' The XmlReader that contains the xml for the object
- '''
- ''' [pdonker] 05/21/2008 Created
- '''
- ''' -----------------------------------------------------------------------------
- Public Sub ReadXml(ByVal reader As XmlReader) Implements IXmlSerializable.ReadXml
- Do While reader.Name = "Text"
- reader.ReadStartElement("Text")
- Dim loc As String = readAttribute(reader, "Locale")
- If loc <> "" Then
- Dim txt As String = reader.ReadElementContentAsString
- Add(loc, txt)
- End If
- reader.ReadEndElement() ' Text
- Loop
- End Sub
-
- Public Sub ReadXml(ByVal xMLText As XmlNode)
- If xMLText Is Nothing Then Exit Sub
- For Each xText As XmlNode In xMLText.ChildNodes
- Dim locale As String = xText.Attributes("Locale").InnerText
- _texts.Add(locale, xText.InnerText)
- Next
- End Sub
-
- ''' -----------------------------------------------------------------------------
- '''
- ''' WriteXml converts the object to Xml (serializes it) and writes it using the XmlWriter passed
- '''
- '''
- ''' The XmlWriter that contains the xml for the object
- '''
- ''' [pdonker] 05/21/2008 Created
- '''
- ''' -----------------------------------------------------------------------------
- Public Sub WriteXml(ByVal writer As XmlWriter) Implements IXmlSerializable.WriteXml
- For Each locale As String In _texts.Keys
- writer.WriteStartElement("Text")
- writer.WriteAttributeString("Locale", locale)
- writer.WriteCData(_texts.Item(locale))
- writer.WriteEndElement()
- Next
- End Sub
-#End Region
-
- End Class
-End Namespace
\ No newline at end of file
diff --git a/Server/Blog/Components/Common/ModuleSettings.vb b/Server/Blog/Components/Common/ModuleSettings.vb
deleted file mode 100644
index 00f18729..00000000
--- a/Server/Blog/Components/Common/ModuleSettings.vb
+++ /dev/null
@@ -1,280 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-Imports System.Xml
-Imports DotNetNuke.Common.Utilities
-Imports DotNetNuke.Services.Tokens
-Imports DotNetNuke.Modules.Blog.Common.Globals
-
-Namespace Common
-
- Public Class ModuleSettings
- Implements IPropertyAccess
-
-#Region " Private Members "
- Private _allSettings As Hashtable = Nothing
- Private _moduleId As Integer = -1
- Private _importedModuleId As Integer = -1
-#End Region
-
-#Region " Properties "
- Public Property Version As String = "0.0.0"
- Public Property AllowWLW As Boolean = False
- Public Property AllowMultipleCategories As Boolean = True
- Public Property VocabularyId As Integer = -1
- Public Property AllowAttachments As Boolean = True
- Public Property SummaryModel As SummaryType = SummaryType.HtmlIndependent
- Public Property StyleDetectionUrl As String = ""
- Public Property WLWRecentPostsMax As Integer = 10
- Public Property AutoGenerateMissingSummary As Boolean = True
- Public Property AutoGeneratedSummaryLength As Integer = 1000
- Public Property FacebookAppId As String = ""
- Public Property FacebookProfileIdProperty As Integer = -1
-
- Public Property ModifyPageDetails As Boolean = False
-
- Public Property RssEmail As String = ""
- Public Property RssDefaultNrItems As Integer = 20
- Public Property RssMaxNrItems As Integer = 50
- Public Property RssTtl As Integer = 30
- Public Property RssImageWidth As Integer = 144
- Public Property RssImageHeight As Integer = 96
- Public Property RssImageSizeAllowOverride As Boolean = True
- Public Property RssAllowContentInFeed As Boolean = True
- Public Property RssDefaultCopyright As String = ""
-
- Public Property PortalTemplatesPath As String = ""
- Public Property IncrementViewCount As Integer = 60 'seconds
- Private Property PortalModulePath As String = ""
- Private Property PortalModuleMapPath As String = ""
- Private _portalTemplatesMapPath As String = ""
- Public Property UseFriendlyURLs As Boolean = True
-
- Public ReadOnly Property PortalTemplatesMapPath As String
- Get
- Return _portalTemplatesMapPath
- End Get
- End Property
- Public ReadOnly Property ModuleId As Integer
- Get
- Return _moduleId
- End Get
- End Property
-#End Region
-
-#Region " Constructors "
- Public Sub New(moduleId As Integer)
-
- _moduleId = moduleId
- Version = [GetType]().Assembly.GetName().Version.ToString()
- _allSettings = (New DotNetNuke.Entities.Modules.ModuleController).GetModule(moduleId).ModuleSettings
- _allSettings.ReadValue("AllowWLW", AllowWLW)
- _allSettings.ReadValue("AllowMultipleCategories", AllowMultipleCategories)
- _allSettings.ReadValue("VocabularyId", VocabularyId)
- _allSettings.ReadValue("AllowAttachments", AllowAttachments)
- _allSettings.ReadValue("SummaryModel", SummaryModel)
- _allSettings.ReadValue("StyleDetectionUrl", StyleDetectionUrl)
- _allSettings.ReadValue("WLWRecentPostsMax", WLWRecentPostsMax)
- _allSettings.ReadValue("ModifyPageDetails", ModifyPageDetails)
- _allSettings.ReadValue("AutoGenerateMissingSummary", AutoGenerateMissingSummary)
- _allSettings.ReadValue("AutoGeneratedSummaryLength", AutoGeneratedSummaryLength)
- _allSettings.ReadValue("FacebookAppId", FacebookAppId)
- _allSettings.ReadValue("FacebookProfileIdProperty", FacebookProfileIdProperty)
-
- _allSettings.ReadValue("RssEmail", RssEmail)
- _allSettings.ReadValue("RssDefaultNrItems", RssDefaultNrItems)
- _allSettings.ReadValue("RssMaxNrItems", RssMaxNrItems)
- _allSettings.ReadValue("RssTtl", RssTtl)
- _allSettings.ReadValue("RssImageWidth", RssImageWidth)
- _allSettings.ReadValue("RssImageHeight", RssImageHeight)
- _allSettings.ReadValue("RssImageSizeAllowOverride", RssImageSizeAllowOverride)
- _allSettings.ReadValue("RssAllowContentInFeed", RssAllowContentInFeed)
- _allSettings.ReadValue("RssDefaultCopyright", RssDefaultCopyright)
- _allSettings.ReadValue("IncrementViewCount", IncrementViewCount)
-
- _PortalModulePath = DotNetNuke.Entities.Portals.PortalSettings.Current.HomeDirectory
- If Not _PortalModulePath.EndsWith("/") Then
- _PortalModulePath &= "/"
- End If
- _PortalModulePath &= String.Format("Blog/", moduleId)
-
- _PortalModuleMapPath = DotNetNuke.Entities.Portals.PortalSettings.Current.HomeDirectoryMapPath
- If Not _PortalModuleMapPath.EndsWith("\") Then
- _PortalModuleMapPath &= "\"
- End If
- _PortalModuleMapPath &= String.Format("Blog\", moduleId)
-
- _portalTemplatesMapPath = String.Format("{0}Templates\", _PortalModuleMapPath)
- If Not IO.Directory.Exists(_portalTemplatesMapPath) Then
- IO.Directory.CreateDirectory(_portalTemplatesMapPath)
- End If
- _PortalTemplatesPath = String.Format("{0}Templates/", _PortalModulePath)
-
- End Sub
-
- Public Shared Function GetModuleSettings(moduleId As Integer) As ModuleSettings
- Dim CacheKey As String = "Blog_ModuleSettings" & moduleId.ToString
- Dim settings As ModuleSettings = CType(DotNetNuke.Common.Utilities.DataCache.GetCache(CacheKey), ModuleSettings)
- If settings Is Nothing Then
- settings = New ModuleSettings(moduleId)
- DotNetNuke.Common.Utilities.DataCache.SetCache(CacheKey, settings)
- End If
- Return settings
- End Function
-#End Region
-
-#Region " Public Members "
- Public Overridable Sub UpdateSettings()
-
- Dim objModules As New DotNetNuke.Entities.Modules.ModuleController
- objModules.UpdateModuleSetting(_moduleId, "AllowWLW", AllowWLW.ToString)
- objModules.UpdateModuleSetting(_moduleId, "AllowMultipleCategories", AllowMultipleCategories.ToString)
- objModules.UpdateModuleSetting(_moduleId, "VocabularyId", VocabularyId.ToString)
- objModules.UpdateModuleSetting(_moduleId, "AllowAttachments", AllowAttachments.ToString)
- objModules.UpdateModuleSetting(_moduleId, "SummaryModel", CInt(SummaryModel).ToString)
- objModules.UpdateModuleSetting(_moduleId, "StyleDetectionUrl", StyleDetectionUrl)
- objModules.UpdateModuleSetting(_moduleId, "WLWRecentPostsMax", WLWRecentPostsMax.ToString)
- objModules.UpdateModuleSetting(_moduleId, "ModifyPageDetails", ModifyPageDetails.ToString)
- objModules.UpdateModuleSetting(_moduleId, "AutoGenerateMissingSummary", AutoGenerateMissingSummary.ToString)
- objModules.UpdateModuleSetting(_moduleId, "AutoGeneratedSummaryLength", AutoGeneratedSummaryLength.ToString)
- objModules.UpdateModuleSetting(_moduleId, "FacebookAppId", FacebookAppId)
- objModules.UpdateModuleSetting(_moduleId, "FacebookProfileIdProperty", FacebookProfileIdProperty.ToString)
-
- objModules.UpdateModuleSetting(_moduleId, "RssEmail", RssEmail)
- objModules.UpdateModuleSetting(_moduleId, "RssDefaultNrItems", RssDefaultNrItems.ToString)
- objModules.UpdateModuleSetting(_moduleId, "RssMaxNrItems", RssMaxNrItems.ToString)
- objModules.UpdateModuleSetting(_moduleId, "RssTtl", RssTtl.ToString)
- objModules.UpdateModuleSetting(_moduleId, "RssImageWidth", RssImageWidth.ToString)
- objModules.UpdateModuleSetting(_moduleId, "RssImageHeight", RssImageHeight.ToString)
- objModules.UpdateModuleSetting(_moduleId, "RssImageSizeAllowOverride", RssImageSizeAllowOverride.ToString)
- objModules.UpdateModuleSetting(_moduleId, "RssAllowContentInFeed", RssAllowContentInFeed.ToString)
- objModules.UpdateModuleSetting(_moduleId, "RssDefaultCopyright", RssDefaultCopyright)
- objModules.UpdateModuleSetting(_moduleId, "IncrementViewCount", IncrementViewCount.ToString)
- If _importedModuleId > -1 Then objModules.UpdateModuleSetting(_moduleId, "ImportedModuleID", _importedModuleId.ToString)
-
- Dim CacheKey As String = "Blog_ModuleSettings" & _moduleId.ToString
- DotNetNuke.Common.Utilities.DataCache.SetCache(CacheKey, Me)
- End Sub
-#End Region
-
-#Region " IPropertyAccess Implementation "
- Public Function GetProperty(strPropertyName As String, strFormat As String, formatProvider As System.Globalization.CultureInfo, AccessingUser As DotNetNuke.Entities.Users.UserInfo, AccessLevel As DotNetNuke.Services.Tokens.Scope, ByRef PropertyNotFound As Boolean) As String Implements DotNetNuke.Services.Tokens.IPropertyAccess.GetProperty
- Dim OutputFormat As String = String.Empty
- Dim portalSettings As DotNetNuke.Entities.Portals.PortalSettings = DotNetNuke.Entities.Portals.PortalController.Instance.GetCurrentPortalSettings
- If strFormat = String.Empty Then
- OutputFormat = "D"
- Else
- OutputFormat = strFormat
- End If
- Select Case strPropertyName.ToLower
- Case "email"
- Return PropertyAccess.FormatString(RssEmail, strFormat)
- Case "allowmultiplecategories"
- Return AllowMultipleCategories.ToString(formatProvider)
- Case "allowattachments"
- Return AllowAttachments.ToString(formatProvider)
- Case "summarymodel"
- Return CInt(SummaryModel).ToString
-
- Case "portaltemplatespath"
- Return PropertyAccess.FormatString(PortalTemplatesPath, strFormat)
- Case "portalmodulepath"
- Return PropertyAccess.FormatString(_PortalModulePath, strFormat)
- Case "apppath"
- Return DotNetNuke.Common.ApplicationPath
- Case "imagehandlerpath"
- Return DotNetNuke.Common.ResolveUrl(glbImageHandlerPath)
- Case "facebookappid"
- Return FacebookAppId
- Case Else
- PropertyNotFound = True
- End Select
-
- Return Null.NullString
- End Function
-
- Public ReadOnly Property Cacheability() As DotNetNuke.Services.Tokens.CacheLevel Implements DotNetNuke.Services.Tokens.IPropertyAccess.Cacheability
- Get
- Return CacheLevel.fullyCacheable
- End Get
- End Property
-#End Region
-
-#Region " Serialization "
- Public Sub Serialize(writer As XmlWriter)
- writer.WriteStartElement("Settings")
- writer.WriteElementString("ModuleID", ModuleId.ToString)
- writer.WriteElementString("AllowWLW", AllowWLW.ToString)
- writer.WriteElementString("AllowMultipleCategories", AllowMultipleCategories.ToString)
- writer.WriteElementString("VocabularyId", VocabularyId.ToString)
- writer.WriteElementString("AllowAttachments", AllowAttachments.ToString)
- writer.WriteElementString("SummaryModel", SummaryModel.ToString)
- writer.WriteElementString("StyleDetectionUrl", StyleDetectionUrl)
- writer.WriteElementString("WLWRecentPostsMax", WLWRecentPostsMax.ToString)
- writer.WriteElementString("ModifyPageDetails", ModifyPageDetails.ToString)
- writer.WriteElementString("AutoGenerateMissingSummary", AutoGenerateMissingSummary.ToString)
- writer.WriteElementString("AutoGeneratedSummaryLength", AutoGeneratedSummaryLength.ToString)
- writer.WriteElementString("FacebookAppId", FacebookAppId)
- writer.WriteElementString("FacebookProfileIdProperty", FacebookProfileIdProperty.ToString)
-
- writer.WriteElementString("RssEmail", RssEmail)
- writer.WriteElementString("RssDefaultNrItems", RssDefaultNrItems.ToString)
- writer.WriteElementString("RssMaxNrItems", RssMaxNrItems.ToString)
- writer.WriteElementString("RssTtl", RssTtl.ToString)
- writer.WriteElementString("RssImageWidth", RssImageWidth.ToString)
- writer.WriteElementString("RssImageHeight", RssImageHeight.ToString)
- writer.WriteElementString("RssImageSizeAllowOverride", RssImageSizeAllowOverride.ToString)
- writer.WriteElementString("RssAllowContentInFeed", RssAllowContentInFeed.ToString)
- writer.WriteElementString("RssDefaultCopyright", RssDefaultCopyright)
- writer.WriteElementString("IncrementViewCount", IncrementViewCount.ToString)
- writer.WriteEndElement() ' settings
- End Sub
-
- Public Sub FromXml(xml As XmlNode)
- If xml Is Nothing Then Exit Sub
- xml.ReadValue("ModuleID", _importedModuleId)
- xml.ReadValue("AllowWLW", AllowWLW)
- xml.ReadValue("AllowMultipleCategories", AllowMultipleCategories)
- xml.ReadValue("VocabularyId", VocabularyId)
- xml.ReadValue("AllowAttachments", AllowAttachments)
- xml.ReadValue("SummaryModel", SummaryModel)
- xml.ReadValue("StyleDetectionUrl", StyleDetectionUrl)
- xml.ReadValue("WLWRecentPostsMax", WLWRecentPostsMax)
- xml.ReadValue("ModifyPageDetails", ModifyPageDetails)
- xml.ReadValue("AutoGenerateMissingSummary", AutoGenerateMissingSummary)
- xml.ReadValue("AutoGeneratedSummaryLength", AutoGeneratedSummaryLength)
- xml.ReadValue("FacebookAppId", FacebookAppId)
- xml.ReadValue("FacebookProfileIdProperty", FacebookProfileIdProperty)
-
- xml.ReadValue("RssEmail", RssEmail)
- xml.ReadValue("RssDefaultNrItems", RssDefaultNrItems)
- xml.ReadValue("RssMaxNrItems", RssMaxNrItems)
- xml.ReadValue("RssTtl", RssTtl)
- xml.ReadValue("RssImageWidth", RssImageWidth)
- xml.ReadValue("RssImageHeight", RssImageHeight)
- xml.ReadValue("RssImageSizeAllowOverride", RssImageSizeAllowOverride)
- xml.ReadValue("RssAllowContentInFeed", RssAllowContentInFeed)
- xml.ReadValue("RssDefaultCopyright", RssDefaultCopyright)
- xml.ReadValue("IncrementViewCount", IncrementViewCount)
- End Sub
-#End Region
-
- End Class
-End Namespace
diff --git a/Server/Blog/Components/Common/ModuleUrls.vb b/Server/Blog/Components/Common/ModuleUrls.vb
deleted file mode 100644
index 65a4aa86..00000000
--- a/Server/Blog/Components/Common/ModuleUrls.vb
+++ /dev/null
@@ -1,162 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-Imports DotNetNuke.Services.Tokens
-
-Namespace Common
- Public Class ModuleUrls
- Implements IPropertyAccess
-
-#Region " Properties "
- Public Property TabId As Integer = -1
- Public Property ParentTabId As Integer = -1
- Public Property BlogId As Integer = -1
- Public Property ContentItemId As Integer = -1
- Public Property TermId As Integer = -1
- Public Property AuthorId As Integer = -1
- Private Property Cache As New Dictionary(Of String, String)
-#End Region
-
-#Region " Constructors "
- Public Sub New(tabId As Integer, blogId As Integer, contentItemId As Integer, termId As Integer, authorId As Integer)
- Me.TabId = tabId
- Me.BlogId = blogId
- Me.ContentItemId = contentItemId
- Me.TermId = termId
- Me.AuthorId = authorId
- End Sub
-
- Public Sub New(tabId As Integer, parenttabId As Integer, blogId As Integer, contentItemId As Integer, termId As Integer, authorId As Integer)
- Me.TabId = tabId
- Me.ParentTabId = parenttabId
- Me.BlogId = blogId
- Me.ContentItemId = contentItemId
- Me.TermId = termId
- Me.AuthorId = authorId
- End Sub
-#End Region
-
-#Region " Public Methods "
- Public Function GetUrl(includeBlog As Boolean, includePost As Boolean, includeTerm As Boolean, includeAuthor As Boolean, includeEnding As Boolean) As String
- Dim urlType As String = ""
- If includeBlog Then urlType = "blog"
- If includePost Then urlType &= "post"
- If includeTerm Then urlType &= "term"
- If includeAuthor Then urlType &= "author"
- Dim cacheKey As String = String.Format("{0}:{1}", urlType, includeEnding.ToString.ToLower)
- If Cache.ContainsKey(cacheKey) Then Return Cache(cacheKey)
- BuildUrl(urlType)
- Return Cache(cacheKey)
- End Function
-#End Region
-
-#Region " Private Methods "
- Private Sub BuildUrl(urlType As String)
- Dim params As New List(Of String)
- Select Case urlType
- Case "blog"
- If BlogId > -1 Then params.Add("Blog=" & BlogId.ToString)
- Case "post"
- If ContentItemId > -1 Then params.Add("Post=" & ContentItemId.ToString)
- Case "term"
- If TermId > -1 Then params.Add("Term=" & TermId.ToString)
- Case "author"
- If AuthorId > -1 Then params.Add("Author=" & AuthorId.ToString)
- Case "blogpost"
- If BlogId > -1 Then params.Add("Blog=" & BlogId.ToString)
- If ContentItemId > -1 Then params.Add("Post=" & ContentItemId.ToString)
- Case "blogterm"
- If BlogId > -1 Then params.Add("Blog=" & BlogId.ToString)
- If TermId > -1 Then params.Add("Term=" & TermId.ToString)
- Case "blogauthor"
- If BlogId > -1 Then params.Add("Blog=" & BlogId.ToString)
- If AuthorId > -1 Then params.Add("Author=" & AuthorId.ToString)
- Case "postterm"
- If ContentItemId > -1 Then params.Add("Post=" & ContentItemId.ToString)
- If TermId > -1 Then params.Add("Term=" & TermId.ToString)
- Case "postauthor"
- If ContentItemId > -1 Then params.Add("Post=" & ContentItemId.ToString)
- If AuthorId > -1 Then params.Add("Author=" & AuthorId.ToString)
- Case "termauthor"
- If TermId > -1 Then params.Add("Term=" & TermId.ToString)
- If AuthorId > -1 Then params.Add("Author=" & AuthorId.ToString)
- Case "blogpostterm"
- If BlogId > -1 Then params.Add("Blog=" & BlogId.ToString)
- If ContentItemId > -1 Then params.Add("Post=" & ContentItemId.ToString)
- If TermId > -1 Then params.Add("Term=" & TermId.ToString)
- Case "blogpostauthor"
- If BlogId > -1 Then params.Add("Blog=" & BlogId.ToString)
- If ContentItemId > -1 Then params.Add("Post=" & ContentItemId.ToString)
- If AuthorId > -1 Then params.Add("Author=" & AuthorId.ToString)
- Case "blogtermauthor"
- If BlogId > -1 Then params.Add("Blog=" & BlogId.ToString)
- If TermId > -1 Then params.Add("Term=" & TermId.ToString)
- If AuthorId > -1 Then params.Add("Author=" & AuthorId.ToString)
- Case "posttermauthor"
- If ContentItemId > -1 Then params.Add("Post=" & ContentItemId.ToString)
- If TermId > -1 Then params.Add("Term=" & TermId.ToString)
- If AuthorId > -1 Then params.Add("Author=" & AuthorId.ToString)
- Case "blogposttermauthor", "all"
- If BlogId > -1 Then params.Add("Blog=" & BlogId.ToString)
- If ContentItemId > -1 Then params.Add("Post=" & ContentItemId.ToString)
- If TermId > -1 Then params.Add("Term=" & TermId.ToString)
- If AuthorId > -1 Then params.Add("Author=" & AuthorId.ToString)
- Case "parenturl"
- TabId = ParentTabId
- End Select
- Dim BaseUrl As String = DotNetNuke.Common.NavigateURL(TabId, "", params.ToArray)
- Dim BaseUrlPlusEnding As String
- If BaseUrl.Contains("?") Then
- BaseUrlPlusEnding = BaseUrl & "&"
- Else
- BaseUrlPlusEnding = BaseUrl & "?"
- End If
- Cache.Add(String.Format("{0}:false", urlType), BaseUrl)
- Cache.Add(String.Format("{0}:true", urlType), BaseUrlPlusEnding)
- End Sub
-#End Region
-
-#Region " IPropertyAccess Implementation "
- Public Function GetProperty(strPropertyName As String, strFormat As String, formatProvider As System.Globalization.CultureInfo, AccessingUser As DotNetNuke.Entities.Users.UserInfo, AccessLevel As DotNetNuke.Services.Tokens.Scope, ByRef PropertyNotFound As Boolean) As String Implements DotNetNuke.Services.Tokens.IPropertyAccess.GetProperty
- Dim OutputFormat As String = String.Empty
- Dim portalSettings As DotNetNuke.Entities.Portals.PortalSettings = DotNetNuke.Entities.Portals.PortalController.Instance.GetCurrentPortalSettings
- If strFormat = String.Empty Then
- OutputFormat = "D"
- Else
- OutputFormat = strFormat
- End If
- strFormat = strFormat.ToLower
- If strFormat <> "true" AndAlso strFormat <> "false" Then strFormat = "false"
- strPropertyName = strPropertyName.ToLower
- Dim cacheKey As String = String.Format("{0}:{1}", strPropertyName, strFormat)
- If Cache.ContainsKey(cacheKey) Then Return Cache(cacheKey)
- BuildUrl(strPropertyName)
- Return Cache(cacheKey)
- End Function
-
- Public ReadOnly Property Cacheability() As DotNetNuke.Services.Tokens.CacheLevel Implements DotNetNuke.Services.Tokens.IPropertyAccess.Cacheability
- Get
- Return CacheLevel.fullyCacheable
- End Get
- End Property
-#End Region
-
- End Class
-End Namespace
diff --git a/Server/Blog/Components/Common/PostBodyAndSummary.vb b/Server/Blog/Components/Common/PostBodyAndSummary.vb
index be3b70d4..7e59749e 100644
--- a/Server/Blog/Components/Common/PostBodyAndSummary.vb
+++ b/Server/Blog/Components/Common/PostBodyAndSummary.vb
@@ -18,135 +18,136 @@
' DEALINGS IN THE SOFTWARE.
'
-Imports DotNetNuke.Modules.Blog.Entities.Posts
-Imports DotNetNuke.Modules.Blog.Common.Globals
+Imports DotNetNuke.Modules.Blog.Core.Entities.Posts
+Imports DotNetNuke.Modules.Blog.Core.Common.Globals
+Imports DotNetNuke.Modules.Blog.Core.Common
Namespace Common
- Public Class PostBodyAndSummary
+ Public Class PostBodyAndSummary
- Public Property Body As String = ""
- Public Property BodyLocalizations As New LocalizedText
- Public Property Summary As String = ""
- Public Property SummaryLocalizations As New LocalizedText
+ Public Property Body As String = ""
+ Public Property BodyLocalizations As New LocalizedText
+ Public Property Summary As String = ""
+ Public Property SummaryLocalizations As New LocalizedText
#Region " Constructors "
- Public Sub New(contentEditor As Controls.LongTextEdit, summaryEditor As Controls.LongTextEdit, summaryModel As SummaryType, includeLocalizations As Boolean, autoGenerateSummaryIfEmpty As Boolean, autoGenerateLength As Integer)
- Body = contentEditor.DefaultText
- Summary = Trim(summaryEditor.DefaultText)
- If Summary = "<p> </p>" Then Summary = "" ' an empty editor in DNN returns this
- If includeLocalizations Then
- BodyLocalizations = contentEditor.LocalizedTexts
- SummaryLocalizations = summaryEditor.LocalizedTexts
- End If
- Select Case summaryModel
- Case SummaryType.HtmlIndependent
- Case SummaryType.HtmlPrecedesPost
- Body = Summary & Body
- For Each l As String In SummaryLocalizations.Locales
- BodyLocalizations(l) = SummaryLocalizations(l) & BodyLocalizations(l)
- Next
- Case SummaryType.PlainTextIndependent
- Summary = RemoveHtmlTags(Summary)
- For Each l As String In SummaryLocalizations.Locales
- SummaryLocalizations(l) = RemoveHtmlTags(SummaryLocalizations(l))
- Next
- End Select
- If autoGenerateSummaryIfEmpty And autoGenerateLength > 0 Then
- If Summary = "" Then Summary = GetSummary(Body, autoGenerateLength, summaryModel, True)
- For Each l As String In SummaryLocalizations.Locales
- If SummaryLocalizations(l) = "" Then SummaryLocalizations(l) = GetSummary(BodyLocalizations(l), autoGenerateLength, summaryModel, True)
- Next
- End If
- End Sub
+ Public Sub New(contentEditor As Controls.LongTextEdit, summaryEditor As Controls.LongTextEdit, summaryModel As SummaryType, includeLocalizations As Boolean, autoGenerateSummaryIfEmpty As Boolean, autoGenerateLength As Integer)
+ Body = contentEditor.DefaultText
+ Summary = Trim(summaryEditor.DefaultText)
+ If Summary = "<p> </p>" Then Summary = "" ' an empty editor in DNN returns this
+ If includeLocalizations Then
+ BodyLocalizations = contentEditor.LocalizedTexts
+ SummaryLocalizations = summaryEditor.LocalizedTexts
+ End If
+ Select Case summaryModel
+ Case SummaryType.HtmlIndependent
+ Case SummaryType.HtmlPrecedesPost
+ Body = Summary & Body
+ For Each l As String In SummaryLocalizations.Locales
+ BodyLocalizations(l) = SummaryLocalizations(l) & BodyLocalizations(l)
+ Next
+ Case SummaryType.PlainTextIndependent
+ Summary = RemoveHtmlTags(Summary)
+ For Each l As String In SummaryLocalizations.Locales
+ SummaryLocalizations(l) = RemoveHtmlTags(SummaryLocalizations(l))
+ Next
+ End Select
+ If autoGenerateSummaryIfEmpty And autoGenerateLength > 0 Then
+ If Summary = "" Then Summary = GetSummary(Body, autoGenerateLength, summaryModel, True)
+ For Each l As String In SummaryLocalizations.Locales
+ If SummaryLocalizations(l) = "" Then SummaryLocalizations(l) = GetSummary(BodyLocalizations(l), autoGenerateLength, summaryModel, True)
+ Next
+ End If
+ End Sub
- Public Sub New(Post As PostInfo, summaryModel As SummaryType, includeLocalizations As Boolean, autoGenerateSummaryIfEmpty As Boolean, autoGenerateLength As Integer)
- Body = HttpUtility.HtmlDecode(Post.Content)
- If Body Is Nothing Then Body = ""
- If summaryModel = SummaryType.PlainTextIndependent Then
- Summary = Post.Summary
- Else
- Summary = HttpUtility.HtmlDecode(Post.Summary)
- End If
- If summaryModel = SummaryType.HtmlPrecedesPost Then
- Body = Body.Substring(Summary.Length)
- End If
- If includeLocalizations Then
- For Each l As String In Post.TitleLocalizations.Locales
- Dim lBody As String = ""
- If Post.ContentLocalizations.ContainsKey(l) Then lBody = Post.ContentLocalizations(l)
- Dim lSummary As String = ""
- If Post.SummaryLocalizations.ContainsKey(l) Then lSummary = Post.SummaryLocalizations(l)
- BodyLocalizations.Add(l, lBody)
- If summaryModel = SummaryType.PlainTextIndependent Then
- SummaryLocalizations.Add(l, lSummary)
- Else
- SummaryLocalizations.Add(l, HttpUtility.HtmlDecode(lSummary))
- End If
- If summaryModel = SummaryType.HtmlPrecedesPost Then
- BodyLocalizations(l) = BodyLocalizations(l).Substring(SummaryLocalizations(l).Length)
- End If
- Next
- End If
- If autoGenerateSummaryIfEmpty And autoGenerateLength > 0 Then
- If Summary = "" Then Summary = GetSummary(Body, autoGenerateLength, summaryModel, False)
- For Each l As String In SummaryLocalizations.Locales
- If SummaryLocalizations(l) = "" Then SummaryLocalizations(l) = GetSummary(BodyLocalizations(l), autoGenerateLength, summaryModel, False)
- Next
- End If
- End Sub
+ Public Sub New(Post As PostInfo, summaryModel As SummaryType, includeLocalizations As Boolean, autoGenerateSummaryIfEmpty As Boolean, autoGenerateLength As Integer)
+ Body = HttpUtility.HtmlDecode(Post.Content)
+ If Body Is Nothing Then Body = ""
+ If summaryModel = SummaryType.PlainTextIndependent Then
+ Summary = Post.Summary
+ Else
+ Summary = HttpUtility.HtmlDecode(Post.Summary)
+ End If
+ If summaryModel = SummaryType.HtmlPrecedesPost Then
+ Body = Body.Substring(Summary.Length)
+ End If
+ If includeLocalizations Then
+ For Each l As String In Post.TitleLocalizations.Locales
+ Dim lBody As String = ""
+ If Post.ContentLocalizations.ContainsKey(l) Then lBody = Post.ContentLocalizations(l)
+ Dim lSummary As String = ""
+ If Post.SummaryLocalizations.ContainsKey(l) Then lSummary = Post.SummaryLocalizations(l)
+ BodyLocalizations.Add(l, lBody)
+ If summaryModel = SummaryType.PlainTextIndependent Then
+ SummaryLocalizations.Add(l, lSummary)
+ Else
+ SummaryLocalizations.Add(l, HttpUtility.HtmlDecode(lSummary))
+ End If
+ If summaryModel = SummaryType.HtmlPrecedesPost Then
+ BodyLocalizations(l) = BodyLocalizations(l).Substring(SummaryLocalizations(l).Length)
+ End If
+ Next
+ End If
+ If autoGenerateSummaryIfEmpty And autoGenerateLength > 0 Then
+ If Summary = "" Then Summary = GetSummary(Body, autoGenerateLength, summaryModel, False)
+ For Each l As String In SummaryLocalizations.Locales
+ If SummaryLocalizations(l) = "" Then SummaryLocalizations(l) = GetSummary(BodyLocalizations(l), autoGenerateLength, summaryModel, False)
+ Next
+ End If
+ End Sub
- Public Sub New(post As Services.WLW.MetaWeblog.Post, summaryModel As SummaryType, autoGenerateSummaryIfEmpty As Boolean, autoGenerateLength As Integer)
- Select Case summaryModel
- Case SummaryType.HtmlIndependent
- Body = post.description
- Case SummaryType.HtmlPrecedesPost
- Body = post.mt_text_more
- Summary = post.description
- Case Else ' plain text
- Body = post.description
- Summary = post.mt_excerpt
- End Select
- If autoGenerateSummaryIfEmpty And autoGenerateLength > 0 Then
- If Summary = "" Then Summary = GetSummary(Body, autoGenerateLength, summaryModel, False)
- End If
- End Sub
+ Public Sub New(post As Core.Services.WLW.MetaWeblog.Post, summaryModel As SummaryType, autoGenerateSummaryIfEmpty As Boolean, autoGenerateLength As Integer)
+ Select Case summaryModel
+ Case SummaryType.HtmlIndependent
+ Body = post.description
+ Case SummaryType.HtmlPrecedesPost
+ Body = post.mt_text_more
+ Summary = post.description
+ Case Else ' plain text
+ Body = post.description
+ Summary = post.mt_excerpt
+ End Select
+ If autoGenerateSummaryIfEmpty And autoGenerateLength > 0 Then
+ If Summary = "" Then Summary = GetSummary(Body, autoGenerateLength, summaryModel, False)
+ End If
+ End Sub
#End Region
#Region " Writing "
- Public Sub WriteToPost(ByRef Post As PostInfo, summaryModel As SummaryType, htmlEncode As Boolean, includeLocalizations As Boolean)
- If htmlEncode Then
- Body = HttpUtility.HtmlEncode(Body)
- If Not summaryModel = SummaryType.PlainTextIndependent Then
- Summary = HttpUtility.HtmlEncode(Summary)
- End If
- If includeLocalizations Then
- For Each l As String In SummaryLocalizations.Locales
- BodyLocalizations(l) = HttpUtility.HtmlEncode(BodyLocalizations(l))
- SummaryLocalizations(l) = HttpUtility.HtmlEncode(SummaryLocalizations(l))
- Next
- End If
- End If
- Post.Content = Body
- Post.Summary = Summary
- If includeLocalizations Then
- Post.ContentLocalizations = BodyLocalizations
- Post.SummaryLocalizations = SummaryLocalizations
- End If
- End Sub
+ Public Sub WriteToPost(ByRef Post As PostInfo, summaryModel As SummaryType, htmlEncode As Boolean, includeLocalizations As Boolean)
+ If htmlEncode Then
+ Body = HttpUtility.HtmlEncode(Body)
+ If Not summaryModel = SummaryType.PlainTextIndependent Then
+ Summary = HttpUtility.HtmlEncode(Summary)
+ End If
+ If includeLocalizations Then
+ For Each l As String In SummaryLocalizations.Locales
+ BodyLocalizations(l) = HttpUtility.HtmlEncode(BodyLocalizations(l))
+ SummaryLocalizations(l) = HttpUtility.HtmlEncode(SummaryLocalizations(l))
+ Next
+ End If
+ End If
+ Post.Content = Body
+ Post.Summary = Summary
+ If includeLocalizations Then
+ Post.ContentLocalizations = BodyLocalizations
+ Post.SummaryLocalizations = SummaryLocalizations
+ End If
+ End Sub
- Public Sub WriteToPost(ByRef post As Services.WLW.MetaWeblog.Post, summaryModel As SummaryType)
- Select Case summaryModel
- Case SummaryType.HtmlIndependent
- post.description = Body
- Case SummaryType.HtmlPrecedesPost
- post.mt_text_more = Body
- post.description = Summary
- Case Else ' plain text
- post.description = Body
- post.mt_excerpt = Summary
- End Select
- End Sub
+ Public Sub WriteToPost(ByRef post As Core.Services.WLW.MetaWeblog.Post, summaryModel As SummaryType)
+ Select Case summaryModel
+ Case SummaryType.HtmlIndependent
+ post.description = Body
+ Case SummaryType.HtmlPrecedesPost
+ post.mt_text_more = Body
+ post.description = Summary
+ Case Else ' plain text
+ post.description = Body
+ post.mt_excerpt = Summary
+ End Select
+ End Sub
#End Region
- End Class
+ End Class
End Namespace
diff --git a/Server/Blog/Components/Common/ViewSettings.vb b/Server/Blog/Components/Common/ViewSettings.vb
deleted file mode 100644
index b131e91e..00000000
--- a/Server/Blog/Components/Common/ViewSettings.vb
+++ /dev/null
@@ -1,261 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-Imports System.Xml
-Imports DotNetNuke.Services.Tokens
-
-Namespace Common
-
- Public Class ViewSettings
- Implements IPropertyAccess
-
-#Region " Private Members "
- Private _allSettings As Hashtable = Nothing
- Private _tabModuleId As Integer = -1
-#End Region
-
-#Region " Properties "
- Public Property Template As String = "[G]_default"
- Public Property BlogModuleId As Integer = -1
- Public Property ShowAllLocales As Boolean = True
- Public Property ModifyPageDetails As Boolean = False
- Public Property AddCanonicalTag As Boolean = False
- Public Property ShowManagementPanel As Boolean = False
- Public Property ShowManagementPanelViewMode As Boolean = True
- Public Property HideUnpublishedBlogsViewMode As Boolean = False
- Public Property HideUnpublishedBlogsEditMode As Boolean = False
- Public Property AllowComments As Boolean = True
- Public Property BlogId As Integer = -1
- Public Property Categories As String = ""
- Public Property AuthorId As Integer = -1
- Public Property TemplateSettings As New Dictionary(Of String, String)
- Private Property TemplateManager As Templating.TemplateManager
- Friend Property CanCache As Boolean = True
-#End Region
-
-#Region " ReadOnly Properties "
- Private _categoryList As List(Of Integer)
- Public ReadOnly Property CategoryList As List(Of Integer)
- Get
- If _categoryList Is Nothing Then
- _categoryList = New List(Of Integer)
- For Each c As String In Categories.Split(","c)
- If IsNumeric(c) Then
- _categoryList.Add(Integer.Parse(c))
- End If
- Next
- End If
- Return _categoryList
- End Get
- End Property
-#End Region
-
-#Region " Constructors "
- Public Sub New(tabModuleId As Integer)
- Me.New(tabModuleId, False)
- End Sub
-
- Public Sub New(tabModuleId As Integer, justLoadSettings As Boolean)
-
- _tabModuleId = tabModuleId
- _allSettings = (New DotNetNuke.Entities.Modules.ModuleController).GetTabModule(tabModuleId).TabModuleSettings
- _allSettings.ReadValue("Template", Template)
- _allSettings.ReadValue("BlogModuleId", BlogModuleId)
- _allSettings.ReadValue("ShowAllLocales", ShowAllLocales)
- _allSettings.ReadValue("ModifyPageDetails", ModifyPageDetails)
- _allSettings.ReadValue("AddCanonicalTag", AddCanonicalTag)
- _allSettings.ReadValue("ShowManagementPanel", ShowManagementPanel)
- _allSettings.ReadValue("ShowManagementPanelViewMode", ShowManagementPanelViewMode)
- _allSettings.ReadValue("HideUnpublishedBlogsViewMode", HideUnpublishedBlogsViewMode)
- _allSettings.ReadValue("HideUnpublishedBlogsEditMode", HideUnpublishedBlogsEditMode)
- _allSettings.ReadValue("AllowComments", AllowComments)
- _allSettings.ReadValue("BlogId", BlogId)
- _allSettings.ReadValue("Categories", Categories)
- _allSettings.ReadValue("AuthorId", AuthorId)
- If BlogModuleId > -1 And tabModuleId > -1 Then ' security check
- Dim parentModule As DotNetNuke.Entities.Modules.ModuleInfo = (New DotNetNuke.Entities.Modules.ModuleController).GetModule(BlogModuleId)
- Dim thisTabModule As DotNetNuke.Entities.Modules.ModuleInfo = (New DotNetNuke.Entities.Modules.ModuleController).GetTabModule(tabModuleId)
- If parentModule Is Nothing OrElse parentModule.PortalID <> thisTabModule.PortalID Then
- BlogModuleId = -1
- CanCache = False
- End If
- End If
- If justLoadSettings Then Exit Sub
-
- ' Template Settings - first load defaults
- SetTemplate(Template)
-
- End Sub
-
- Public Shared Function GetViewSettings(tabModuleId As Integer) As ViewSettings
- Dim CacheKey As String = "Blog_TabModuleSettings" & tabModuleId.ToString
- Dim settings As ViewSettings = CType(DotNetNuke.Common.Utilities.DataCache.GetCache(CacheKey), ViewSettings)
- If settings Is Nothing Then
- settings = New ViewSettings(tabModuleId)
- If settings.CanCache Then DotNetNuke.Common.Utilities.DataCache.SetCache(CacheKey, settings)
- End If
- Return settings
- End Function
-#End Region
-
-#Region " Public Members "
- Public Overridable Sub UpdateSettings()
- UpdateSettings(_tabModuleId)
- End Sub
-
- Public Overridable Sub UpdateSettings(tabModuleId As Integer)
-
- Dim objModules As New DotNetNuke.Entities.Modules.ModuleController
- objModules.UpdateTabModuleSetting(tabModuleId, "Template", Template)
- objModules.UpdateTabModuleSetting(tabModuleId, "BlogModuleId", BlogModuleId.ToString)
- objModules.UpdateTabModuleSetting(tabModuleId, "ShowAllLocales", ShowAllLocales.ToString)
- objModules.UpdateTabModuleSetting(tabModuleId, "ModifyPageDetails", ModifyPageDetails.ToString)
- objModules.UpdateTabModuleSetting(tabModuleId, "AddCanonicalTag", AddCanonicalTag.ToString)
- objModules.UpdateTabModuleSetting(tabModuleId, "ShowManagementPanel", ShowManagementPanel.ToString)
- objModules.UpdateTabModuleSetting(tabModuleId, "ShowManagementPanelViewMode", ShowManagementPanelViewMode.ToString)
- objModules.UpdateTabModuleSetting(tabModuleId, "HideUnpublishedBlogsViewMode", HideUnpublishedBlogsViewMode.ToString)
- objModules.UpdateTabModuleSetting(tabModuleId, "HideUnpublishedBlogsEditMode", HideUnpublishedBlogsEditMode.ToString)
- objModules.UpdateTabModuleSetting(tabModuleId, "AllowComments", AllowComments.ToString)
- objModules.UpdateTabModuleSetting(tabModuleId, "BlogId", BlogId.ToString)
- objModules.UpdateTabModuleSetting(tabModuleId, "Categories", Categories.ToString)
- objModules.UpdateTabModuleSetting(tabModuleId, "AuthorId", AuthorId.ToString)
- _categoryList = Nothing
-
- Dim CacheKey As String = "Blog_TabModuleSettings" & tabModuleId.ToString
- DotNetNuke.Common.Utilities.DataCache.SetCache(CacheKey, Me)
-
- End Sub
-
- Public Sub SaveTemplateSettings()
- Dim objModules As New DotNetNuke.Entities.Modules.ModuleController
- For Each key As String In TemplateSettings.Keys
- objModules.UpdateTabModuleSetting(_tabModuleId, "t_" & key, TemplateSettings(key))
- Next
- Dim CacheKey As String = "Blog_TabModuleSettings" & _tabModuleId.ToString
- DotNetNuke.Common.Utilities.DataCache.SetCache(CacheKey, Me)
- End Sub
-
- Public Sub SetTemplateSetting(key As String, value As String)
- If Not TemplateSettings.ContainsKey(key) Then
- TemplateSettings.Add(key, value)
- Else
- TemplateSettings(key) = value
- End If
- End Sub
-#End Region
-
-#Region " Private Methods "
- Private Sub SetTemplate(template As String)
- TemplateManager = New Templating.TemplateManager(DotNetNuke.Entities.Portals.PortalSettings.Current, template)
- TemplateSettings.Clear()
- For Each st As Templating.TemplateSetting In _TemplateManager.TemplateSettings.Settings
- TemplateSettings.Add(st.Key, st.DefaultValue)
- Next
- For Each key As String In _allSettings.Keys
- If key.StartsWith("t_") Then
- SetTemplateSetting(Mid(key, 3), CStr(_allSettings(key)))
- End If
- Next
- End Sub
-#End Region
-
-#Region " IPropertyAccess "
- Public ReadOnly Property Cacheability As DotNetNuke.Services.Tokens.CacheLevel Implements DotNetNuke.Services.Tokens.IPropertyAccess.Cacheability
- Get
- Return CacheLevel.fullyCacheable
- End Get
- End Property
-
- Public Function GetProperty(strPropertyName As String, strFormat As String, formatProvider As System.Globalization.CultureInfo, AccessingUser As DotNetNuke.Entities.Users.UserInfo, AccessLevel As DotNetNuke.Services.Tokens.Scope, ByRef PropertyNotFound As Boolean) As String Implements DotNetNuke.Services.Tokens.IPropertyAccess.GetProperty
- Dim OutputFormat As String = String.Empty
- If strFormat = String.Empty Then
- OutputFormat = "D"
- Else
- OutputFormat = strFormat
- End If
- Select Case strPropertyName.ToLower
- Case "tabmoduleid"
- Return (_tabModuleId.ToString(OutputFormat, formatProvider))
- Case "templatepath"
- Return PropertyAccess.FormatString(_TemplateManager.TemplatePath, strFormat)
- Case "templatemappath"
- Return PropertyAccess.FormatString(_TemplateManager.TemplateMapPath, strFormat)
- Case Else
- If TemplateSettings.ContainsKey(strPropertyName) Then
- Return PropertyAccess.FormatString(CStr(TemplateSettings(strPropertyName)), strFormat)
- End If
- If strPropertyName.StartsWith("t_") Then strPropertyName = Mid(strPropertyName, 3)
- If TemplateSettings.ContainsKey(strPropertyName) Then
- Return PropertyAccess.FormatString(CStr(TemplateSettings(strPropertyName)), strFormat)
- End If
- Select Case strPropertyName.ToLower
- Case "termid", "categories" ' termid is for legacy purposes
- Return Categories
- Case "authorid"
- Return (AuthorId.ToString(OutputFormat, formatProvider))
- Case "blogid"
- Return (BlogId.ToString(OutputFormat, formatProvider))
- Case "blogmoduleid"
- Return (BlogModuleId.ToString(OutputFormat, formatProvider))
- Case Else
- Return ""
- End Select
- End Select
- End Function
-#End Region
-
-#Region " Serialization "
- Public Sub Serialize(writer As XmlWriter)
- writer.WriteStartElement("ViewSettings")
- writer.WriteElementString("Template", Template)
- writer.WriteElementString("BlogModuleId", BlogModuleId.ToString)
- writer.WriteElementString("ShowAllLocales", ShowAllLocales.ToString)
- writer.WriteElementString("ModifyPageDetails", ModifyPageDetails.ToString)
- writer.WriteElementString("AddCanonicalTag", AddCanonicalTag.ToString)
- writer.WriteElementString("ShowManagementPanel", ShowManagementPanel.ToString)
- writer.WriteElementString("ShowManagementPanelViewMode", ShowManagementPanelViewMode.ToString)
- writer.WriteElementString("HideUnpublishedBlogsViewMode", HideUnpublishedBlogsViewMode.ToString)
- writer.WriteElementString("HideUnpublishedBlogsEditMode", HideUnpublishedBlogsEditMode.ToString)
- writer.WriteElementString("AllowComments", AllowComments.ToString)
- writer.WriteElementString("BlogId", BlogId.ToString)
- writer.WriteElementString("AuthorId", AuthorId.ToString)
- writer.WriteEndElement() ' viewsettings
- End Sub
-
- Public Sub FromXml(xml As XmlNode)
- If xml Is Nothing Then Exit Sub
- xml.ReadValue("Template", Template)
- xml.ReadValue("BlogModuleId", BlogModuleId)
- xml.ReadValue("ShowAllLocales", ShowAllLocales)
- xml.ReadValue("ModifyPageDetails", ModifyPageDetails)
- xml.ReadValue("AddCanonicalTag", AddCanonicalTag)
- xml.ReadValue("ShowManagementPanel", ShowManagementPanel)
- xml.ReadValue("ShowManagementPanelViewMode", ShowManagementPanelViewMode)
- xml.ReadValue("HideUnpublishedBlogsViewMode", HideUnpublishedBlogsViewMode)
- xml.ReadValue("HideUnpublishedBlogsEditMode", HideUnpublishedBlogsEditMode)
- xml.ReadValue("AllowComments", AllowComments)
- xml.ReadValue("BlogId", BlogId)
- xml.ReadValue("AuthorId", AuthorId)
- _categoryList = Nothing
- End Sub
-#End Region
-
- End Class
-End Namespace
diff --git a/Server/Blog/Components/Common/WebPage.vb b/Server/Blog/Components/Common/WebPage.vb
deleted file mode 100644
index 32cac0b9..00000000
--- a/Server/Blog/Components/Common/WebPage.vb
+++ /dev/null
@@ -1,99 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-Imports System.Net
-Imports System.IO
-
-Namespace Common
- Public Class WebPage
-
-#Region " Properties "
- Private ReadOnly url As Uri
- Public ReadOnly Property Uri() As Uri
- Get
- Return url
- End Get
- End Property
-#End Region
-
-#Region " Constructors "
- Friend Sub New(filePath As Uri)
- If filePath Is Nothing Then
- Throw New ArgumentNullException("filePath")
- End If
- url = filePath
- End Sub
-#End Region
-
-#Region " Public Methods "
- Public Function GetWebResponse() As WebResponse
- Dim response As WebResponse = GetWebRequest().GetResponse()
- Dim contentLength As Long = response.ContentLength
- If contentLength = -1 Then
- Dim headerContentLength As String = response.Headers("Content-Length")
- If Not [String].IsNullOrEmpty(headerContentLength) Then
- contentLength = Long.Parse(headerContentLength)
- End If
- End If
- If contentLength <= -1 Then
- response.Close()
- Return Nothing
- End If
- Return response
- End Function
-
- Private _webRequest As WebRequest
-
- Public Function GetFileAsString() As String
- Try
- Using response As WebResponse = GetWebResponse()
- If response Is Nothing Then
- Return String.Empty
- End If
- Using reader As New StreamReader(response.GetResponseStream())
- Return reader.ReadToEnd()
- End Using
- End Using
- Catch ex As Exception
- DotNetNuke.Services.Exceptions.LogException(New Exception(String.Format("Track/Pingback Verification Request To '{0}' Failed", Uri.PathAndQuery), ex))
- Return ""
- End Try
- End Function
-#End Region
-
-#Region " Private Methods "
- Private Function GetWebRequest() As WebRequest
-
- If _webRequest Is Nothing Then
- Dim request As HttpWebRequest = DirectCast(WebRequest.Create(Uri), HttpWebRequest)
- request.Headers("Accept-Encoding") = "gzip"
- request.Headers("Accept-Language") = "en-us"
- request.Credentials = CredentialCache.DefaultNetworkCredentials
- request.AutomaticDecompression = DecompressionMethods.GZip
- request.Timeout = 1000 * 30 ' 30 secs timeout
- _webRequest = request
- End If
- Return _webRequest
-
- End Function
-#End Region
-
- End Class
-End Namespace
diff --git a/Server/Blog/Components/Data/DataProvider.vb b/Server/Blog/Components/Data/DataProvider.vb
deleted file mode 100644
index beef26f9..00000000
--- a/Server/Blog/Components/Data/DataProvider.vb
+++ /dev/null
@@ -1,27 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-
-Namespace Data
-
- Partial Public MustInherit Class DataProvider
-
- End Class
-End Namespace
\ No newline at end of file
diff --git a/Server/Blog/Components/Data/DataProvider_CMD.vb b/Server/Blog/Components/Data/DataProvider_CMD.vb
deleted file mode 100644
index 0dac0da9..00000000
--- a/Server/Blog/Components/Data/DataProvider_CMD.vb
+++ /dev/null
@@ -1,64 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-
-Namespace Data
-
- Partial Public MustInherit Class DataProvider
-
- Public MustOverride Sub AddPostView(contentItemId As Int32)
- Public MustOverride Sub ApproveComment(commentId As Int32)
- Public MustOverride Function AddCommentKarma(commentId As Int32, userId As Int32, karma As Int32) As Integer
- Public MustOverride Sub DeleteBlogPermissions(blogId As Int32)
- Public MustOverride Function GetAuthors(moduleId As Int32, blogID As Int32) As IDataReader
- Public MustOverride Function GetBlog(blogId As Int32, userId As Int32, locale As String) As IDataReader
- Public MustOverride Function GetBlogCalendar(moduleId As Int32, blogId As Int32, locale As String) As IDataReader
- Public MustOverride Function GetBlogLocalizations(blogId As Int32) As IDataReader
- Public MustOverride Function GetBlogPermissionsByBlog(blogId As Int32) As IDataReader
- Public MustOverride Function GetBlogsByModule(moduleId As Int32, userId As Int32, locale As String) As IDataReader
- Public MustOverride Function GetBlogsByPortal(portalId As Int32, userId As Int32, locale As String) As IDataReader
- Public MustOverride Function GetComment(commentID As Int32, userID As Int32) As IDataReader
- Public MustOverride Function GetCommentsByContentItem(contentItemId As Int32, includeNonApproved As Boolean, userID As Int32) As IDataReader
- Public MustOverride Function GetCommentsByModuleId(moduleId As Int32, userID As Int32, pageIndex As Int32, pageSize As Int32, orderBy As String) As IDataReader
- Public MustOverride Function GetPostByLegacyEntryId(entryId As Int32, portalId As Int32, locale As String) As IDataReader
- Public MustOverride Function GetPostByLegacyUrl(url As String, portalId As Int32, locale As String) As IDataReader
- Public MustOverride Function GetPostLocalizations(contentItemId As Int32) As IDataReader
- Public MustOverride Function GetPosts(moduleId As Int32, blogID As Int32, displayLocale As String, userId As Int32, userIsAdmin As Boolean, published As Int32, limitToLocale As String, endDate As Date, authorUserId As Int32, onlyActionable As Boolean, pageIndex As Int32, pageSize As Int32, orderBy As String) As IDataReader
- Public MustOverride Function GetPostsByTerm(moduleId As Int32, blogID As Int32, displayLocale As String, userId As Int32, userIsAdmin As Boolean, termID As Int32, published As Int32, limitToLocale As String, endDate As Date, authorUserId As Int32, pageIndex As Int32, pageSize As Int32, orderBy As String) As IDataReader
- Public MustOverride Function GetPostsByCategory(moduleId As Int32, blogID As Int32, displayLocale As String, userId As Int32, userIsAdmin As Boolean, categories As String, published As Int32, limitToLocale As String, endDate As Date, authorUserId As Int32, pageIndex As Int32, pageSize As Int32, orderBy As String) As IDataReader
- Public MustOverride Function GetTerm(termId As Int32, moduleId As Int32, locale As String) As IDataReader
- Public MustOverride Function GetTermLocalizations(termId As Int32) As IDataReader
- Public MustOverride Function GetTermsByModule(moduleId As Int32, locale As String) As IDataReader
- Public MustOverride Function GetTermsByPost(contentItemId As Int32, moduleId As Int32, locale As String) As IDataReader
- Public MustOverride Function GetTermsByVocabulary(moduleId As Int32, vocabularyId As Int32, locale As String) As IDataReader
- Public MustOverride Function GetUserPermissionsByModule(moduleID As Int32, userId As Int32) As IDataReader
- Public MustOverride Function GetUsersByBlogPermission(portalId As Int32, blogId As Int32, permissionId As Int32) As IDataReader
- Public MustOverride Function SearchPosts(moduleId As Int32, blogID As Int32, displayLocale As String, userId As Int32, userIsAdmin As Boolean, searchText As String, searchTitle As Boolean, searchContents As Boolean, published As Int32, limitToLocale As String, endDate As Date, authorUserId As Int32, pageIndex As Int32, pageSize As Int32, orderBy As String) As IDataReader
- Public MustOverride Function SearchPostsByTerm(moduleId As Int32, blogID As Int32, displayLocale As String, userId As Int32, userIsAdmin As Boolean, termID As Int32, searchText As String, searchTitle As Boolean, searchContents As Boolean, published As Int32, limitToLocale As String, endDate As Date, authorUserId As Int32, pageIndex As Int32, pageSize As Int32, orderBy As String) As IDataReader
- Public MustOverride Function SearchPostsByCategory(moduleId As Int32, blogID As Int32, displayLocale As String, userId As Int32, userIsAdmin As Boolean, categories As String, searchText As String, searchTitle As Boolean, searchContents As Boolean, published As Int32, limitToLocale As String, endDate As Date, authorUserId As Int32, pageIndex As Int32, pageSize As Int32, orderBy As String) As IDataReader
- Public MustOverride Sub SetBlogLocalization(blogID As Int32, locale As String, title As String, description As String)
- Public MustOverride Sub SetPostLocalization(postID As Int32, locale As String, title As String, summary As String, content As String, updatedByUser As Int32)
- Public MustOverride Function SetTerm(termID As Int32, vocabularyID As Int32, parentTermID As Int32, viewOrder As Int32, name As String, description As String, createdByUserID As Int32) As Integer
- Public MustOverride Sub SetTermLocalization(termID As Int32, locale As String, name As String, description As String)
- Public MustOverride Sub UpdateModuleWiring(portalId As Int32, oldModuleId As Int32, newModuleId As Int32)
-
- End Class
-
-End Namespace
\ No newline at end of file
diff --git a/Server/Blog/Components/Data/DataProvider_CRUD.vb b/Server/Blog/Components/Data/DataProvider_CRUD.vb
deleted file mode 100644
index d16bda55..00000000
--- a/Server/Blog/Components/Data/DataProvider_CRUD.vb
+++ /dev/null
@@ -1,84 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-
-Namespace Data
-
- Partial Public MustInherit Class DataProvider
-
-#Region " Shared/Static Methods "
-
- ' singleton reference to the instantiated object
- Private Shared objProvider As DataProvider = Nothing
-
- ' constructor
- Shared Sub New()
- CreateProvider()
- End Sub
-
- ' dynamically create provider
- Private Shared Sub CreateProvider()
- objProvider = CType(DotNetNuke.Framework.Reflection.CreateObject("data", "DotNetNuke.Modules.Blog.Data", ""), DataProvider)
- End Sub
-
- ' return the provider
- Public Shared Shadows Function Instance() As DataProvider
- Return objProvider
- End Function
-
-#End Region
-
-#Region " General Methods "
- Public MustOverride Function GetNull(Field As Object) As Object
-#End Region
-
-#Region " BlogPermission Methods "
- Public MustOverride Function GetBlogPermission(blogId As Int32, permissionId As Int32, roleId As Int32, userId As Int32) As IDataReader
- Public MustOverride Sub AddBlogPermission(allowAccess As Boolean, blogId As Int32, expires As Date, permissionId As Int32, roleId As Int32, userId As Int32)
- Public MustOverride Sub UpdateBlogPermission(allowAccess As Boolean, blogId As Int32, expires As Date, permissionId As Int32, roleId As Int32, userId As Int32)
- Public MustOverride Sub DeleteBlogPermission(blogId As Int32, permissionId As Int32, roleId As Int32, userId As Int32)
-#End Region
-
-#Region " Blog Methods "
- Public MustOverride Function AddBlog(autoApprovePingBack As Boolean, moduleID As Int32, autoApproveTrackBack As Boolean, copyright As String, description As String, enablePingBackReceive As Boolean, enablePingBackSend As Boolean, enableTrackBackReceive As Boolean, enableTrackBackSend As Boolean, fullLocalization As Boolean, image As String, includeAuthorInFeed As Boolean, includeImagesInFeed As Boolean, locale As String, mustApproveGhostPosts As Boolean, ownerUserId As Int32, publishAsOwner As Boolean, published As Boolean, syndicated As Boolean, syndicationEmail As String, title As String, createdByUser As Int32) As Integer
- Public MustOverride Sub UpdateBlog(autoApprovePingBack As Boolean, moduleID As Int32, autoApproveTrackBack As Boolean, blogID As Int32, copyright As String, description As String, enablePingBackReceive As Boolean, enablePingBackSend As Boolean, enableTrackBackReceive As Boolean, enableTrackBackSend As Boolean, fullLocalization As Boolean, image As String, includeAuthorInFeed As Boolean, includeImagesInFeed As Boolean, locale As String, mustApproveGhostPosts As Boolean, ownerUserId As Int32, publishAsOwner As Boolean, published As Boolean, syndicated As Boolean, syndicationEmail As String, title As String, updatedByUser As Int32)
- Public MustOverride Sub DeleteBlog(blogID As Int32)
-#End Region
-
-#Region " Comment Methods "
- Public MustOverride Function AddComment(approved As Boolean, author As String, comment As String, contentItemId As Int32, email As String, parentId As Int32, website As String, createdByUser As Int32) As Integer
- Public MustOverride Sub UpdateComment(approved As Boolean, author As String, comment As String, commentID As Int32, contentItemId As Int32, email As String, parentId As Int32, website As String, updatedByUser As Int32)
- Public MustOverride Sub DeleteComment(commentID As Int32)
-#End Region
-
-#Region " LegacyUrl Methods "
- Public MustOverride Sub AddLegacyUrl(contentItemId As Int32, entryId As Int32, url As String)
-#End Region
-
-#Region " Post Methods "
- Public MustOverride Function GetPost(contentItemId As Int32, moduleId As Int32, locale As String) As IDataReader
- Public MustOverride Function AddPost(allowComments As Boolean, blogID As Int32, content As String, copyright As String, displayCopyright As Boolean, image As String, locale As String, published As Boolean, publishedOnDate As Date, summary As String, termIds As String, title As String, viewCount As Int32, createdByUser As Int32) As Integer
- Public MustOverride Sub UpdatePost(allowComments As Boolean, blogID As Int32, content As String, contentItemId As Int32, copyright As String, displayCopyright As Boolean, image As String, locale As String, published As Boolean, publishedOnDate As Date, summary As String, termIds As String, title As String, viewCount As Int32, updatedByUser As Int32)
- Public MustOverride Sub DeletePost(contentItemId As Int32)
-#End Region
-
- End Class
-
-End Namespace
\ No newline at end of file
diff --git a/Server/Blog/Components/Data/DataProvider_FK.vb b/Server/Blog/Components/Data/DataProvider_FK.vb
deleted file mode 100644
index b0bc745c..00000000
--- a/Server/Blog/Components/Data/DataProvider_FK.vb
+++ /dev/null
@@ -1,44 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-
-Namespace Data
-
- Partial Public MustInherit Class DataProvider
-
-#Region " BlogPermission Methods "
- Public MustOverride Function GetBlogPermissionsByBlog(blogID As Int32, StartRowIndex As Integer, MaximumRows As Integer, OrderBy As String) As IDataReader
-#End Region
-
-#Region " Blog Methods "
- Public MustOverride Function GetBlogsByCreatedByUser(userID As Int32, StartRowIndex As Integer, MaximumRows As Integer, OrderBy As String) As IDataReader
-#End Region
-
-#Region " Comment Methods "
-#End Region
-
-#Region " Post Methods "
- Public MustOverride Function GetPostsByBlog(blogID As Int32, displayLocale As String, pageIndex As Int32, pageSize As Int32, orderBy As String) As IDataReader
-#End Region
-
- End Class
-
-End Namespace
-
diff --git a/Server/Blog/Components/Data/SqlDataProvider.vb b/Server/Blog/Components/Data/SqlDataProvider.vb
deleted file mode 100644
index 5e18beca..00000000
--- a/Server/Blog/Components/Data/SqlDataProvider.vb
+++ /dev/null
@@ -1,28 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-
-Namespace Data
-
- Partial Public Class SqlDataProvider
-
- End Class
-
-End Namespace
\ No newline at end of file
diff --git a/Server/Blog/Components/Data/SqlDataProvider_CMD.vb b/Server/Blog/Components/Data/SqlDataProvider_CMD.vb
deleted file mode 100644
index d876a177..00000000
--- a/Server/Blog/Components/Data/SqlDataProvider_CMD.vb
+++ /dev/null
@@ -1,171 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-Imports Microsoft.ApplicationBlocks.Data
-
-Namespace Data
-
- Partial Public Class SqlDataProvider
-
- Public Overrides Function AddCommentKarma(commentId As Int32, userId As Int32, karma As Int32) As Integer
- Return CType(SqlHelper.ExecuteScalar(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "AddCommentKarma", commentId, userId, karma), Integer)
- End Function
-
- Public Overrides Sub AddPostView(contentItemId As Int32)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "AddPostView", contentItemId)
- End Sub
-
- Public Overrides Sub ApproveComment(commentId As Int32)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "ApproveComment", commentId)
- End Sub
-
- Public Overrides Sub DeleteBlogPermissions(blogId As Int32)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "DeleteBlogPermissions", blogId)
- End Sub
-
- Public Overrides Function GetAuthors(moduleId As Int32, blogID As Int32) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetAuthors", moduleId, blogID), IDataReader)
- End Function
-
- Public Overrides Function GetBlog(blogId As Int32, userId As Int32, locale As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetBlog", blogId, userId, locale), IDataReader)
- End Function
-
- Public Overrides Function GetBlogCalendar(moduleId As Int32, blogId As Int32, locale As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetBlogCalendar", moduleId, blogId, GetNull(locale)), IDataReader)
- End Function
-
- Public Overrides Function GetBlogLocalizations(blogId As Int32) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetBlogLocalizations", blogId), IDataReader)
- End Function
-
- Public Overrides Function GetBlogPermissionsByBlog(blogId As Int32) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetBlogPermissionsByBlog", blogId), IDataReader)
- End Function
-
- Public Overrides Function GetBlogsByModule(moduleId As Int32, userId As Int32, locale As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetBlogsByModule", moduleId, userId, locale), IDataReader)
- End Function
-
- Public Overrides Function GetBlogsByPortal(portalId As Int32, userId As Int32, locale As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetBlogsByPortal", portalId, userId, locale), IDataReader)
- End Function
-
- Public Overrides Function GetComment(commentID As Int32, userID As Int32) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetComment", commentID, userID), IDataReader)
- End Function
-
- Public Overrides Function GetCommentsByContentItem(contentItemId As Int32, includeNonApproved As Boolean, userID As Int32) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetCommentsByContentItem", contentItemId, includeNonApproved, userID), IDataReader)
- End Function
-
- Public Overrides Function GetCommentsByModuleId(moduleId As Int32, userID As Int32, pageIndex As Int32, pageSize As Int32, orderBy As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetCommentsByModuleId", moduleId, userID, pageIndex, pageSize, orderBy), IDataReader)
- End Function
-
- Public Overrides Function GetPostByLegacyEntryId(entryId As Int32, portalId As Int32, locale As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetPostByLegacyEntryId", entryId, portalId, locale), IDataReader)
- End Function
-
- Public Overrides Function GetPostByLegacyUrl(url As String, portalId As Int32, locale As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetPostByLegacyUrl", url, portalId, locale), IDataReader)
- End Function
-
- Public Overrides Function GetPostLocalizations(contentItemId As Int32) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetPostLocalizations", contentItemId), IDataReader)
- End Function
-
- Public Overrides Function GetPosts(moduleId As Int32, blogID As Int32, displayLocale As String, userId As Int32, userIsAdmin As Boolean, published As Int32, limitToLocale As String, endDate As Date, authorUserId As Int32, onlyActionable As Boolean, pageIndex As Int32, pageSize As Int32, orderBy As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetPosts", moduleId, blogID, displayLocale, userId, userIsAdmin, published, GetNull(limitToLocale), GetNull(endDate), authorUserId, onlyActionable, pageIndex, pageSize, orderBy), IDataReader)
- End Function
-
- Public Overrides Function GetPostsByTerm(moduleId As Int32, blogID As Int32, displayLocale As String, userId As Int32, userIsAdmin As Boolean, termID As Int32, published As Int32, limitToLocale As String, endDate As Date, authorUserId As Int32, pageIndex As Int32, pageSize As Int32, orderBy As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetPostsByTerm", moduleId, blogID, displayLocale, userId, userIsAdmin, termID, published, GetNull(limitToLocale), GetNull(endDate), authorUserId, pageIndex, pageSize, orderBy), IDataReader)
- End Function
-
- Public Overrides Function GetPostsByCategory(moduleId As Int32, blogID As Int32, displayLocale As String, userId As Int32, userIsAdmin As Boolean, categories As String, published As Int32, limitToLocale As String, endDate As Date, authorUserId As Int32, pageIndex As Int32, pageSize As Int32, orderBy As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetPostsByCategory", moduleId, blogID, displayLocale, userId, userIsAdmin, categories, published, GetNull(limitToLocale), GetNull(endDate), authorUserId, pageIndex, pageSize, orderBy), IDataReader)
- End Function
-
- Public Overrides Function GetTerm(termId As Int32, moduleId As Int32, locale As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetTerm", termId, moduleId, locale), IDataReader)
- End Function
-
- Public Overrides Function GetTermLocalizations(termId As Int32) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetTermLocalizations", termId), IDataReader)
- End Function
-
- Public Overrides Function GetTermsByModule(moduleId As Int32, locale As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetTermsByModule", moduleId, locale), IDataReader)
- End Function
-
- Public Overrides Function GetTermsByPost(contentItemId As Int32, moduleId As Int32, locale As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetTermsByPost", contentItemId, moduleId, locale), IDataReader)
- End Function
-
- Public Overrides Function GetTermsByVocabulary(moduleId As Int32, vocabularyId As Int32, locale As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetTermsByVocabulary", moduleId, vocabularyId, locale), IDataReader)
- End Function
-
- Public Overrides Function GetUserPermissionsByModule(moduleID As Int32, userId As Int32) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetUserPermissionsByModule", moduleID, userId), IDataReader)
- End Function
-
- Public Overrides Function GetUsersByBlogPermission(portalId As Int32, blogId As Int32, permissionId As Int32) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetUsersByBlogPermission", portalId, blogId, permissionId), IDataReader)
- End Function
-
- Public Overrides Function SearchPosts(moduleId As Int32, blogID As Int32, displayLocale As String, userId As Int32, userIsAdmin As Boolean, searchText As String, searchTitle As Boolean, searchContents As Boolean, published As Int32, limitToLocale As String, endDate As Date, authorUserId As Int32, pageIndex As Int32, pageSize As Int32, orderBy As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "SearchPosts", moduleId, blogID, displayLocale, userId, userIsAdmin, searchText, searchTitle, searchContents, published, GetNull(limitToLocale), GetNull(endDate), authorUserId, pageIndex, pageSize, orderBy), IDataReader)
- End Function
-
- Public Overrides Function SearchPostsByTerm(moduleId As Int32, blogID As Int32, displayLocale As String, userId As Int32, userIsAdmin As Boolean, termID As Int32, searchText As String, searchTitle As Boolean, searchContents As Boolean, published As Int32, limitToLocale As String, endDate As Date, authorUserId As Int32, pageIndex As Int32, pageSize As Int32, orderBy As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "SearchPostsByTerm", moduleId, blogID, displayLocale, userId, userIsAdmin, termID, searchText, searchTitle, searchContents, published, GetNull(limitToLocale), GetNull(endDate), authorUserId, pageIndex, pageSize, orderBy), IDataReader)
- End Function
-
- Public Overrides Function SearchPostsByCategory(moduleId As Int32, blogID As Int32, displayLocale As String, userId As Int32, userIsAdmin As Boolean, categories As String, searchText As String, searchTitle As Boolean, searchContents As Boolean, published As Int32, limitToLocale As String, endDate As Date, authorUserId As Int32, pageIndex As Int32, pageSize As Int32, orderBy As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "SearchPostsByCategory", moduleId, blogID, displayLocale, userId, userIsAdmin, categories, searchText, searchTitle, searchContents, published, GetNull(limitToLocale), GetNull(endDate), authorUserId, pageIndex, pageSize, orderBy), IDataReader)
- End Function
-
-
- Public Overrides Sub SetBlogLocalization(blogID As Int32, locale As String, title As String, description As String)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "SetBlogLocalization", blogID, locale, title, description)
- End Sub
-
- Public Overrides Sub SetPostLocalization(postID As Int32, locale As String, title As String, summary As String, content As String, updatedByUser As Int32)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "SetPostLocalization", postID, locale, title, summary, content, updatedByUser)
- End Sub
-
- Public Overrides Function SetTerm(termID As Int32, vocabularyID As Int32, parentTermID As Int32, viewOrder As Int32, name As String, description As String, createdByUserID As Int32) As Integer
- Return CType(SqlHelper.ExecuteScalar(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "SetTerm", termID, vocabularyID, parentTermID, viewOrder, name, description, createdByUserID), Integer)
- End Function
-
- Public Overrides Sub SetTermLocalization(termID As Int32, locale As String, name As String, description As String)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "SetTermLocalization", termID, locale, name, description)
- End Sub
-
- Public Overrides Sub UpdateModuleWiring(portalId As Int32, oldModuleId As Int32, newModuleId As Int32)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "UpdateModuleWiring", portalId, oldModuleId, newModuleId)
- End Sub
-
- End Class
-
-End Namespace
-
diff --git a/Server/Blog/Components/Data/SqlDataProvider_CRUD.vb b/Server/Blog/Components/Data/SqlDataProvider_CRUD.vb
deleted file mode 100644
index 6d95668a..00000000
--- a/Server/Blog/Components/Data/SqlDataProvider_CRUD.vb
+++ /dev/null
@@ -1,189 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-Imports Microsoft.ApplicationBlocks.Data
-Imports DotNetNuke.Framework.Providers
-
-Namespace Data
-
- Partial Public Class SqlDataProvider
- Inherits DataProvider
-
-#Region " Private Members "
-
- Private Const ProviderType As String = "data"
- Private Const ModuleQualifier As String = "Blog_"
-
- Private _providerConfiguration As DotNetNuke.Framework.Providers.ProviderConfiguration = DotNetNuke.Framework.Providers.ProviderConfiguration.GetProviderConfiguration(ProviderType)
- Private _connectionString As String
- Private _providerPath As String
- Private _objectQualifier As String
- Private _databaseOwner As String
-
-#End Region
-
-#Region " Constructors "
-
- Public Sub New()
-
- ' Read the configuration specific information for this provider
- Dim objProvider As DotNetNuke.Framework.Providers.Provider = CType(_providerConfiguration.Providers(_providerConfiguration.DefaultProvider), Provider)
-
- 'Get Connection string from web.config
- _connectionString = DotNetNuke.Common.Utilities.Config.GetConnectionString()
-
- If _connectionString = "" Then
- ' Use connection string specified in provider
- _connectionString = objProvider.Attributes("connectionString")
- End If
-
- _providerPath = objProvider.Attributes("providerPath")
-
- _objectQualifier = objProvider.Attributes("objectQualifier")
- If _objectQualifier <> "" And _objectQualifier.EndsWith("_") = False Then
- _objectQualifier += "_"
- End If
-
- _databaseOwner = objProvider.Attributes("databaseOwner")
- If _databaseOwner <> "" And _databaseOwner.EndsWith(".") = False Then
- _databaseOwner += "."
- End If
-
- End Sub
-
-#End Region
-
-#Region " Properties "
-
- Public ReadOnly Property ConnectionString() As String
- Get
- Return _connectionString
- End Get
- End Property
-
- Public ReadOnly Property ProviderPath() As String
- Get
- Return _providerPath
- End Get
- End Property
-
- Public ReadOnly Property ObjectQualifier() As String
- Get
- Return _objectQualifier
- End Get
- End Property
-
- Public ReadOnly Property DatabaseOwner() As String
- Get
- Return _databaseOwner
- End Get
- End Property
-
-#End Region
-
-#Region " General Methods "
- Public Overrides Function GetNull(Field As Object) As Object
- Return DotNetNuke.Common.Utilities.Null.GetNull(Field, DBNull.Value)
- End Function
-#End Region
-
-
-#Region " BlogPermission Methods "
-
- Public Overrides Function GetBlogPermission(blogId As Int32, permissionId As Int32, roleId As Int32, userId As Int32) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetBlogPermission", blogId, permissionId, roleId, userId), IDataReader)
- End Function
-
- Public Overrides Sub AddBlogPermission(allowAccess As Boolean, blogId As Int32, expires As Date, permissionId As Int32, roleId As Int32, userId As Int32)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "AddBlogPermission", allowAccess, blogId, GetNull(expires), permissionId, roleId, userId)
- End Sub
-
- Public Overrides Sub UpdateBlogPermission(allowAccess As Boolean, blogId As Int32, expires As Date, permissionId As Int32, roleId As Int32, userId As Int32)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "UpdateBlogPermission", allowAccess, blogId, GetNull(expires), permissionId, roleId, userId)
- End Sub
-
- Public Overrides Sub DeleteBlogPermission(blogId As Int32, permissionId As Int32, roleId As Int32, userId As Int32)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "DeleteBlogPermission", blogId, permissionId, roleId, userId)
- End Sub
-
-#End Region
-
-#Region " Blog Methods "
-
- Public Overrides Function AddBlog(autoApprovePingBack As Boolean, moduleID As Int32, autoApproveTrackBack As Boolean, copyright As String, description As String, enablePingBackReceive As Boolean, enablePingBackSend As Boolean, enableTrackBackReceive As Boolean, enableTrackBackSend As Boolean, fullLocalization As Boolean, image As String, includeAuthorInFeed As Boolean, includeImagesInFeed As Boolean, locale As String, mustApproveGhostPosts As Boolean, ownerUserId As Int32, publishAsOwner As Boolean, published As Boolean, syndicated As Boolean, syndicationEmail As String, title As String, createdByUser As Int32) As Integer
- Return CType(SqlHelper.ExecuteScalar(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "AddBlog", autoApprovePingBack, moduleID, autoApproveTrackBack, GetNull(copyright), GetNull(description), enablePingBackReceive, enablePingBackSend, enableTrackBackReceive, enableTrackBackSend, fullLocalization, GetNull(image), includeAuthorInFeed, includeImagesInFeed, locale, mustApproveGhostPosts, ownerUserId, publishAsOwner, published, syndicated, GetNull(syndicationEmail), title, createdByUser), Integer)
- End Function
-
- Public Overrides Sub UpdateBlog(autoApprovePingBack As Boolean, moduleID As Int32, autoApproveTrackBack As Boolean, blogID As Int32, copyright As String, description As String, enablePingBackReceive As Boolean, enablePingBackSend As Boolean, enableTrackBackReceive As Boolean, enableTrackBackSend As Boolean, fullLocalization As Boolean, image As String, includeAuthorInFeed As Boolean, includeImagesInFeed As Boolean, locale As String, mustApproveGhostPosts As Boolean, ownerUserId As Int32, publishAsOwner As Boolean, published As Boolean, syndicated As Boolean, syndicationEmail As String, title As String, updatedByUser As Int32)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "UpdateBlog", autoApprovePingBack, moduleID, autoApproveTrackBack, blogID, GetNull(copyright), GetNull(description), enablePingBackReceive, enablePingBackSend, enableTrackBackReceive, enableTrackBackSend, fullLocalization, GetNull(image), includeAuthorInFeed, includeImagesInFeed, locale, mustApproveGhostPosts, ownerUserId, publishAsOwner, published, syndicated, GetNull(syndicationEmail), title, updatedByUser)
- End Sub
-
- Public Overrides Sub DeleteBlog(blogID As Int32)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "DeleteBlog", blogID)
- End Sub
-
-#End Region
-
-#Region " Comment Methods "
-
- Public Overrides Function AddComment(approved As Boolean, author As String, comment As String, contentItemId As Int32, email As String, parentId As Int32, website As String, createdByUser As Int32) As Integer
- Return CType(SqlHelper.ExecuteScalar(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "AddComment", approved, GetNull(author), comment, contentItemId, GetNull(email), GetNull(parentId), GetNull(website), createdByUser), Integer)
- End Function
-
- Public Overrides Sub UpdateComment(approved As Boolean, author As String, comment As String, commentID As Int32, contentItemId As Int32, email As String, parentId As Int32, website As String, updatedByUser As Int32)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "UpdateComment", approved, GetNull(author), comment, commentID, contentItemId, GetNull(email), GetNull(parentId), GetNull(website), updatedByUser)
- End Sub
-
- Public Overrides Sub DeleteComment(commentID As Int32)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "DeleteComment", commentID)
- End Sub
-
-#End Region
-
-#Region " LegacyUrl Methods "
- Public Overrides Sub AddLegacyUrl(contentItemId As Int32, entryId As Int32, url As String)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "AddLegacyUrl", contentItemId, GetNull(entryId), url)
- End Sub
-#End Region
-
-#Region " Post Methods "
-
- Public Overrides Function GetPost(contentItemId As Int32, moduleId As Int32, locale As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetPost", contentItemId, moduleId, locale), IDataReader)
- End Function
-
- Public Overrides Function AddPost(allowComments As Boolean, blogID As Int32, content As String, copyright As String, displayCopyright As Boolean, image As String, locale As String, published As Boolean, publishedOnDate As Date, summary As String, termIds As String, title As String, viewCount As Int32, createdByUser As Int32) As Integer
- Return CType(SqlHelper.ExecuteScalar(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "AddPost", allowComments, blogID, content, copyright, displayCopyright, image, GetNull(locale), published, publishedOnDate, summary, termIds, title, viewCount, createdByUser), Integer)
- End Function
-
- Public Overrides Sub UpdatePost(allowComments As Boolean, blogID As Int32, content As String, contentItemId As Int32, copyright As String, displayCopyright As Boolean, image As String, locale As String, published As Boolean, publishedOnDate As Date, summary As String, termIds As String, title As String, viewCount As Int32, updatedByUser As Int32)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "UpdatePost", allowComments, blogID, content, contentItemId, copyright, displayCopyright, image, GetNull(locale), published, publishedOnDate, summary, termIds, title, viewCount, updatedByUser)
- End Sub
-
- Public Overrides Sub DeletePost(contentItemId As Int32)
- SqlHelper.ExecuteNonQuery(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "DeletePost", contentItemId)
- End Sub
-
-#End Region
-
-
- End Class
-
-End Namespace
diff --git a/Server/Blog/Components/Data/SqlDataProvider_FK.vb b/Server/Blog/Components/Data/SqlDataProvider_FK.vb
deleted file mode 100644
index 1a56baaf..00000000
--- a/Server/Blog/Components/Data/SqlDataProvider_FK.vb
+++ /dev/null
@@ -1,53 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-Imports Microsoft.ApplicationBlocks.Data
-
-Namespace Data
-
- Partial Public Class SqlDataProvider
-
-#Region " BlogPermission Methods "
- Public Overrides Function GetBlogPermissionsByBlog(blogID As Int32, StartRowIndex As Integer, MaximumRows As Integer, OrderBy As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetBlogPermissionsByBlog", blogID, StartRowIndex, MaximumRows, OrderBy.ToUpper), IDataReader)
- End Function
-
-#End Region
-
-#Region " Blog Methods "
-
- Public Overrides Function GetBlogsByCreatedByUser(userID As Int32, StartRowIndex As Integer, MaximumRows As Integer, OrderBy As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetBlogsByCreatedByUser", userID, StartRowIndex, MaximumRows, OrderBy.ToUpper), IDataReader)
- End Function
-
-#End Region
-
-#Region " Comment Methods "
-#End Region
-
-#Region " Post Methods "
- Public Overrides Function GetPostsByBlog(blogID As Int32, displayLocale As String, pageIndex As Int32, pageSize As Int32, orderBy As String) As IDataReader
- Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & ModuleQualifier & "GetPostsByBlog", blogID, displayLocale, pageIndex, pageSize, orderBy), IDataReader)
- End Function
-#End Region
-
- End Class
-
-End Namespace
diff --git a/Server/Blog/Components/Entities/Blogs/BlogCalendarInfo.vb b/Server/Blog/Components/Entities/Blogs/BlogCalendarInfo.vb
deleted file mode 100644
index e4e1bcfd..00000000
--- a/Server/Blog/Components/Entities/Blogs/BlogCalendarInfo.vb
+++ /dev/null
@@ -1,172 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-Imports System.Runtime.Serialization
-Imports DotNetNuke.Common.Utilities
-Imports DotNetNuke.Entities.Modules
-Imports DotNetNuke.Services.Tokens
-
-Namespace Entities.Blogs
- Public Class BlogCalendarInfo
- Implements IHydratable
- Implements IPropertyAccess
-
-#Region " ML Properties "
- Public Property ParentTabID As Integer = -1
-#End Region
-
-#Region " Public Properties "
-
- Public Property PostYear As Int32 = -1
-
- Public Property PostMonth As Int32 = -1
-
- Public Property PostCount As Int32 = -1
-
- Public Property ViewCount As Int32 = -1
-
- Private _FirstDay As Date = Date.MinValue
- Public ReadOnly Property FirstDay As Date
- Get
- If _FirstDay = Date.MinValue Then
- _FirstDay = DateSerial(PostYear, PostMonth, 1)
- End If
- Return _FirstDay
- End Get
- End Property
-
- Private _FirstDayNextMonth As Date = Date.MinValue
- Public ReadOnly Property FirstDayNextMonth As Date
- Get
- If _FirstDayNextMonth = Date.MinValue Then
- _FirstDayNextMonth = DateSerial(PostYear, PostMonth, 1).AddMonths(1)
- End If
- Return _FirstDayNextMonth
- End Get
- End Property
-
- Private _LastDay As Date = Date.MinValue
- Public ReadOnly Property LastDay As Date
- Get
- If _LastDay = Date.MinValue Then
- _LastDay = DateSerial(PostYear, PostMonth, 1).AddMonths(1).AddDays(-1)
- End If
- Return _LastDay
- End Get
- End Property
-#End Region
-
-#Region " IHydratable Implementation "
- ''' -----------------------------------------------------------------------------
- '''
- ''' Fill hydrates the object from a Datareader
- '''
- ''' The Fill method is used by the CBO method to hydrtae the object
- ''' rather than using the more expensive Refection methods.
- '''
- ''' [pdonker] 02/16/2013 Created
- '''
- ''' -----------------------------------------------------------------------------
- Public Sub Fill(dr As IDataReader) Implements IHydratable.Fill
- PostYear = Convert.ToInt32(Null.SetNull(dr.Item("PostYear"), PostYear))
- PostMonth = Convert.ToInt32(Null.SetNull(dr.Item("PostMonth"), PostMonth))
- PostCount = Convert.ToInt32(Null.SetNull(dr.Item("PostCount"), PostCount))
- ViewCount = Convert.ToInt32(Null.SetNull(dr.Item("ViewCount"), ViewCount))
- End Sub
- ''' -----------------------------------------------------------------------------
- '''
- ''' Gets and sets the Key ID
- '''
- ''' The KeyID property is part of the IHydratble interface. It is used
- ''' as the key property when creating a Dictionary
- '''
- ''' [pdonker] 02/16/2013 Created
- '''
- ''' -----------------------------------------------------------------------------
- Public Property KeyID() As Integer Implements IHydratable.KeyID
- Get
- Return Nothing
- End Get
- Set(value As Integer)
- End Set
- End Property
-#End Region
-
-#Region " IPropertyAccess Implementation "
- Public Function GetProperty(strPropertyName As String, strFormat As String, formatProvider As System.Globalization.CultureInfo, AccessingUser As DotNetNuke.Entities.Users.UserInfo, AccessLevel As DotNetNuke.Services.Tokens.Scope, ByRef PropertyNotFound As Boolean) As String Implements DotNetNuke.Services.Tokens.IPropertyAccess.GetProperty
- Dim OutputFormat As String = String.Empty
- Dim portalSettings As DotNetNuke.Entities.Portals.PortalSettings = DotNetNuke.Entities.Portals.PortalController.Instance.GetCurrentPortalSettings
- If strFormat = String.Empty Then
- OutputFormat = "D"
- Else
- OutputFormat = strFormat
- End If
- Select Case strPropertyName.ToLower
- Case "postyear"
- Return (PostYear.ToString(OutputFormat, formatProvider))
- Case "postmonth"
- Return (PostMonth.ToString(OutputFormat, formatProvider))
- Case "postcount"
- Return (PostCount.ToString(OutputFormat, formatProvider))
- Case "viewcount"
- Return (ViewCount.ToString(OutputFormat, formatProvider))
- Case "firstday"
- Return (FirstDay.ToString(OutputFormat, formatProvider))
- Case "lastday"
- Return (LastDay.ToString(OutputFormat, formatProvider))
- Case "firstdaynextmonth"
- Return (FirstDayNextMonth.ToString(OutputFormat, formatProvider))
- Case "parenturl"
- Return PermaLink(ParentTabID)
- Case Else
- PropertyNotFound = True
- End Select
- Return Null.NullString
- End Function
-
- Public ReadOnly Property Cacheability() As DotNetNuke.Services.Tokens.CacheLevel Implements DotNetNuke.Services.Tokens.IPropertyAccess.Cacheability
- Get
- Return CacheLevel.fullyCacheable
- End Get
- End Property
-#End Region
-
- Public Function PermaLink(strParentTabID As Integer) As String
- Dim oTabController As DotNetNuke.Entities.Tabs.TabController = New DotNetNuke.Entities.Tabs.TabController
- Dim oParentTab As DotNetNuke.Entities.Tabs.TabInfo = oTabController.GetTab(strParentTabID, DotNetNuke.Entities.Portals.PortalSettings.Current.PortalId, False)
- _permaLink = String.Empty
- Return PermaLink(oParentTab)
- End Function
-
- Public Function PermaLink(portalSettings As DotNetNuke.Entities.Portals.PortalSettings) As String
- Return PermaLink(portalSettings.ActiveTab)
- End Function
-
- Private _permaLink As String = ""
- Public Function PermaLink(tab As DotNetNuke.Entities.Tabs.TabInfo) As String
- If String.IsNullOrEmpty(_permaLink) Then
- _permaLink = DotNetNuke.Common.Globals.ApplicationURL(tab.TabID) & "&end=" & FirstDayNextMonth.ToString
- _permaLink = DotNetNuke.Common.Globals.FriendlyUrl(tab, _permaLink)
- End If
- Return _permaLink
- End Function
-
- End Class
-End Namespace
diff --git a/Server/Blog/Components/Entities/Blogs/BlogInfo.vb b/Server/Blog/Components/Entities/Blogs/BlogInfo.vb
deleted file mode 100644
index 494c66ad..00000000
--- a/Server/Blog/Components/Entities/Blogs/BlogInfo.vb
+++ /dev/null
@@ -1,77 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-Imports System.Runtime.Serialization
-Imports DotNetNuke.Common.Globals
-Imports DotNetNuke.Modules.Blog.Common.Globals
-
-Namespace Entities.Blogs
-
- Partial Public Class BlogInfo
-
- Private _permissions As Security.Permissions.BlogPermissionCollection
- Public Property Permissions() As Security.Permissions.BlogPermissionCollection
- Get
- If _permissions Is Nothing Then
- _permissions = Security.Permissions.BlogPermissionsController.GetBlogPermissionsCollection(BlogID)
- End If
- Return _permissions
- End Get
- Set(value As Security.Permissions.BlogPermissionCollection)
- _permissions = value
- End Set
- End Property
-
-
- Public Property CanEdit As Boolean = False
-
- Public Property CanAdd As Boolean = False
-
- Public Property CanApprove As Boolean = False
-
- Public Property IsOwner As Boolean = False
-
- Public Function PermaLink(strParentTabID As Integer) As String
- Dim oTabController As DotNetNuke.Entities.Tabs.TabController = New DotNetNuke.Entities.Tabs.TabController
- Dim oParentTab As DotNetNuke.Entities.Tabs.TabInfo = oTabController.GetTab(strParentTabID, DotNetNuke.Entities.Portals.PortalSettings.Current.PortalId, False)
- _permaLink = String.Empty
- Return PermaLink(oParentTab)
- End Function
-
- Public Function PermaLink(portalSettings As DotNetNuke.Entities.Portals.PortalSettings) As String
- Return PermaLink(portalSettings.ActiveTab)
- End Function
-
- Private _permaLink As String = ""
- Public Function PermaLink(tab As DotNetNuke.Entities.Tabs.TabInfo) As String
- If String.IsNullOrEmpty(_permaLink) Then
- _permaLink = ApplicationURL(tab.TabID) & "&Blog=" & BlogID.ToString
- If DotNetNuke.Entities.Host.Host.UseFriendlyUrls Then
- _permaLink = FriendlyUrl(tab, _permaLink, GetSafePageName(LocalizedTitle))
- Else
- _permaLink = ResolveUrl(_permaLink)
- End If
- End If
- Return _permaLink
- End Function
-
- End Class
-
-End Namespace
\ No newline at end of file
diff --git a/Server/Blog/Components/Entities/Blogs/BlogInfo_Interfaces.vb b/Server/Blog/Components/Entities/Blogs/BlogInfo_Interfaces.vb
deleted file mode 100644
index 32b5047b..00000000
--- a/Server/Blog/Components/Entities/Blogs/BlogInfo_Interfaces.vb
+++ /dev/null
@@ -1,397 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-Imports System.Runtime.Serialization
-Imports System.Xml
-Imports System.Xml.Schema
-Imports System.Xml.Serialization
-
-Imports DotNetNuke.Common.Utilities
-Imports DotNetNuke.Entities.Modules
-Imports DotNetNuke.Services.Tokens
-
-Imports DotNetNuke.Modules.Blog.Common.Globals
-
-Namespace Entities.Blogs
-
-
- Partial Public Class BlogInfo
- Implements IHydratable
- Implements IPropertyAccess
- Implements IXmlSerializable
-
-#Region " ML Properties "
- Public Property ParentTabID As Integer = -1
-#End Region
-
-#Region " IHydratable Implementation "
- ''' -----------------------------------------------------------------------------
- '''
- ''' Fill hydrates the object from a Datareader
- '''
- ''' The Fill method is used by the CBO method to hydrtae the object
- ''' rather than using the more expensive Refection methods.
- '''
- ''' [pdonker] 02/16/2013 Created
- '''
- ''' -----------------------------------------------------------------------------
- Public Sub Fill(dr As IDataReader) Implements IHydratable.Fill
- BlogID = Convert.ToInt32(Null.SetNull(dr.Item("BlogID"), BlogID))
- ModuleID = Convert.ToInt32(Null.SetNull(dr.Item("ModuleID"), ModuleID))
- Title = Convert.ToString(Null.SetNull(dr.Item("Title"), Title))
- Description = Convert.ToString(Null.SetNull(dr.Item("Description"), Description))
- Image = Convert.ToString(Null.SetNull(dr.Item("Image"), Image))
- Locale = Convert.ToString(Null.SetNull(dr.Item("Locale"), Locale))
- FullLocalization = Convert.ToBoolean(Null.SetNull(dr.Item("FullLocalization"), FullLocalization))
- Published = Convert.ToBoolean(Null.SetNull(dr.Item("Published"), Published))
- IncludeImagesInFeed = Convert.ToBoolean(Null.SetNull(dr.Item("IncludeImagesInFeed"), IncludeImagesInFeed))
- IncludeAuthorInFeed = Convert.ToBoolean(Null.SetNull(dr.Item("IncludeAuthorInFeed"), IncludeAuthorInFeed))
- Syndicated = Convert.ToBoolean(Null.SetNull(dr.Item("Syndicated"), Syndicated))
- SyndicationEmail = Convert.ToString(Null.SetNull(dr.Item("SyndicationEmail"), SyndicationEmail))
- Copyright = Convert.ToString(Null.SetNull(dr.Item("Copyright"), Copyright))
- MustApproveGhostPosts = Convert.ToBoolean(Null.SetNull(dr.Item("MustApproveGhostPosts"), MustApproveGhostPosts))
- PublishAsOwner = Convert.ToBoolean(Null.SetNull(dr.Item("PublishAsOwner"), PublishAsOwner))
- EnablePingBackSend = Convert.ToBoolean(Null.SetNull(dr.Item("EnablePingBackSend"), EnablePingBackSend))
- EnablePingBackReceive = Convert.ToBoolean(Null.SetNull(dr.Item("EnablePingBackReceive"), EnablePingBackReceive))
- AutoApprovePingBack = Convert.ToBoolean(Null.SetNull(dr.Item("AutoApprovePingBack"), AutoApprovePingBack))
- EnableTrackBackSend = Convert.ToBoolean(Null.SetNull(dr.Item("EnableTrackBackSend"), EnableTrackBackSend))
- EnableTrackBackReceive = Convert.ToBoolean(Null.SetNull(dr.Item("EnableTrackBackReceive"), EnableTrackBackReceive))
- AutoApproveTrackBack = Convert.ToBoolean(Null.SetNull(dr.Item("AutoApproveTrackBack"), AutoApproveTrackBack))
- OwnerUserId = Convert.ToInt32(Null.SetNull(dr.Item("OwnerUserId"), OwnerUserId))
- CreatedByUserID = Convert.ToInt32(Null.SetNull(dr.Item("CreatedByUserID"), CreatedByUserID))
- CreatedOnDate = CDate(Null.SetNull(dr.Item("CreatedOnDate"), CreatedOnDate))
- LastModifiedByUserID = Convert.ToInt32(Null.SetNull(dr.Item("LastModifiedByUserID"), LastModifiedByUserID))
- LastModifiedOnDate = CDate(Null.SetNull(dr.Item("LastModifiedOnDate"), LastModifiedOnDate))
- DisplayName = Convert.ToString(Null.SetNull(dr.Item("DisplayName"), DisplayName))
- Email = Convert.ToString(Null.SetNull(dr.Item("Email"), Email))
- Username = Convert.ToString(Null.SetNull(dr.Item("Username"), Username))
- NrPosts = Convert.ToInt32(Null.SetNull(dr.Item("NrPosts"), NrPosts))
- LastPublishDate = CDate(Null.SetNull(dr.Item("LastPublishDate"), LastPublishDate))
- NrViews = Convert.ToInt32(Null.SetNull(dr.Item("NrViews"), NrViews))
- FirstPublishDate = CDate(Null.SetNull(dr.Item("FirstPublishDate"), FirstPublishDate))
- AltLocale = Convert.ToString(Null.SetNull(dr.Item("AltLocale"), AltLocale))
- AltTitle = Convert.ToString(Null.SetNull(dr.Item("AltTitle"), AltTitle))
- AltDescription = Convert.ToString(Null.SetNull(dr.Item("AltDescription"), AltDescription))
- CanEdit = Convert.ToBoolean(Null.SetNull(dr.Item("CanEdit"), CanEdit))
- CanAdd = Convert.ToBoolean(Null.SetNull(dr.Item("CanAdd"), CanAdd))
- CanApprove = Convert.ToBoolean(Null.SetNull(dr.Item("CanApprove"), CanApprove))
-
- End Sub
- ''' -----------------------------------------------------------------------------
- '''
- ''' Gets and sets the Key ID
- '''
- ''' The KeyID property is part of the IHydratble interface. It is used
- ''' as the key property when creating a Dictionary
- '''
- ''' [pdonker] 02/16/2013 Created
- '''
- ''' -----------------------------------------------------------------------------
- Public Property KeyID() As Integer Implements IHydratable.KeyID
- Get
- Return BlogID
- End Get
- Set(value As Integer)
- BlogID = value
- End Set
- End Property
-#End Region
-
-#Region " IPropertyAccess Implementation "
- Public Function GetProperty(strPropertyName As String, strFormat As String, formatProvider As System.Globalization.CultureInfo, AccessingUser As DotNetNuke.Entities.Users.UserInfo, AccessLevel As DotNetNuke.Services.Tokens.Scope, ByRef PropertyNotFound As Boolean) As String Implements DotNetNuke.Services.Tokens.IPropertyAccess.GetProperty
- Dim OutputFormat As String = String.Empty
- Dim portalSettings As DotNetNuke.Entities.Portals.PortalSettings = DotNetNuke.Entities.Portals.PortalController.Instance.GetCurrentPortalSettings
- If strFormat = String.Empty Then
- OutputFormat = "D"
- Else
- OutputFormat = strFormat
- End If
- Select Case strPropertyName.ToLower
- Case "blogid"
- Return (BlogID.ToString(OutputFormat, formatProvider))
- Case "moduleid"
- Return (ModuleID.ToString(OutputFormat, formatProvider))
- Case "title"
- Return PropertyAccess.FormatString(Title, strFormat)
- Case "description"
- Return PropertyAccess.FormatString(Description, strFormat)
- Case "image"
- Return PropertyAccess.FormatString(Image, strFormat)
- Case "hasimage"
- Return CBool(Image <> "").ToString(formatProvider)
- Case "locale"
- Return PropertyAccess.FormatString(Locale, strFormat)
- Case "fulllocalization"
- Return FullLocalization.ToString
- Case "fulllocalizationyesno"
- Return PropertyAccess.Boolean2LocalizedYesNo(FullLocalization, formatProvider)
- Case "published"
- Return Published.ToString
- Case "publishedyesno"
- Return PropertyAccess.Boolean2LocalizedYesNo(Published, formatProvider)
- Case "includeimagesinfeed"
- Return IncludeImagesInFeed.ToString
- Case "includeimagesinfeedyesno"
- Return PropertyAccess.Boolean2LocalizedYesNo(IncludeImagesInFeed, formatProvider)
- Case "includeauthorinfeed"
- Return IncludeAuthorInFeed.ToString
- Case "includeauthorinfeedyesno"
- Return PropertyAccess.Boolean2LocalizedYesNo(IncludeAuthorInFeed, formatProvider)
- Case "syndicated"
- Return Syndicated.ToString
- Case "syndicatedyesno"
- Return PropertyAccess.Boolean2LocalizedYesNo(Syndicated, formatProvider)
- Case "syndicationemail"
- Return PropertyAccess.FormatString(SyndicationEmail, strFormat)
- Case "copyright"
- Return PropertyAccess.FormatString(Copyright, strFormat)
- Case "mustapproveghostposts"
- Return MustApproveGhostPosts.ToString
- Case "mustapproveghostpostsyesno"
- Return PropertyAccess.Boolean2LocalizedYesNo(MustApproveGhostPosts, formatProvider)
- Case "publishasowner"
- Return PublishAsOwner.ToString
- Case "publishasowneryesno"
- Return PropertyAccess.Boolean2LocalizedYesNo(PublishAsOwner, formatProvider)
- Case "enablepingbacksend"
- Return EnablePingBackSend.ToString
- Case "enablepingbacksendyesno"
- Return PropertyAccess.Boolean2LocalizedYesNo(EnablePingBackSend, formatProvider)
- Case "enablepingbackreceive"
- Return EnablePingBackReceive.ToString
- Case "enablepingbackreceiveyesno"
- Return PropertyAccess.Boolean2LocalizedYesNo(EnablePingBackReceive, formatProvider)
- Case "autoapprovepingback"
- Return AutoApprovePingBack.ToString
- Case "autoapprovepingbackyesno"
- Return PropertyAccess.Boolean2LocalizedYesNo(AutoApprovePingBack, formatProvider)
- Case "enabletrackbacksend"
- Return EnableTrackBackSend.ToString
- Case "enabletrackbacksendyesno"
- Return PropertyAccess.Boolean2LocalizedYesNo(EnableTrackBackSend, formatProvider)
- Case "enabletrackbackreceive"
- Return EnableTrackBackReceive.ToString
- Case "enabletrackbackreceiveyesno"
- Return PropertyAccess.Boolean2LocalizedYesNo(EnableTrackBackReceive, formatProvider)
- Case "autoapprovetrackback"
- Return AutoApproveTrackBack.ToString
- Case "autoapprovetrackbackyesno"
- Return PropertyAccess.Boolean2LocalizedYesNo(AutoApproveTrackBack, formatProvider)
- Case "owneruserid"
- Return (OwnerUserId.ToString(OutputFormat, formatProvider))
- Case "createdbyuserid"
- Return (CreatedByUserID.ToString(OutputFormat, formatProvider))
- Case "createdondate"
- Return (CreatedOnDate.ToString(OutputFormat, formatProvider))
- Case "lastmodifiedbyuserid"
- Return (LastModifiedByUserID.ToString(OutputFormat, formatProvider))
- Case "lastmodifiedondate"
- Return (LastModifiedOnDate.ToString(OutputFormat, formatProvider))
- Case "displayname"
- Return PropertyAccess.FormatString(DisplayName, strFormat)
- Case "email"
- Return PropertyAccess.FormatString(Email, strFormat)
- Case "username"
- Return PropertyAccess.FormatString(Username, strFormat)
- Case "nrposts"
- Return (NrPosts.ToString(OutputFormat, formatProvider))
- Case "lastpublishdate"
- Return (LastPublishDate.ToString(OutputFormat, formatProvider))
- Case "nrviews"
- Return (NrViews.ToString(OutputFormat, formatProvider))
- Case "firstpublishdate"
- Return (FirstPublishDate.ToString(OutputFormat, formatProvider))
- Case "altlocale"
- Return PropertyAccess.FormatString(AltLocale, strFormat)
- Case "alttitle"
- Return PropertyAccess.FormatString(AltTitle, strFormat)
- Case "altdescription"
- Return PropertyAccess.FormatString(AltDescription, strFormat)
- Case "localizedtitle"
- Return PropertyAccess.FormatString(LocalizedTitle, strFormat)
- Case "localizeddescription"
- Return PropertyAccess.FormatString(LocalizedDescription, strFormat)
- Case "link", "permalink"
- Return PermaLink(DotNetNuke.Entities.Portals.PortalSettings.Current)
- Case "parenturl"
- Return PermaLink(ParentTabID)
- Case Else
- PropertyNotFound = True
- End Select
-
- Return Null.NullString
- End Function
-
- Public ReadOnly Property Cacheability() As DotNetNuke.Services.Tokens.CacheLevel Implements DotNetNuke.Services.Tokens.IPropertyAccess.Cacheability
- Get
- Return CacheLevel.fullyCacheable
- End Get
- End Property
-#End Region
-
-#Region " IXmlSerializable Implementation "
- ''' -----------------------------------------------------------------------------
- '''
- ''' GetSchema returns the XmlSchema for this class
- '''
- ''' GetSchema is implemented as a stub method as it is not required
- '''
- ''' [pdonker] 02/16/2013 Created
- '''
- ''' -----------------------------------------------------------------------------
- Public Function GetSchema() As XmlSchema Implements IXmlSerializable.GetSchema
- Return Nothing
- End Function
-
- Private Function readElement(reader As XmlReader, ElementName As String) As String
- If (Not reader.NodeType = XmlNodeType.Element) OrElse reader.Name <> ElementName Then
- reader.ReadToFollowing(ElementName)
- End If
- If reader.NodeType = XmlNodeType.Element Then
- Return reader.ReadElementContentAsString
- Else
- Return ""
- End If
- End Function
-
- ''' -----------------------------------------------------------------------------
- '''
- ''' ReadXml fills the object (de-serializes it) from the XmlReader passed
- '''
- '''
- ''' The XmlReader that contains the xml for the object
- '''
- ''' [pdonker] 02/16/2013 Created
- '''
- ''' -----------------------------------------------------------------------------
- Public Sub ReadXml(reader As XmlReader) Implements IXmlSerializable.ReadXml
- ' not implemented
- End Sub
-
- Friend Property ImportedBlogId As Integer = -1
- Friend Property ImportedPosts As List(Of Posts.PostInfo)
- Friend Property ImportedFiles As List(Of String)
-
- Public Sub FromXml(xml As XmlNode)
- If xml Is Nothing Then Exit Sub
-
- xml.ReadValue("BlogId", ImportedBlogId)
- xml.ReadValue("Title", Title)
- xml.ReadValue("TitleLocalizations", TitleLocalizations)
- xml.ReadValue("Description", Description)
- xml.ReadValue("DescriptionLocalizations", DescriptionLocalizations)
- xml.ReadValue("Image", Image)
- xml.ReadValue("Locale", Locale)
- xml.ReadValue("FullLocalization", FullLocalization)
- xml.ReadValue("Published", Published)
- xml.ReadValue("IncludeImagesInFeed", IncludeImagesInFeed)
- xml.ReadValue("IncludeAuthorInFeed", IncludeAuthorInFeed)
- xml.ReadValue("Syndicated", Syndicated)
- xml.ReadValue("SyndicationEmail", SyndicationEmail)
- xml.ReadValue("Copyright", Copyright)
- xml.ReadValue("MustApproveGhostPosts", MustApproveGhostPosts)
- xml.ReadValue("PublishAsOwner", PublishAsOwner)
- xml.ReadValue("EnablePingBackSend", EnablePingBackSend)
- xml.ReadValue("EnablePingBackReceive", EnablePingBackReceive)
- xml.ReadValue("AutoApprovePingBack", AutoApprovePingBack)
- xml.ReadValue("EnableTrackBackSend", EnableTrackBackSend)
- xml.ReadValue("EnableTrackBackReceive", EnableTrackBackReceive)
- xml.ReadValue("AutoApproveTrackBack", AutoApproveTrackBack)
- xml.ReadValue("Username", Username)
- xml.ReadValue("Email", Email)
-
- ImportedPosts = New List(Of Posts.PostInfo)
- For Each xPost As XmlNode In xml.SelectNodes("Posts/Post")
- Dim post As New Posts.PostInfo
- post.fromXml(xPost)
- ImportedPosts.Add(post)
- Next
-
- ImportedFiles = New List(Of String)
- For Each xFile As XmlNode In xml.SelectNodes("Files/File")
- ImportedFiles.Add(xFile.InnerText)
- Next
-
- End Sub
-
- ''' -----------------------------------------------------------------------------
- '''
- ''' WriteXml converts the object to Xml (serializes it) and writes it using the XmlWriter passed
- '''
- '''
- ''' The XmlWriter that contains the xml for the object
- '''
- ''' [pdonker] 02/16/2013 Created
- '''
- ''' -----------------------------------------------------------------------------
- Public Sub WriteXml(writer As XmlWriter) Implements IXmlSerializable.WriteXml
- writer.WriteStartElement("Blog")
- writer.WriteElementString("BlogId", BlogID.ToString)
- writer.WriteElementString("Title", Title)
- writer.WriteElementString("TitleLocalizations", TitleLocalizations.ToString)
- writer.WriteElementString("Description", Description)
- writer.WriteElementString("DescriptionLocalizations", DescriptionLocalizations.ToString)
- writer.WriteElementString("Image", Image)
- writer.WriteElementString("Locale", Locale)
- writer.WriteElementString("FullLocalization", FullLocalization.ToString())
- writer.WriteElementString("Published", Published.ToString())
- writer.WriteElementString("IncludeImagesInFeed", IncludeImagesInFeed.ToString())
- writer.WriteElementString("IncludeAuthorInFeed", IncludeAuthorInFeed.ToString())
- writer.WriteElementString("Syndicated", Syndicated.ToString())
- writer.WriteElementString("SyndicationEmail", SyndicationEmail)
- writer.WriteElementString("Copyright", Copyright)
- writer.WriteElementString("MustApproveGhostPosts", MustApproveGhostPosts.ToString())
- writer.WriteElementString("PublishAsOwner", PublishAsOwner.ToString())
- writer.WriteElementString("EnablePingBackSend", EnablePingBackSend.ToString())
- writer.WriteElementString("EnablePingBackReceive", EnablePingBackReceive.ToString())
- writer.WriteElementString("AutoApprovePingBack", AutoApprovePingBack.ToString())
- writer.WriteElementString("EnableTrackBackSend", EnableTrackBackSend.ToString())
- writer.WriteElementString("EnableTrackBackReceive", EnableTrackBackReceive.ToString())
- writer.WriteElementString("AutoApproveTrackBack", AutoApproveTrackBack.ToString())
- writer.WriteElementString("Username", Username)
- writer.WriteElementString("Email", Email)
- writer.WriteStartElement("Posts")
- Dim page As Integer = 0
- Dim totalRecords As Integer = 1
- Do While page * 10 < totalRecords
- For Each p As Posts.PostInfo In Posts.PostsController.GetPostsByBlog(ModuleID, BlogID, "", -1, page, 20, "PUBLISHEDONDATE DESC", totalRecords).Values
- p.WriteXml(writer)
- Next
- page += 1
- Loop
- writer.WriteEndElement() ' Posts
- writer.WriteStartElement("Files")
- ' pack files
- Dim postDir As String = GetBlogDirectoryMapPath(BlogID)
- If IO.Directory.Exists(postDir) Then
- For Each f As String In IO.Directory.GetFiles(postDir)
- Dim fileName As String = IO.Path.GetFileName(f)
- writer.WriteElementString("File", fileName)
- Next
- End If
- writer.WriteEndElement() ' Files
- writer.WriteEndElement() ' Blog
- End Sub
-#End Region
-
- End Class
-End Namespace
-
-
diff --git a/Server/Blog/Components/Entities/Blogs/BlogInfo_Properties.vb b/Server/Blog/Components/Entities/Blogs/BlogInfo_Properties.vb
deleted file mode 100644
index 7adb228e..00000000
--- a/Server/Blog/Components/Entities/Blogs/BlogInfo_Properties.vb
+++ /dev/null
@@ -1,177 +0,0 @@
-'
-' DNN Connect - http://dnn-connect.org
-' Copyright (c) 2015
-' by DNN Connect
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
-Imports System.Runtime.Serialization
-
-Namespace Entities.Blogs
- Partial Public Class BlogInfo
-
-#Region " Private Members "
-#End Region
-
-#Region " Constructors "
- Public Sub New()
- Try
- Locale = DotNetNuke.Entities.Portals.PortalSettings.Current.DefaultLanguage
- Catch ex As Exception
- End Try
- End Sub
-#End Region
-
-#Region " Public Properties "
-
- Public Property BlogID As Int32 = -1
-
- Public Property ModuleID As Int32 = -1
-
- Public Property Title As String = ""
-
- Public Property Description As String = ""
-
- Public Property Image As String = ""
-
- Public Property Locale As String = ""
-
- Public Property FullLocalization As Boolean = False
-
- Public Property Published As Boolean = True
-
- Public Property IncludeImagesInFeed As Boolean = True
-
- Public Property IncludeAuthorInFeed As Boolean = False
-
- Public Property Syndicated As Boolean = True
-
- Public Property SyndicationEmail As String = ""
-
- Public Property Copyright As String = ""
-
- Public Property MustApproveGhostPosts As Boolean = False
-
- Public Property PublishAsOwner As Boolean = False
-
- Public Property EnablePingBackSend As Boolean = True
-
- Public Property EnablePingBackReceive As Boolean = True
-
- Public Property AutoApprovePingBack As Boolean = False
-
- Public Property EnableTrackBackSend As Boolean = True
-
- Public Property EnableTrackBackReceive As Boolean = False
-
- Public Property AutoApproveTrackBack As Boolean = False
-
- Public Property OwnerUserId As Int32 = -1
-
- Public Property CreatedByUserID As Int32 = -1
-
- Public Property CreatedOnDate As Date = Date.MinValue
-
- Public Property LastModifiedByUserID As Int32 = -1
-
- Public Property LastModifiedOnDate As Date = Date.MinValue
-
- Public Property DisplayName As String = ""
-
- Public Property Email As String = ""
-
- Public Property Username As String = ""
-
- Public Property NrPosts As Int32 = -1
-
- Public Property LastPublishDate As Date = Date.MinValue
-
- Public Property NrViews As Int32 = -1
-