Skip to content

Commit

Permalink
Changes by vmasanas
Browse files Browse the repository at this point in the history
  • Loading branch information
skamphuis committed Aug 10, 2018
1 parent 3117449 commit 20e5e79
Show file tree
Hide file tree
Showing 134 changed files with 19,678 additions and 1,809 deletions.
7 changes: 5 additions & 2 deletions App_LocalResources/UploadFiles.ascx.resx
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DeleteFile.Text" xml:space="preserve">
<value>Are you sure you want to remove this file?</value>
Expand Down Expand Up @@ -144,4 +144,7 @@
<data name="cmdAddExistingFile.Text" xml:space="preserve">
<value>Add Existing File</value>
</data>
<data name="Upload.Text" xml:space="preserve">
<value>Upload</value>
</data>
</root>
30 changes: 18 additions & 12 deletions Base/NewsArticleModuleBase.vb
Original file line number Diff line number Diff line change
Expand Up @@ -226,25 +226,31 @@ Namespace Ventrian.NewsArticles.Base
End If

End Function
Protected Function StripHtml(ByVal html As String) As String

Const pattern As String = "<(.|\n)*?>"
Return Regex.Replace(html, pattern, String.Empty)
Public Function StripHtml(ByVal html As String) As String

End Function
Return StripHtml(html, False)

End Function

Private Function RoundToUnit(ByVal d As Double, ByVal unit As Double, ByVal roundDown As Boolean) As Double
Public Function StripHtml(ByVal html As String, ByVal cleanLineBreaks As Boolean) As String

If (roundDown) Then
Return Math.Round(Math.Round((d / unit) - 0.5, 0) * unit, 2)
Else
Return Math.Round(Math.Round((d / unit) + 0.5, 0) * unit, 2)
End If
Dim pattern As String = "<(.|\n)*?>"
Return Regex.Replace(html, pattern, String.Empty).Replace(System.Environment.NewLine, " ")

End Function
End Function

Private Function RoundToUnit(ByVal d As Double, ByVal unit As Double, ByVal roundDown As Boolean) As Double

If (roundDown) Then
Return Math.Round(Math.Round((d / unit) - 0.5, 0) * unit, 2)
Else
Return Math.Round(Math.Round((d / unit) + 0.5, 0) * unit, 2)
End If

End Function

Protected Function GetRatingImage(ByVal objDataItem As Object) As String
Protected Function GetRatingImage(ByVal objDataItem As Object) As String

Dim objArticle As ArticleInfo = CType(objDataItem, ArticleInfo)

Expand Down
693 changes: 352 additions & 341 deletions Components/Layout/TokenProcessor.vb

Large diffs are not rendered by default.

108 changes: 14 additions & 94 deletions Controls/SWFUploaderFiles.ashx.vb
Original file line number Diff line number Diff line change
Expand Up @@ -165,105 +165,25 @@ Namespace Ventrian.NewsArticles.Controls

Dim objFilePosted As HttpPostedFile = _context.Request.Files("Filedata")

If Not (objFilePosted Is Nothing) Then
If Not (objFilePosted Is Nothing) Then

Dim objPortalController As New PortalController()
If (objPortalController.HasSpaceAvailable(_portalID, objFilePosted.ContentLength) = False) Then
_context.Response.Write("-1")
_context.Response.End()
End If
Dim objPortalController As New PortalController()
If (objPortalController.HasSpaceAvailable(_portalID, objFilePosted.ContentLength) = False) Then
_context.Response.Write("-1")
_context.Response.End()
End If

Dim username As String = _context.User.Identity.Name
Dim username As String = _context.User.Identity.Name

If (_articleID <> Null.NullInteger) Then
FileProvider.Instance().AddFile(_articleID, _moduleID, objFilePosted)
Else
FileProvider.Instance().AddFile(_fileGuid, _moduleID, objFilePosted)
End If
If (_articleID <> Null.NullInteger) Then
FileProvider.Instance().AddFile(_articleID, _moduleID, objFilePosted)
Else
FileProvider.Instance().AddFile(_fileGuid, _moduleID, objFilePosted)
End If

'Dim objFile As New FileInfo

'objFile.ArticleID = _articleID
'If (_articleID = Null.NullInteger) Then
' objFile.FileGuid = _fileGuid
'End If
'objFile.FileName = objFilePosted.FileName
'objFile.SortOrder = 0

'Dim filesList As List(Of FileInfo) = objFileController.GetFileList(_articleID, _fileGuid)

'If (filesList.Count > 0) Then
' objFile.SortOrder = CType(filesList(filesList.Count - 1), FileInfo).SortOrder + 1
'End If

'Dim objPortalSettings As PortalSettings = PortalController.GetCurrentPortalSettings()

'Dim folder As String = ""
'If (ArticleSettings.DefaultFilesFolder <> Null.NullInteger) Then
' Dim objFolderController As New FolderController
' Dim objFolder As FolderInfo = objFolderController.GetFolderInfo(_portalID, ArticleSettings.DefaultFilesFolder)
' If (objFolder IsNot Nothing) Then
' folder = objFolder.FolderPath
' End If
'End If

'objFile.Folder = folder
'objFile.ContentType = objFilePosted.ContentType

'If (objFile.FileName.Split("."c).Length > 0) Then
' objFile.Extension = objFile.FileName.Split("."c)(objFile.FileName.Split("."c).Length - 1)

' If (objFile.Extension.ToLower() = "jpg") Then
' objFile.ContentType = "image/jpeg"
' End If
' If (objFile.Extension.ToLower() = "gif") Then
' objFile.ContentType = "image/gif"
' End If
' If (objFile.Extension.ToLower() = "txt") Then
' objFile.ContentType = "text/plain"
' End If
' If (objFile.Extension.ToLower() = "html") Then
' objFile.ContentType = "text/html"
' End If
' If (objFile.Extension.ToLower() = "mp3") Then
' objFile.ContentType = "audio/mpeg"
' End If

'End If
'objFile.Title = objFile.FileName.Replace("." & objFile.Extension, "")

'Dim filePath As String = objPortalSettings.HomeDirectoryMapPath & folder.Replace("/", "\")

'If Not (Directory.Exists(filePath)) Then
' Directory.CreateDirectory(filePath)
'End If

'If (File.Exists(filePath & objFile.FileName)) Then
' For i As Integer = 1 To 100
' If (File.Exists(filePath & i.ToString() & "_" & objFile.FileName) = False) Then
' objFile.FileName = i.ToString() & "_" & objFile.FileName
' Exit For
' End If
' Next
'End If

'objFile.Size = objFilePosted.ContentLength
'objFilePosted.SaveAs(filePath & objFile.FileName)

'objFile.FileID = objFileController.Add(objFile)

'If (_articleID <> Null.NullInteger) Then
' Dim objArticleController As New ArticleController
' Dim objArticle As ArticleInfo = objArticleController.GetArticle(_articleID)
' If (objArticle IsNot Nothing) Then
' objArticle.FileCount = objArticle.FileCount + 1
' objArticleController.UpdateArticle(objArticle)
' End If
'End If

End If
End If

_context.Response.Write("0")
_context.Response.Write("0")
_context.Response.End()

End Sub
Expand Down
Loading

0 comments on commit 20e5e79

Please sign in to comment.