diff --git a/Components/CategoryController.vb b/Components/CategoryController.vb index d547203..3108d40 100755 --- a/Components/CategoryController.vb +++ b/Components/CategoryController.vb @@ -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 diff --git a/Components/ContentSharingInfo.vb b/Components/ContentSharingInfo.vb index bf55364..f550efe 100755 --- a/Components/ContentSharingInfo.vb +++ b/Components/ContentSharingInfo.vb @@ -6,6 +6,7 @@ Imports System Imports System.Data +Imports System.Linq Imports DotNetNuke Imports DotNetNuke.Common.Utilities @@ -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 diff --git a/Components/EmailTemplateController.vb b/Components/EmailTemplateController.vb index c809311..86023bf 100755 --- a/Components/EmailTemplateController.vb +++ b/Components/EmailTemplateController.vb @@ -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 diff --git a/Controls/UploadFiles.ascx.vb b/Controls/UploadFiles.ascx.vb index 139502e..6b55bc5 100755 --- a/Controls/UploadFiles.ascx.vb +++ b/Controls/UploadFiles.ascx.vb @@ -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 @@ -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 @@ -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 diff --git a/Controls/UploadImages.ascx.vb b/Controls/UploadImages.ascx.vb index 0ac582a..99f5b03 100755 --- a/Controls/UploadImages.ascx.vb +++ b/Controls/UploadImages.ascx.vb @@ -1,4 +1,5 @@ -Imports System.IO +Imports System +Imports System.IO Imports DotNetNuke.Common.Utilities Imports DotNetNuke.Entities.Portals @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/Installs/NewsArticles.00.10.00.zip b/Installs/NewsArticles.00.10.00.zip index a4d53f2..e7fe72c 100644 Binary files a/Installs/NewsArticles.00.10.00.zip and b/Installs/NewsArticles.00.10.00.zip differ diff --git a/Ventrian.NewsArticles.vbproj.user b/Ventrian.NewsArticles.vbproj.user index a036481..a8021c9 100755 --- a/Ventrian.NewsArticles.vbproj.user +++ b/Ventrian.NewsArticles.vbproj.user @@ -1,7 +1,7 @@  - Release|Any CPU + Debug|Any CPU ShowAllFiles false