Skip to content

Commit 551e204

Browse files
committed
And yet more fixes
1 parent 6998b21 commit 551e204

File tree

9 files changed

+34
-38
lines changed

9 files changed

+34
-38
lines changed

Server/Blog/Blog.ascx.vb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ Public Class Blog
5353

5454
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
5555

56-
ViewSettings.TemplateSettings.ReadValue("pagesize", _pageSize)
57-
Request.Params.ReadValue("Page", _reqPage)
56+
_pageSize = ViewSettings.TemplateSettings.ReadValue("pagesize", _pageSize)
57+
_reqPage = Request.Params.ReadValue("Page", _reqPage)
5858

5959
If Context.Items("BlogPageInitialized") Is Nothing Then
6060

@@ -257,7 +257,7 @@ Public Class Blog
257257
Case "blogs"
258258

259259
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)
260-
Parameters.ReadValue("pagesize", _pageSize)
260+
_pageSize = Parameters.ReadValue("pagesize", _pageSize)
261261
If _pageSize > 0 Then
262262
_usePaging = True
263263
Dim startRec As Integer = ((_reqPage - 1) * _pageSize) + 1
@@ -283,7 +283,7 @@ Public Class Blog
283283

284284
Case "posts"
285285

286-
Parameters.ReadValue("pagesize", _pageSize)
286+
_pageSize = Parameters.ReadValue("pagesize", _pageSize)
287287
EnsurePostList(_pageSize)
288288
For Each e As PostInfo In PostList
289289
If BlogContext.ParentModule IsNot Nothing Then
@@ -294,10 +294,10 @@ Public Class Blog
294294

295295
Case "postspager"
296296

297-
Parameters.ReadValue("pagesize", _pageSize)
297+
_pageSize = Parameters.ReadValue("pagesize", _pageSize)
298298
EnsurePostList(_pageSize)
299299
Dim pagerType As String = "allpages"
300-
Parameters.ReadValue("pagertype", pagerType)
300+
pagerType = Parameters.ReadValue("pagertype", pagerType)
301301
Dim remdr As Integer = 0
302302
Dim nrPages As Integer = Math.DivRem(_totalRecords, _pageSize, remdr)
303303
If remdr > 0 Then
@@ -451,7 +451,7 @@ Public Class Blog
451451
Next
452452
_usePaging = False
453453
Else
454-
Parameters.ReadValue("pagesize", _pageSize)
454+
_pageSize = Parameters.ReadValue("pagesize", _pageSize)
455455
If _pageSize < 1 Then _pageSize = 10 ' we will not list "all Posts"
456456
For Each c As CommentInfo In CommentsController.GetCommentsByModule(BlogContext.BlogModuleId, UserId, _reqPage - 1, _pageSize, "CREATEDONDATE DESC", _totalRecords).Values
457457
Replacers.Add(New BlogTokenReplace(Me.ModuleConfiguration, Me.BlogContext, Me.Settings, Me.ViewSettings, BlogContext.Post, c))
@@ -460,9 +460,9 @@ Public Class Blog
460460

461461
Case "allcomments"
462462

463-
Parameters.ReadValue("pagesize", _pageSize)
463+
_pageSize = Parameters.ReadValue("pagesize", _pageSize)
464464
Dim loadPosts As Boolean = False
465-
Parameters.ReadValue("loadposts", loadPosts)
465+
loadPosts = Parameters.ReadValue("loadposts", loadPosts)
466466
If _pageSize < 1 Then _pageSize = 10 ' we will not list "all Posts"
467467
For Each c As CommentInfo In CommentsController.GetCommentsByModule(BlogContext.BlogModuleId, UserId, _reqPage - 1, _pageSize, "CREATEDONDATE DESC", _totalRecords).Values
468468
If loadPosts Then
@@ -486,7 +486,7 @@ Public Class Blog
486486
Dim blogToShow As Integer = BlogContext.BlogId
487487
If DataSource.ToLower = "allauthors" Then blogToShow = -1
488488
Dim sort As String = ""
489-
Parameters.ReadValue("sort", sort)
489+
sort = Parameters.ReadValue("sort", sort)
490490
Select Case sort.ToLower
491491
Case "username"
492492
For Each u As PostAuthor In PostsController.GetAuthors(BlogContext.BlogModuleId, blogToShow).OrderBy(Function(t) t.Username)

Server/Blog/Components/Api/BlogRouteMapper.vb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ Namespace Api
1414
Public Const ServicePath As String = "~/DesktopModules/Blog/API/"
1515

1616
Public Sub RegisterRoutes(mapRouteManager As IMapRoute) Implements IServiceRouteMapper.RegisterRoutes
17-
mapRouteManager.MapHttpRoute("Blog", "Blogs", "Blogs/{action}", New With {.Controller = "Blogs"}, New String() {"DotNetNuke.Modules.Blog.Api"})
18-
mapRouteManager.MapHttpRoute("Blog", "Comments", "Comments/{action}", New With {.Controller = "Comments"}, New String() {"DotNetNuke.Modules.Blog.Api"})
19-
mapRouteManager.MapHttpRoute("Blog", "Posts", "Posts/{action}", New With {.Controller = "Posts"}, New String() {"DotNetNuke.Modules.Blog.Api"})
20-
mapRouteManager.MapHttpRoute("Blog", "Terms", "Terms/{action}", New With {.Controller = "Terms"}, New String() {"DotNetNuke.Modules.Blog.Api"})
21-
mapRouteManager.MapHttpRoute("Blog", "Other", "{controller}/{action}", New String() {"DotNetNuke.Modules.Blog.Services", "DotNetNuke.Modules.Blog.Api"})
17+
mapRouteManager.MapHttpRoute("Blog", "BlogApiControllers", "{controller}/{action}", New String() {"DotNetNuke.Modules.Blog.Api"})
2218
End Sub
2319

2420
Public Shared Function GetRoute(controller As ServiceControllers, method As String) As String

Server/Blog/Components/Api/CommentsController.vb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ Namespace Api
173173
Public Function ListComments() As HttpResponseMessage
174174
Dim BlogId As Integer = -1
175175
Dim PostId As Integer = -1
176-
HttpContext.Current.Request.Params.ReadValue("blogId", BlogId)
177-
HttpContext.Current.Request.Params.ReadValue("postId", PostId)
176+
BlogId = HttpContext.Current.Request.Params.ReadValue("blogId", BlogId)
177+
PostId = HttpContext.Current.Request.Params.ReadValue("postId", PostId)
178178
Blog = Core.Entities.Blogs.BlogsController.GetBlog(BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
179179
Post = Core.Entities.Posts.PostsController.GetPost(PostId, ActiveModule.ModuleID, "")
180180
If Blog Is Nothing Or Post Is Nothing Then
@@ -204,8 +204,8 @@ Namespace Api
204204

205205
Dim BlogId As Integer = -1
206206
Dim PostId As Integer = -1
207-
HttpContext.Current.Request.Params.ReadValue("blogId", BlogId)
208-
HttpContext.Current.Request.Params.ReadValue("postId", PostId)
207+
BlogId = HttpContext.Current.Request.Params.ReadValue("blogId", BlogId)
208+
PostId = HttpContext.Current.Request.Params.ReadValue("postId", PostId)
209209
Blog = Core.Entities.Blogs.BlogsController.GetBlog(BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
210210
If Not Blog.EnablePingBackReceive Then
211211
Return Request.CreateResponse(HttpStatusCode.NotFound, New With {.Result = "This blog does not accept pingbacks"})
@@ -263,8 +263,8 @@ Namespace Api
263263

264264
Dim BlogId As Integer = -1
265265
Dim PostId As Integer = -1
266-
HttpContext.Current.Request.Params.ReadValue("blogId", BlogId)
267-
HttpContext.Current.Request.Params.ReadValue("postId", PostId)
266+
BlogId = HttpContext.Current.Request.Params.ReadValue("blogId", BlogId)
267+
PostId = HttpContext.Current.Request.Params.ReadValue("postId", PostId)
268268
Blog = Core.Entities.Blogs.BlogsController.GetBlog(BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
269269
If Not Blog.EnableTrackBackReceive Then
270270
Return Request.CreateResponse(HttpStatusCode.NotFound, New With {.Result = "This blog does not accept trackbacks"})
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Imports DotNetNuke.Modules.Blog.Core.Services
3030
Imports DotNetNuke.Services.Social.Notifications
3131
Imports DotNetNuke.Web.Api
3232

33-
Namespace Integration.Services
33+
Namespace Api
3434

3535
Public Class NotificationServiceController
3636
Inherits DnnApiController
@@ -62,7 +62,7 @@ Namespace Integration.Services
6262
Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
6363
End If
6464
Post.Published = True
65-
PostsController.UpdatePost(Post, UserInfo.UserID)
65+
Core.Entities.Posts.PostsController.UpdatePost(Post, UserInfo.UserID)
6666
NotificationsController.Instance().DeleteNotification(postData.NotificationId)
6767
Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "success"})
6868
End Function
@@ -76,7 +76,7 @@ Namespace Integration.Services
7676
If Blog Is Nothing Or Post Is Nothing Then
7777
Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
7878
End If
79-
PostsController.DeletePost(ContentItemId)
79+
Core.Entities.Posts.PostsController.DeletePost(ContentItemId)
8080
NotificationsController.Instance().DeleteNotification(postData.NotificationId)
8181
Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "success"})
8282
End Function
@@ -90,7 +90,7 @@ Namespace Integration.Services
9090
If Blog Is Nothing Or Post Is Nothing Or Comment Is Nothing Then
9191
Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
9292
End If
93-
CommentsController.ApproveComment(BlogModuleId, BlogId, Comment)
93+
Core.Entities.Comments.CommentsController.ApproveComment(BlogModuleId, BlogId, Comment)
9494
NotificationsController.Instance().DeleteNotification(postData.NotificationId)
9595
Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "success"})
9696
End Function
@@ -104,7 +104,7 @@ Namespace Integration.Services
104104
If Blog Is Nothing Or Post Is Nothing Or Comment Is Nothing Then
105105
Return Request.CreateResponse(HttpStatusCode.BadRequest, New With {.Result = "error"})
106106
End If
107-
CommentsController.DeleteComment(BlogModuleId, BlogId, Comment)
107+
Core.Entities.Comments.CommentsController.DeleteComment(BlogModuleId, BlogId, Comment)
108108
NotificationsController.Instance().DeleteNotification(postData.NotificationId)
109109
Return Request.CreateResponse(HttpStatusCode.OK, New With {.Result = "success"})
110110
End Function
@@ -116,8 +116,8 @@ Namespace Integration.Services
116116
BlogModuleId = nKey.ModuleId
117117
BlogId = nKey.BlogId
118118
ContentItemId = nKey.ContentItemId
119-
Blog = BlogsController.GetBlog(BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
120-
Post = PostsController.GetPost(ContentItemId, BlogModuleId, Threading.Thread.CurrentThread.CurrentCulture.Name)
119+
Blog = Core.Entities.Blogs.BlogsController.GetBlog(BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
120+
Post = Core.Entities.Posts.PostsController.GetPost(ContentItemId, BlogModuleId, Threading.Thread.CurrentThread.CurrentCulture.Name)
121121
End Sub
122122

123123
Private Sub ParseCommentKey(key As String)
@@ -126,9 +126,9 @@ Namespace Integration.Services
126126
BlogId = nKey.BlogId
127127
ContentItemId = nKey.ContentItemId
128128
CommentId = nKey.CommentId
129-
Blog = BlogsController.GetBlog(BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
130-
Post = PostsController.GetPost(ContentItemId, BlogModuleId, Threading.Thread.CurrentThread.CurrentCulture.Name)
131-
Comment = CommentsController.GetComment(CommentId, UserInfo.UserID)
129+
Blog = Core.Entities.Blogs.BlogsController.GetBlog(BlogId, UserInfo.UserID, Threading.Thread.CurrentThread.CurrentCulture.Name)
130+
Post = Core.Entities.Posts.PostsController.GetPost(ContentItemId, BlogModuleId, Threading.Thread.CurrentThread.CurrentCulture.Name)
131+
Comment = Core.Entities.Comments.CommentsController.GetComment(CommentId, UserInfo.UserID)
132132
End Sub
133133
#End Region
134134

Server/Blog/Controls/CategorySelect.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Namespace Controls
6969
MainControlId = ClientID & "_CategorySelect"
7070
If Page.IsPostBack Then
7171
' read return values
72-
Page.Request.Params.ReadValue(Storage.ClientID, catList)
72+
catList = Page.Request.Params.ReadValue(Storage.ClientID, catList)
7373
catList = catList.Trim(","c)
7474
SelectedCategories = New List(Of TermInfo)
7575
If Not String.IsNullOrEmpty(catList) Then

Server/Blog/Controls/TagEdit.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Namespace Controls
5353
Terms = New List(Of TermInfo)
5454
Dim vocab As Dictionary(Of String, TermInfo) = Core.Entities.Terms.TermsController.GetTermsByVocabulary(ModuleConfiguration.ModuleID, VocabularyId, Threading.Thread.CurrentThread.CurrentCulture.Name)
5555
Dim tagList As String = ""
56-
Page.Request.Params.ReadValue(ClientID, tagList)
56+
tagList = Page.Request.Params.ReadValue(ClientID, tagList)
5757
If Not String.IsNullOrEmpty(tagList) Then
5858
For Each t As String In tagList.Split(","c)
5959
If vocab.ContainsKey(t) Then

Server/Blog/DotNetNuke.Modules.Blog.vbproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,12 @@
299299
<Compile Include="Components\Api\BlogRouteMapper.vb" />
300300
<Compile Include="Components\Api\BlogsController.vb" />
301301
<Compile Include="Components\Api\CommentsController.vb" />
302+
<Compile Include="Components\Api\NotificationServiceController.vb" />
302303
<Compile Include="Components\Api\PostsController.vb" />
303304
<Compile Include="Components\Api\TermsController.vb" />
304305
<Compile Include="Components\Common\Extensions.vb" />
305306
<Compile Include="Components\Common\Globals.vb" />
306307
<Compile Include="Components\Common\PostBodyAndSummary.vb" />
307-
<Compile Include="Components\Integration\Services\NotificationServiceController.vb" />
308308
<Compile Include="Controls\CategorySelect.vb" />
309309
<Compile Include="Controls\Comments.ascx.designer.vb">
310310
<DependentUpon>Comments.ascx</DependentUpon>

Server/Blog/TermsEditML.ascx.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Public Class TermsEditML
3434
Private Sub Page_Init1(sender As Object, e As EventArgs) Handles Me.Init
3535
AddJavascriptFile("jquery.handsontable.js", "jquery.handsontable", "0.8.17", 60)
3636
AddCssFile("jquery.handsontable.css", "jquery.handsontable", "0.8.17")
37-
Request.Params.ReadValue("VocabularyId", VocabularyId)
37+
VocabularyId = Request.Params.ReadValue("VocabularyId", VocabularyId)
3838
If VocabularyId <> Settings.VocabularyId AndAlso VocabularyId <> 1 Then ' prevent users from editing another vocabulary
3939
VocabularyId = 1
4040
End If

Server/Blog/blogpost.ashx.vb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,9 @@ Public Class BlogPost
562562
Private Sub InitializeMethodCall(username As String, password As String, requestedBlogId As String, requestedPostId As String)
563563
Try
564564
' Set up the context
565-
Context.Request.Params.ReadValue("TabId", TabId)
566-
Context.Request.Params.ReadValue("ModuleId", ModuleId)
567-
Context.Request.Params.ReadValue("Blog", BlogId)
565+
TabId = Context.Request.Params.ReadValue("TabId", TabId)
566+
ModuleId = Context.Request.Params.ReadValue("ModuleId", ModuleId)
567+
BlogId = Context.Request.Params.ReadValue("Blog", BlogId)
568568
GetPortalSettings()
569569
Settings = ModuleSettings.GetModuleSettings(ModuleId)
570570
If Not Settings.AllowWLW Then

0 commit comments

Comments
 (0)