Skip to content

Commit

Permalink
More DNN9 incompatibilities fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
skamphuis committed Sep 4, 2018
1 parent 3f1f577 commit 0de32b4
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Components/CategoryController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Namespace Ventrian.NewsArticles
End If
Next

Return CType(CBO.FillObject(DataProvider.Instance().GetCategory(categoryID), GetType(CategoryInfo)), CategoryInfo)
Return CBO.FillObject(Of CategoryInfo)(DataProvider.Instance().GetCategory(categoryID))

End Function

Expand Down
5 changes: 3 additions & 2 deletions Components/ContentSharingInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

Imports System
Imports System.Data
Imports System.Linq

Imports DotNetNuke
Imports DotNetNuke.Common.Utilities
Expand Down Expand Up @@ -48,10 +49,10 @@ Namespace Ventrian.NewsArticles
_portalTitle = objPortal.PortalName

Dim o As New PortalAliasController
Dim portalAliases As ArrayList = o.GetPortalAliasArrayByPortalID(_linkedPortalID)
Dim portalAliases As IEnumerable(Of PortalAliasInfo) = PortalAliasController.Instance.GetPortalAliasesByPortalId(_linkedPortalID)

If (portalAliases.Count > 0) Then
_portalTitle = DotNetNuke.Common.AddHTTP(CType(portalAliases(0), PortalAliasInfo).HTTPAlias)
_portalTitle = DotNetNuke.Common.AddHTTP(portalAliases(0).HTTPAlias)
End If
End If

Expand Down
4 changes: 2 additions & 2 deletions Components/EmailTemplateController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ Namespace Ventrian.NewsArticles

Public Function [Get](ByVal templateID As Integer) As EmailTemplateInfo

Return CType(CBO.FillObject(DataProvider.Instance().GetEmailTemplate(templateID), GetType(EmailTemplateInfo)), EmailTemplateInfo)
Return CBO.FillObject(Of EmailTemplateInfo)(DataProvider.Instance().GetEmailTemplate(templateID))

End Function

Public Function [Get](ByVal moduleID As Integer, ByVal type As EmailTemplateType) As EmailTemplateInfo

Dim objEmailTemplate As EmailTemplateInfo = CType(CBO.FillObject(DataProvider.Instance().GetEmailTemplateByName(moduleID, type.ToString()), GetType(EmailTemplateInfo)), EmailTemplateInfo)
Dim objEmailTemplate As EmailTemplateInfo = CBO.FillObject(of EmailTemplateInfo)(DataProvider.Instance().GetEmailTemplateByName(moduleID, type.ToString()))

If (objEmailTemplate Is Nothing) Then

Expand Down
18 changes: 10 additions & 8 deletions Controls/UploadFiles.ascx.vb
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
Imports DotNetNuke.Common.Utilities
Imports System
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Security

Imports Ventrian.NewsArticles.Base
Imports DotNetNuke.Entities.Portals
Imports DotNetNuke.Security.Permissions
Imports DotNetNuke.Services.FileSystem

Namespace Ventrian.NewsArticles.Controls

Expand Down Expand Up @@ -91,18 +94,18 @@ Namespace Ventrian.NewsArticles.Controls

drpUploadFilesFolder.Items.Clear()

Dim folders As ArrayList = FileSystemUtils.GetFolders(ArticleModuleBase.PortalId)
Dim folders As List(Of IFolderInfo) = FolderManager.Instance.GetFolders(ArticleModuleBase.PortalId, False)
For Each folder As DotNetNuke.Services.FileSystem.FolderInfo In folders
If Not folder.IsProtected Then
Dim FolderItem As New ListItem()
If folder.FolderPath = Null.NullString Then
FolderItem.Text = ArticleModuleBase.GetSharedResource("Root")
ReadRoles = FileSystemUtils.GetRoles("", ArticleModuleBase.PortalId, "READ")
WriteRoles = FileSystemUtils.GetRoles("", ArticleModuleBase.PortalId, "WRITE")
ReadRoles = FolderPermissionController.GetFolderPermissionsCollectionByFolder(ArticleModuleBase.PortalId, "").ToString("READ")
WriteRoles = FolderPermissionController.GetFolderPermissionsCollectionByFolder(ArticleModuleBase.PortalId, "").ToString("WRITE")
Else
FolderItem.Text = folder.FolderPath
ReadRoles = FileSystemUtils.GetRoles(FolderItem.Text, ArticleModuleBase.PortalId, "READ")
WriteRoles = FileSystemUtils.GetRoles(FolderItem.Text, ArticleModuleBase.PortalId, "WRITE")
ReadRoles = FolderPermissionController.GetFolderPermissionsCollectionByFolder(ArticleModuleBase.PortalId, FolderItem.Text).ToString("READ")
WriteRoles = FolderPermissionController.GetFolderPermissionsCollectionByFolder(ArticleModuleBase.PortalId, FolderItem.Text).ToString("WRITE")
End If
FolderItem.Value = folder.FolderID

Expand Down Expand Up @@ -417,8 +420,7 @@ Namespace Ventrian.NewsArticles.Controls
If (ctlFile.Url.ToLower().StartsWith("fileid=")) Then
If (IsNumeric(ctlFile.Url.ToLower().Replace("fileid=", ""))) Then
Dim fileID As Integer = Convert.ToInt32(ctlFile.Url.ToLower().Replace("fileid=", ""))
Dim objDnnFileController As New DotNetNuke.Services.FileSystem.FileController
Dim objDnnFile As DotNetNuke.Services.FileSystem.FileInfo = objDnnFileController.GetFileById(fileID, ArticleModuleBase.PortalId)
Dim objDnnFile As DotNetNuke.Services.FileSystem.FileInfo = FileManager.Instance.GetFile(fileID, True)
If (objDnnFile IsNot Nothing) Then

Dim objFileController As New FileController
Expand Down
23 changes: 12 additions & 11 deletions Controls/UploadImages.ascx.vb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Imports System.IO
Imports System
Imports System.IO

Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Entities.Portals
Expand All @@ -10,6 +11,8 @@ Imports Ventrian.NewsArticles.Base
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Drawing.Imaging
Imports DotNetNuke.Security.Permissions
Imports DotNetNuke.Services.FileSystem

Namespace Ventrian.NewsArticles.Controls

Expand Down Expand Up @@ -91,18 +94,18 @@ Namespace Ventrian.NewsArticles.Controls

drpUploadImageFolder.Items.Clear()

Dim folders As ArrayList = FileSystemUtils.GetFolders(ArticleModuleBase.PortalId)
Dim folders As List(Of IFolderInfo) = FolderManager.Instance.GetFolders(ArticleModuleBase.PortalId, False)
For Each folder As DotNetNuke.Services.FileSystem.FolderInfo In folders
If Not folder.IsProtected Then
Dim FolderItem As New ListItem()
If folder.FolderPath = Null.NullString Then
FolderItem.Text = ArticleModuleBase.GetSharedResource("Root")
ReadRoles = FileSystemUtils.GetRoles("", ArticleModuleBase.PortalId, "READ")
WriteRoles = FileSystemUtils.GetRoles("", ArticleModuleBase.PortalId, "WRITE")
ReadRoles = FolderPermissionController.GetFolderPermissionsCollectionByFolder(ArticleModuleBase.PortalId, "").ToString("READ")
WriteRoles = FolderPermissionController.GetFolderPermissionsCollectionByFolder(ArticleModuleBase.PortalId, "").ToString("WRITE")
Else
FolderItem.Text = folder.FolderPath
ReadRoles = FileSystemUtils.GetRoles(FolderItem.Text, ArticleModuleBase.PortalId, "READ")
WriteRoles = FileSystemUtils.GetRoles(FolderItem.Text, ArticleModuleBase.PortalId, "WRITE")
ReadRoles = FolderPermissionController.GetFolderPermissionsCollectionByFolder(ArticleModuleBase.PortalId, FolderItem.Text).ToString("READ")
WriteRoles = FolderPermissionController.GetFolderPermissionsCollectionByFolder(ArticleModuleBase.PortalId, FolderItem.Text).ToString("WRITE")
End If
FolderItem.Value = folder.FolderID

Expand Down Expand Up @@ -523,8 +526,7 @@ Namespace Ventrian.NewsArticles.Controls
If (ctlImage.Url.ToLower().StartsWith("fileid=")) Then
If (IsNumeric(ctlImage.Url.ToLower().Replace("fileid=", ""))) Then
Dim fileID As Integer = Convert.ToInt32(ctlImage.Url.ToLower().Replace("fileid=", ""))
Dim objFileController As New DotNetNuke.Services.FileSystem.FileController
Dim objFile As DotNetNuke.Services.FileSystem.FileInfo = objFileController.GetFileById(fileID, ArticleModuleBase.PortalId)
Dim objFile As DotNetNuke.Services.FileSystem.FileInfo = FileManager.Instance.GetFile(fileID)
If (objFile IsNot Nothing) Then

Dim objImageController As New ImageController
Expand Down Expand Up @@ -616,14 +618,13 @@ Namespace Ventrian.NewsArticles.Controls
objImage.SortOrder = CType(imagesList(imagesList.Count - 1), ImageInfo).SortOrder + 1
End If

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

Dim folder As String = ""
Dim folderId As Integer = Integer.Parse(drpUploadImageFolder.SelectedValue)

If (folderId <> Null.NullInteger) Then
Dim objFolderController As New DotNetNuke.Services.FileSystem.FolderController
Dim objFolder As DotNetNuke.Services.FileSystem.FolderInfo = objFolderController.GetFolderInfo(ArticleModuleBase.PortalId, folderId)
Dim objFolder As DotNetNuke.Services.FileSystem.FolderInfo = FolderManager.Instance.GetFolder(folderId)
If (objFolder IsNot Nothing) Then
folder = objFolder.FolderPath
End If
Expand Down
Binary file modified Installs/NewsArticles.00.10.00.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion Ventrian.NewsArticles.vbproj.user
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<ProjectView>ShowAllFiles</ProjectView>
<UseIISExpress>false</UseIISExpress>
<Use64BitIISExpress />
Expand Down

0 comments on commit 0de32b4

Please sign in to comment.