Fixes U4-1689 and U4-1719.

Refactoring UmbracoImageMediaFactory so it uses the extension method for uploading/setting images, so its a bit more DRY.
This commit is contained in:
Morten Christensen
2013-02-19 11:06:00 -01:00
parent 1af904435a
commit ec4b1c8f70
6 changed files with 80 additions and 180 deletions

View File

@@ -1,8 +1,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Umbraco.Core.CodeAnnotations;
using Umbraco.Core.Configuration;
namespace Umbraco.Core.IO
@@ -27,6 +25,15 @@ namespace Umbraco.Core.IO
return propertyId.ToString() + seperator + fileName;
}
public string GetRelativePath(string subfolder, string fileName)
{
var seperator = UmbracoSettings.UploadAllowDirectories
? Path.DirectorySeparatorChar
: '-';
return subfolder + seperator + fileName;
}
public IEnumerable<string> GetThumbnails(string path)
{
var parentDirectory = System.IO.Path.GetDirectoryName(path);