Skip to content

Commit

Permalink
Solved all pre-DNN7 obsolete warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
skamphuis committed Aug 13, 2018
1 parent e1494fe commit b1bc838
Show file tree
Hide file tree
Showing 21 changed files with 508 additions and 511 deletions.
3 changes: 2 additions & 1 deletion Base/NewsArticleModuleBase.vb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Imports DotNetNuke.Common
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Security
Imports DotNetNuke.Security.Permissions
Imports DotNetNuke.Services.Localization

Namespace Ventrian.NewsArticles.Base
Expand Down Expand Up @@ -354,7 +355,7 @@ Namespace Ventrian.NewsArticles.Base

' Admin of Module
'
If (PortalSecurity.HasEditPermissions(objModule.ModulePermissions)) Then
If (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, "EDIT" , objModule)) Then

Return True

Expand Down
80 changes: 39 additions & 41 deletions Components/ArticleSettings.vb

Large diffs are not rendered by default.

35 changes: 17 additions & 18 deletions Components/Common.vb
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Namespace Ventrian.NewsArticles
If Host.UseFriendlyUrls Then

Dim strURL As String = ApplicationURL(objTab.TabID)
Dim settings As PortalSettings = PortalController.GetCurrentPortalSettings
Dim settings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings

If (articleSettings.LaunchLinks) Then
strURL = strURL & "&ctl=ArticleView"
Expand Down Expand Up @@ -331,7 +331,7 @@ Namespace Ventrian.NewsArticles
If HostController.Instance.GetString("UseFriendlyUrls") = "Y" Then

Dim strURL As String = ApplicationURL(objTab.TabID)
Dim settings As PortalSettings = PortalController.GetCurrentPortalSettings
Dim settings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings

If (articleSettings.LaunchLinks) Then
strURL = strURL & "&ctl=ArticleView"
Expand Down Expand Up @@ -487,14 +487,13 @@ Namespace Ventrian.NewsArticles

Dim objModulesFound As New List(Of ModuleInfo)

Dim objDesktopModuleController As New DesktopModuleController
Dim objDesktopModuleInfo As DesktopModuleInfo = objDesktopModuleController.GetDesktopModuleByModuleName("DnnForge - NewsArticles")
Dim objDesktopModuleInfo As DesktopModuleInfo = DesktopModuleController.GetDesktopModuleByModuleName("DnnForge - NewsArticles", portalID)

If Not (objDesktopModuleInfo Is Nothing) Then

Dim objTabController As New TabController()
Dim objTabs As ArrayList = objTabController.GetTabs(portalID)
For Each objTab As DotNetNuke.Entities.Tabs.TabInfo In objTabs
Dim objTabs As TabCollection = objTabController.GetTabsByPortal(portalID)
For Each objTab As DotNetNuke.Entities.Tabs.TabInfo In objTabs.Values
If Not (objTab Is Nothing) Then
If (objTab.IsDeleted = False) Then
Dim objModules As New ModuleController
Expand Down Expand Up @@ -530,10 +529,10 @@ Namespace Ventrian.NewsArticles

Public Shared Function GetAuthorLink(ByVal tabID As Integer, ByVal moduleID As Integer, ByVal authorID As Integer, ByVal username As String, ByVal launchLinks As Boolean, ByVal articleSettings As ArticleSettings) As String

Dim objTab As TabInfo = PortalController.GetCurrentPortalSettings.ActiveTab
If (tabID <> PortalController.GetCurrentPortalSettings.ActiveTab.TabID) Then
Dim objTab As TabInfo = PortalController.Instance.GetCurrentPortalSettings.ActiveTab
If (tabID <> PortalController.Instance.GetCurrentPortalSettings.ActiveTab.TabID) Then
Dim objTabController As New TabController
objTab = objTabController.GetTab(tabID, PortalController.GetCurrentPortalSettings.PortalId, False)
objTab = objTabController.GetTab(tabID, PortalController.Instance.GetCurrentPortalSettings.PortalId, False)
End If
Return GetAuthorLink(tabID, moduleID, authorID, username, launchLinks, objTab, articleSettings)

Expand All @@ -554,7 +553,7 @@ Namespace Ventrian.NewsArticles
strURL = strURL & "&authorID=" & authorID.ToString()

' TODO: Remove at a later date when minimum version raised.
If Localization.GetEnabledLocales.Count > 1 AndAlso LocalizationUtil.UseLanguageInUrl Then
If LocaleController.Instance.GetLocales(PortalSettings.Current.PortalId).Count > 1 AndAlso LocalizationUtil.UseLanguageInUrl Then
strURL += "&language=" & Thread.CurrentThread.CurrentCulture.Name
End If

Expand All @@ -574,7 +573,7 @@ Namespace Ventrian.NewsArticles
End If
End If

Return FriendlyUrl(targetTab, strURL, Common.FormatTitle("", articleSettings), PortalController.GetCurrentPortalSettings)
Return FriendlyUrl(targetTab, strURL, Common.FormatTitle("", articleSettings), PortalController.Instance.GetCurrentPortalSettings)

Else

Expand All @@ -586,21 +585,21 @@ Namespace Ventrian.NewsArticles

Public Shared Function GetCategoryLink(ByVal tabID As Integer, ByVal moduleID As Integer, ByVal categoryID As String, ByVal title As String, ByVal launchLinks As Boolean, ByVal articleSettings As ArticleSettings) As String

Dim objTab As TabInfo = PortalController.GetCurrentPortalSettings.ActiveTab
If (tabID <> PortalController.GetCurrentPortalSettings.ActiveTab.TabID) Then
Dim objTab As TabInfo = PortalController.Instance.GetCurrentPortalSettings.ActiveTab
If (tabID <> PortalController.Instance.GetCurrentPortalSettings.ActiveTab.TabID) Then
Dim objTabController As New TabController
objTab = objTabController.GetTab(tabID, PortalController.GetCurrentPortalSettings.PortalId, False)
objTab = objTabController.GetTab(tabID, PortalController.Instance.GetCurrentPortalSettings.PortalId, False)
End If
Return GetCategoryLink(tabID, moduleID, categoryID, title, launchLinks, objTab, articleSettings)

End Function

Public Shared Function GetCategoryLink(ByVal tabID As Integer, ByVal moduleID As Integer, ByVal categoryID As String, ByVal title As String, ByVal launchLinks As Boolean, ByVal targetTab As TabInfo, ByVal articleSettings As ArticleSettings) As String

If DotNetNuke.Entities.Host.HostSettings.GetHostSetting("UseFriendlyUrls") = "Y" Then

If Host.UseFriendlyUrls Then
Dim strURL As String = ApplicationURL(tabID)
Dim settings As PortalSettings = PortalController.GetCurrentPortalSettings
Dim settings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings

If (launchLinks) Then
strURL = strURL & "&ctl=CategoryView"
Expand All @@ -611,7 +610,7 @@ Namespace Ventrian.NewsArticles
strURL = strURL & "&categoryId=" & categoryID

' TODO: Remove at a later date when minimum version raised.
If Localization.GetEnabledLocales.Count > 1 AndAlso LocalizationUtil.UseLanguageInUrl Then
If LocaleController.Instance.GetLocales(settings.PortalId).Count > 1 AndAlso LocalizationUtil.UseLanguageInUrl Then
strURL += "&language=" & Thread.CurrentThread.CurrentCulture.Name
End If

Expand Down
20 changes: 10 additions & 10 deletions Components/EmailTemplateController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Namespace Ventrian.NewsArticles
formatted = formatted.Replace("[EMAIL]", objArticle.AuthorEmail)
formatted = formatted.Replace("[DISPLAYNAME]", objArticle.AuthorDisplayName)

Dim settings As PortalSettings = PortalController.GetCurrentPortalSettings()
Dim settings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings()

formatted = formatted.Replace("[PORTALNAME]", settings.PortalName)
formatted = formatted.Replace("[CREATEDATE]", objArticle.CreatedDate.ToString("d") & " " & objArticle.CreatedDate.ToString("t"))
Expand Down Expand Up @@ -67,7 +67,7 @@ Namespace Ventrian.NewsArticles
formatted = formatted.Replace("[DISPLAYNAME]", objComment.AuthorDisplayName)
End If

Dim settings As PortalSettings = PortalController.GetCurrentPortalSettings()
Dim settings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings()

formatted = formatted.Replace("[PORTALNAME]", settings.PortalName)
formatted = formatted.Replace("[POSTDATE]", DateTime.Now.ToShortDateString & " " & DateTime.Now.ToShortTimeString)
Expand Down Expand Up @@ -99,8 +99,8 @@ Namespace Ventrian.NewsArticles
Dim objRole As RoleInfo = objRoleController.GetRoleByName(settings.PortalId, role)

If Not (objRole Is Nothing) Then
Dim objUsers As ArrayList = objRoleController.GetUserRolesByRoleName(settings.PortalId, objRole.RoleName)
For Each objUser As UserRoleInfo In objUsers
Dim lstUsers As List(Of UserInfo) = RoleController.Instance.GetUsersByRole(settings.PortalId, objRole.RoleName)
For Each objUser As UserInfo In lstUsers
If (userList.Contains(objUser.UserID) = False) Then
Dim objUserController As UserController = New UserController
Dim objSelectedUser As UserInfo = objUserController.GetUser(settings.PortalId, objUser.UserID)
Expand Down Expand Up @@ -250,7 +250,7 @@ Namespace Ventrian.NewsArticles

Public Sub SendFormattedEmail(ByVal moduleID As Integer, ByVal link As String, ByVal objArticle As ArticleInfo, ByVal type As EmailTemplateType, ByVal sendTo As String, ByVal articleSettings As ArticleSettings)

Dim settings As PortalSettings = PortalController.GetCurrentPortalSettings()
Dim settings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings()

Dim subject As String = ""
Dim template As String = ""
Expand Down Expand Up @@ -296,7 +296,7 @@ Namespace Ventrian.NewsArticles

Public Sub SendFormattedEmail(ByVal moduleID As Integer, ByVal link As String, ByVal objArticle As ArticleInfo, ByVal objComment As CommentInfo, ByVal type As EmailTemplateType, ByVal articleSettings As ArticleSettings)

Dim settings As PortalSettings = PortalController.GetCurrentPortalSettings()
Dim settings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings()

Dim sendTo As String = ""

Expand All @@ -308,7 +308,7 @@ Namespace Ventrian.NewsArticles
Dim objUser As UserInfo = objUserController.GetUser(settings.PortalId, objArticle.AuthorID)

If Not (objUser Is Nothing) Then
sendTo = objUser.Membership.Email
sendTo = objUser.Email
SendFormattedEmail(moduleID, link, objArticle, objComment, EmailTemplateType.CommentNotification, articleSettings, sendTo)
End If

Expand All @@ -321,7 +321,7 @@ Namespace Ventrian.NewsArticles
Dim objUser As UserInfo = objUserController.GetUser(settings.PortalId, objComment.UserID)

If Not (objUser Is Nothing) Then
sendTo = objUser.Membership.Email
sendTo = objUser.Email
SendFormattedEmail(moduleID, link, objArticle, objComment, EmailTemplateType.CommentApproved, articleSettings, sendTo)
End If
Else
Expand All @@ -336,7 +336,7 @@ Namespace Ventrian.NewsArticles
Dim objUser As UserInfo = objUserController.GetUser(settings.PortalId, objArticle.AuthorID)

If Not (objUser Is Nothing) Then
sendTo = objUser.Membership.Email
sendTo = objUser.Email
SendFormattedEmail(moduleID, link, objArticle, objComment, EmailTemplateType.CommentRequiringApproval, articleSettings, sendTo)
End If

Expand All @@ -351,7 +351,7 @@ Namespace Ventrian.NewsArticles

Public Sub SendFormattedEmail(ByVal moduleID As Integer, ByVal link As String, ByVal objArticle As ArticleInfo, ByVal objComment As CommentInfo, ByVal type As EmailTemplateType, ByVal articleSettings As ArticleSettings, ByVal email As String)

Dim settings As PortalSettings = PortalController.GetCurrentPortalSettings()
Dim settings As PortalSettings = PortalController.Instance.GetCurrentPortalSettings()

Dim subject As String = ""
Dim template As String = ""
Expand Down
3 changes: 2 additions & 1 deletion Components/Layout/LatestLayoutController.vb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Imports System.IO

Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Services.Cache

Namespace Ventrian.NewsArticles

Expand Down Expand Up @@ -129,7 +130,7 @@ Namespace Ventrian.NewsArticles
objLayout.Template = File.ReadAllText(filePath)
objLayout.Tokens = objLayout.Template.Split(delimiter)

DataCache.SetCache(cacheKey, objLayout, New CacheDependency(filePath))
DataCache.SetCache(cacheKey, objLayout, New DNNCacheDependency(filePath))

End If

Expand Down
12 changes: 6 additions & 6 deletions Components/Layout/LayoutController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Imports Ventrian.NewsArticles.Base
Imports DotNetNuke.Web.Client.ClientResourceManagement
Imports DotNetNuke.Web.Client
Imports DotNetNuke.Services.Cache
Imports DotNetNuke.Services.FileSystem

Namespace Ventrian.NewsArticles

Expand Down Expand Up @@ -134,7 +135,7 @@ Namespace Ventrian.NewsArticles

Private ReadOnly Property UserId() As Integer
Get
Return UserController.GetCurrentUserInfo().UserID
Return UserController.Instance.GetCurrentUserInfo().UserID
End Get
End Property

Expand Down Expand Up @@ -321,8 +322,7 @@ Namespace Ventrian.NewsArticles
Return imageUrl
Else
If (imageUrl.ToLower().StartsWith("fileid=")) Then
Dim objFileController As DotNetNuke.Services.FileSystem.FileController = New DotNetNuke.Services.FileSystem.FileController
Dim objFile As DotNetNuke.Services.FileSystem.FileInfo = objFileController.GetFileById(Convert.ToInt32(UrlUtils.GetParameterValue(imageUrl)), PortalSettings.PortalId)
Dim objFile As DotNetNuke.Services.FileSystem.FileInfo = FileManager.Instance.GetFile(Convert.ToInt32(UrlUtils.GetParameterValue(imageUrl)))
If Not (objFile Is Nothing) Then
If (objFile.StorageLocation = 1) Then
' Secure Url
Expand Down Expand Up @@ -1773,7 +1773,7 @@ Namespace Ventrian.NewsArticles
Dim isAuthor As Boolean = False

If (Request.IsAuthenticated) Then
Dim objUser As UserInfo = UserController.GetCurrentUserInfo()
Dim objUser As UserInfo = UserController.Instance.GetCurrentUserInfo()
If (objUser IsNot Nothing) Then
If (objUser.UserID = objArticle.AuthorID) Then
isAuthor = True
Expand Down Expand Up @@ -2799,7 +2799,7 @@ Namespace Ventrian.NewsArticles
Dim objLiteral As New Literal
objLiteral.Text = profilePropertyValue
Dim objListController As New ListController
Dim objListEntryInfoCollection As ListEntryInfoCollection = objListController.GetListEntryInfoCollection(profilePropertyName)
Dim objListEntryInfoCollection As IEnumerable(Of ListEntryInfo) = objListController.GetListEntryInfoItems(profilePropertyName)
For Each objListEntryInfo As ListEntryInfo In objListEntryInfoCollection
If objListEntryInfo.Value = profilePropertyValue Then
objLiteral.Text = objListEntryInfo.Text
Expand Down Expand Up @@ -4357,7 +4357,7 @@ Namespace Ventrian.NewsArticles
Dim objLiteral As New Literal
objLiteral.Text = profilePropertyValue
Dim objListController As New ListController
Dim objListEntryInfoCollection As ListEntryInfoCollection = objListController.GetListEntryInfoCollection(profilePropertyName)
Dim objListEntryInfoCollection As IEnumerable(Of ListEntryInfo) = objListController.GetListEntryInfoItems(profilePropertyName)
For Each objListEntryInfo As ListEntryInfo In objListEntryInfoCollection
If objListEntryInfo.Value = profilePropertyValue Then
objLiteral.Text = objListEntryInfo.Text
Expand Down
2 changes: 1 addition & 1 deletion Components/Layout/TokenProcessor.vb
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ Namespace Ventrian.NewsArticles
If (moduleContext.ArticleSettings.AuthorUsernameParam <> "") Then
If (HttpContext.Current.Request(moduleContext.ArticleSettings.AuthorUsernameParam) <> "") Then
Try
Dim objUser As Entities.Users.UserInfo = Entities.Users.UserController.GetUserByName(PortalController.GetCurrentPortalSettings().PortalId, HttpContext.Current.Request.QueryString(moduleContext.ArticleSettings.AuthorUsernameParam))
Dim objUser As Entities.Users.UserInfo = Entities.Users.UserController.GetUserByName(PortalController.Instance.GetCurrentPortalSettings().PortalId, HttpContext.Current.Request.QueryString(moduleContext.ArticleSettings.AuthorUsernameParam))
If (objUser IsNot Nothing) Then
authorIDParam = "&amp;AuthorID=" & objUser.UserID.ToString()
End If
Expand Down
5 changes: 3 additions & 2 deletions Components/TemplateController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Imports System.Xml

Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Entities.Portals
Imports DotNetNuke.Services.Cache

Namespace Ventrian.NewsArticles

Expand Down Expand Up @@ -64,8 +65,8 @@ Namespace Ventrian.NewsArticles

objTemplate.Tokens = objTemplate.Template.Split(delimiter)

DataCache.SetCache(cacheKey, objTemplate, New CacheDependency(path))
DataCache.SetCache(cacheKeyXml, objTemplate, New CacheDependency(pathXml))
DataCache.SetCache(cacheKey, objTemplate, New DNNCacheDependency(path))
DataCache.SetCache(cacheKeyXml, objTemplate, New DNNCacheDependency(pathXml))
End If

Return objTemplate
Expand Down
Loading

0 comments on commit b1bc838

Please sign in to comment.