-
Notifications
You must be signed in to change notification settings - Fork 24
/
NewsArticles.ascx.vb
executable file
·191 lines (128 loc) · 6.49 KB
/
NewsArticles.ascx.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
'
' News Articles for DotNetNuke - http://www.dotnetnuke.com
' Copyright (c) 2005-2012
' by Ventrian ( [email protected] ) ( http://www.ventrian.com )
'
Imports Ventrian.NewsArticles.Components.Common
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Framework
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Web.Client
Imports DotNetNuke.Web.Client.ClientResourceManagement
Imports Ventrian.NewsArticles.Base
Namespace Ventrian.NewsArticles
Partial Public Class NewsArticles
Inherits NewsArticleModuleBase
#Region " Private Members "
Private m_controlToLoad As String
#End Region
#Region " Private Methods "
Private Sub ReadQueryString()
If Not (Request("articleType") Is Nothing) Then
' Load the appropriate Control
'
Select Case Request("articleType").ToLower()
Case "archives"
m_controlToLoad = "Archives.ascx"
Case "approvearticles"
m_controlToLoad = "ucApproveArticles.ascx"
Case "approvecomments"
m_controlToLoad = "ucApproveComments.ascx"
Case "articleview"
m_controlToLoad = "ViewArticle.ascx"
Case "archiveview"
m_controlToLoad = "ViewArchive.ascx"
Case "authorview"
m_controlToLoad = "ViewAuthor.ascx"
Case "categories"
Response.Status = "301 Moved Permanently"
Response.AddHeader("Location", Common.GetModuleLink(Me.TabId, Me.ModuleId, "Archives", ArticleSettings))
Response.End()
Case "categoryview"
m_controlToLoad = "ViewCategory.ascx"
Case "editcomment"
m_controlToLoad = "ucEditComment.ascx"
Case "editpage"
m_controlToLoad = "ucEditPage.ascx"
Case "editpages"
m_controlToLoad = "ucEditPages.ascx"
Case "editsortorder"
m_controlToLoad = "ucEditPageSortOrder.ascx"
Case "myarticles"
m_controlToLoad = "ucMyArticles.ascx"
Case "notauthenticated"
m_controlToLoad = "ucNotAuthenticated.ascx"
Case "notauthorized"
m_controlToLoad = "ucNotAuthorized.ascx"
Case "search"
m_controlToLoad = "ViewSearch.ascx"
Case "submitnews"
m_controlToLoad = "ucSubmitNews.ascx"
Case "submitnewscomplete"
m_controlToLoad = "ucSubmitNewsComplete.ascx"
Case "syndication"
Response.Status = "301 Moved Permanently"
Response.AddHeader("Location", Common.GetModuleLink(Me.TabId, Me.ModuleId, "Archives", ArticleSettings))
Response.End()
Case "tagview"
m_controlToLoad = "ViewTag.ascx"
Case Else
m_controlToLoad = "ViewCurrent.ascx"
End Select
Else
' Type parameter not found
'
If (ArticleSettings.FilterSingleCategory <> Null.NullInteger) Then
m_controlToLoad = "ViewCategory.ascx"
Else
If (ArticleSettings.UrlModeType = Components.Types.UrlModeType.Classic) Then
m_controlToLoad = "ViewCurrent.ascx"
Else
If (Request(ArticleSettings.ShortenedID) <> "") Then
m_controlToLoad = "ViewArticle.ascx"
Else
m_controlToLoad = "ViewCurrent.ascx"
End If
End If
End If
End If
End Sub
Private Sub LoadControlType()
If (m_controlToLoad <> "") Then
Dim objPortalModuleBase As PortalModuleBase = CType(Me.LoadControl(m_controlToLoad), PortalModuleBase)
If Not (objPortalModuleBase Is Nothing) Then
objPortalModuleBase.ModuleConfiguration = Me.ModuleConfiguration
objPortalModuleBase.ID = System.IO.Path.GetFileNameWithoutExtension(m_controlToLoad)
plhControls.Controls.Add(objPortalModuleBase)
End If
End If
End Sub
#End Region
#Region " Event Handlers "
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
Try
ReadQueryString()
LoadControlType()
Dim litLinkLiveWriter As New Literal
litLinkLiveWriter.Text = "" & vbCrLf _
& "<link rel=""wlwmanifest"" type=""application/wlwmanifest+xml"" title=""windows livewriter manifest"" href=""" & ArticleUtilities.ToAbsoluteUrl("~/desktopmodules/dnnforge%20-%20newsarticles/api/metaweblog/wlwmanifest.xml") & """ />" & vbCrLf
Page.Header.Controls.Add(litLinkLiveWriter)
Dim litLinkRsd As New Literal
litLinkRsd.Text = "" & vbCrLf _
& "<link type=""application/rsd+xml"" rel=""EditURI"" title=""RSD"" href=""" & ArticleUtilities.ToAbsoluteUrl("~/desktopmodules/dnnforge%20-%20newsarticles/api/rsd.ashx") & "?id=" & TabModuleId & "&url=" & (DotNetNuke.Common.Globals.NavigateURL(TabId)) & """ />" & vbCrLf
Page.Header.Controls.Add(litLinkRsd)
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Private Sub Page_PreRender(ByVal sender As System.Object, ByVal e As EventArgs) Handles MyBase.PreRender
Try
'jQuery.RegisterJQuery(Page)
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
#End Region
End Class
End Namespace