diff --git a/AzurePackage.proj b/AzurePackage.proj index 696168b1e..5ae8072d0 100644 --- a/AzurePackage.proj +++ b/AzurePackage.proj @@ -48,7 +48,8 @@ + Properties="Configuration=Release;OutputPath=$(CompileFolder);PlatformTarget=x64;DefineConstants=AZURE" + /> ListFiles(string path) { + path = path ?? String.Empty; + EnsurePathIsRelative(path); string prefix = String.Concat(Container.Name, "/", _root, path); + if ( !prefix.EndsWith("/") ) prefix += "/"; - using ( new HttpContextWeaver() ) - { - foreach (var blobItem in BlobClient.ListBlobsWithPrefix(prefix).OfType()) - { - yield return new AzureBlobFileStorage(blobItem); + + using ( new HttpContextWeaver() ) { + foreach (var blobItem in BlobClient.ListBlobsWithPrefix(prefix).OfType()) { + // ignore directory entries + if(blobItem.Uri.AbsoluteUri.EndsWith(FolderEntry)) + continue; + + yield return new AzureBlobFileStorage(blobItem, _absoluteRoot); } } } public IEnumerable ListFolders(string path) { + path = path ?? String.Empty; + EnsurePathIsRelative(path); - path = String.Concat(_root, path); - using ( new HttpContextWeaver() ) - { - if (!Container.DirectoryExists(path)) - { - try - { - CreateFolder(path); + using ( new HttpContextWeaver() ) { + if ( !Container.DirectoryExists(String.Concat(_root, path)) ) { + try { + CreateFolder(String.Concat(_root, path)); } - catch (Exception ex) - { + catch ( Exception ex ) { throw new ArgumentException(string.Format("The folder could not be created at path: {0}. {1}", path, ex)); } } - return Container.GetDirectoryReference(path) + return Container.GetDirectoryReference(String.Concat(_root, path)) .ListBlobs() .OfType() - .Select(d => new AzureBlobFolderStorage(d)) + .Select(d => new AzureBlobFolderStorage(d, _absoluteRoot)) .ToList(); } } @@ -113,23 +117,20 @@ namespace Orchard.Azure { public void CreateFolder(string path) { EnsurePathIsRelative(path); - path = String.Concat(_root, path); - using (new HttpContextWeaver()) - { - Container.EnsureDirectoryDoesNotExist(path); - Container.GetDirectoryReference(path); + using (new HttpContextWeaver()) { + Container.EnsureDirectoryDoesNotExist(String.Concat(_root, path)); + + // Creating a virtually hidden file to make the directory an existing concept + CreateFile(path + "/" + FolderEntry); } } public void DeleteFolder(string path) { EnsurePathIsRelative(path); - path = String.Concat(_root, path); - using ( new HttpContextWeaver() ) - { - Container.EnsureDirectoryExists(path); - foreach (var blob in Container.GetDirectoryReference(path).ListBlobs()) - { + using ( new HttpContextWeaver() ) { + Container.EnsureDirectoryExists(String.Concat(_root, path)); + foreach ( var blob in Container.GetDirectoryReference(String.Concat(_root, path)).ListBlobs() ) { if (blob is CloudBlob) ((CloudBlob) blob).Delete(); @@ -141,7 +142,6 @@ namespace Orchard.Azure { public void RenameFolder(string path, string newPath) { EnsurePathIsRelative(path); - EnsurePathIsRelative(newPath); if ( !path.EndsWith("/") ) @@ -149,20 +149,16 @@ namespace Orchard.Azure { if ( !newPath.EndsWith("/") ) newPath += "/"; - using ( new HttpContextWeaver() ) - { - foreach (var blob in Container.GetDirectoryReference(_root + path).ListBlobs()) - { - if (blob is CloudBlob) - { + using ( new HttpContextWeaver() ) { + foreach (var blob in Container.GetDirectoryReference(_root + path).ListBlobs()) { + if (blob is CloudBlob) { string filename = Path.GetFileName(blob.Uri.ToString()); string source = String.Concat(path, filename); string destination = String.Concat(newPath, filename); RenameFile(source, destination); } - if (blob is CloudBlobDirectory) - { + if (blob is CloudBlobDirectory) { string foldername = blob.Uri.Segments.Last(); string source = String.Concat(path, foldername); string destination = String.Concat(newPath, foldername); @@ -174,29 +170,24 @@ namespace Orchard.Azure { public void DeleteFile(string path) { EnsurePathIsRelative(path); - path = String.Concat(_root, path); - - using ( new HttpContextWeaver() ) - { + + using ( new HttpContextWeaver() ) { Container.EnsureBlobExists(path); - var blob = Container.GetBlockBlobReference(path); + var blob = Container.GetBlockBlobReference(String.Concat(_root, path)); blob.Delete(); } } public void RenameFile(string path, string newPath) { EnsurePathIsRelative(path); - path = String.Concat(_root, path); - EnsurePathIsRelative(newPath); - newPath = String.Concat(_root, newPath); - using ( new HttpContextWeaver() ) - { - Container.EnsureBlobExists(path); - Container.EnsureBlobDoesNotExist(newPath); - var blob = Container.GetBlockBlobReference(path); - var newBlob = Container.GetBlockBlobReference(newPath); + using ( new HttpContextWeaver() ) { + Container.EnsureBlobExists(String.Concat(_root, path)); + Container.EnsureBlobDoesNotExist(String.Concat(_root, newPath)); + + var blob = Container.GetBlockBlobReference(String.Concat(_root, path)); + var newBlob = Container.GetBlockBlobReference(String.Concat(_root, newPath)); newBlob.CopyFromBlob(blob); blob.Delete(); } @@ -204,36 +195,36 @@ namespace Orchard.Azure { public IStorageFile CreateFile(string path) { EnsurePathIsRelative(path); - path = String.Concat(_root, path); - if ( Container.BlobExists(path) ) { + if ( Container.BlobExists(String.Concat(_root, path)) ) { throw new ArgumentException("File " + path + " already exists"); } - var blob = Container.GetBlockBlobReference(path); + var blob = Container.GetBlockBlobReference(String.Concat(_root, path)); blob.OpenWrite().Dispose(); // force file creation - return new AzureBlobFileStorage(blob); + return new AzureBlobFileStorage(blob, _absoluteRoot); } public string GetPublicUrl(string path) { EnsurePathIsRelative(path); - path = String.Concat(_root, path); - using ( new HttpContextWeaver() ) - { - Container.EnsureBlobExists(path); - return Container.GetBlockBlobReference(path).Uri.ToString(); + + using ( new HttpContextWeaver() ) { + Container.EnsureBlobExists(String.Concat(_root, path)); + return Container.GetBlockBlobReference(String.Concat(_root, path)).Uri.ToString(); } } private class AzureBlobFileStorage : IStorageFile { private readonly CloudBlockBlob _blob; + private readonly string _rootPath; - public AzureBlobFileStorage(CloudBlockBlob blob) { + public AzureBlobFileStorage(CloudBlockBlob blob, string rootPath) { _blob = blob; + _rootPath = rootPath; } public string GetPath() { - return _blob.Uri.ToString(); + return _blob.Uri.ToString().Substring(_rootPath.Length+1); } public string GetName() { @@ -264,17 +255,19 @@ namespace Orchard.Azure { private class AzureBlobFolderStorage : IStorageFolder { private readonly CloudBlobDirectory _blob; + private readonly string _rootPath; - public AzureBlobFolderStorage(CloudBlobDirectory blob) { + public AzureBlobFolderStorage(CloudBlobDirectory blob, string rootPath) { _blob = blob; + _rootPath = rootPath; } public string GetName() { - return Path.GetDirectoryName(_blob.Uri.ToString()); + return Path.GetDirectoryName(GetPath() + "/"); } public string GetPath() { - return _blob.Uri.ToString(); + return _blob.Uri.ToString().Substring(_rootPath.Length + 1).TrimEnd('/'); } public long GetSize() { @@ -287,7 +280,7 @@ namespace Orchard.Azure { public IStorageFolder GetParent() { if ( _blob.Parent != null ) { - return new AzureBlobFolderStorage(_blob.Parent); + return new AzureBlobFolderStorage(_blob.Parent, _rootPath); } throw new ArgumentException("Directory " + _blob.Uri + " does not have a parent directory"); } diff --git a/src/Orchard.Azure/Orchard.Azure.Web/WebRole.cs b/src/Orchard.Azure/Orchard.Azure.Web/WebRole.cs index 832917606..ad0306387 100644 --- a/src/Orchard.Azure/Orchard.Azure.Web/WebRole.cs +++ b/src/Orchard.Azure/Orchard.Azure.Web/WebRole.cs @@ -8,6 +8,11 @@ namespace Orchard.Azure.Web { public override bool OnStart() { DiagnosticMonitor.Start("DiagnosticsConnectionString"); + CloudStorageAccount.SetConfigurationSettingPublisher( + (configName, configSetter) => + configSetter(RoleEnvironment.GetConfigurationSettingValue(configName)) + ); + // For information on handling configuration changes // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357. RoleEnvironment.Changing += RoleEnvironmentChanging; diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config b/src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config index f2f307586..dd900f1a0 100644 --- a/src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config +++ b/src/Orchard.Specs/Hosting/Orchard.Web/Themes/Web.config @@ -2,9 +2,6 @@ - - - + + + diff --git a/src/Orchard.Web/Core/Contents/Views/Content.PublishButton.cshtml b/src/Orchard.Web/Core/Contents/Views/Content.PublishButton.cshtml new file mode 100644 index 000000000..b8f48a08f --- /dev/null +++ b/src/Orchard.Web/Core/Contents/Views/Content.PublishButton.cshtml @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Content.SaveButton.cshtml b/src/Orchard.Web/Core/Contents/Views/Content.SaveButton.cshtml new file mode 100644 index 000000000..cab18005a --- /dev/null +++ b/src/Orchard.Web/Core/Contents/Views/Content.SaveButton.cshtml @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Items/Content.Edit.cshtml b/src/Orchard.Web/Core/Contents/Views/Items/Content.Edit.cshtml index e0f0cd87b..af834ed7e 100644 --- a/src/Orchard.Web/Core/Contents/Views/Items/Content.Edit.cshtml +++ b/src/Orchard.Web/Core/Contents/Views/Items/Content.Edit.cshtml @@ -4,9 +4,5 @@
@Display(Model.Sidebar) - @* todo: (heskew) remove when the CommonPart is adding the save button *@ -
- -
\ No newline at end of file diff --git a/src/Orchard.Web/Core/Contents/Views/Web.config b/src/Orchard.Web/Core/Contents/Views/Web.config index 5c6614a80..37513c05c 100644 --- a/src/Orchard.Web/Core/Contents/Views/Web.config +++ b/src/Orchard.Web/Core/Contents/Views/Web.config @@ -2,8 +2,6 @@ - - + diff --git a/src/Orchard.Web/Core/Localization/Styles/Web.config b/src/Orchard.Web/Core/Localization/Styles/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Core/Localization/Styles/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Localization/Views/Web.config b/src/Orchard.Web/Core/Localization/Views/Web.config index 5c6614a80..37513c05c 100644 --- a/src/Orchard.Web/Core/Localization/Views/Web.config +++ b/src/Orchard.Web/Core/Localization/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Routable/Views/Web.config b/src/Orchard.Web/Core/Routable/Views/Web.config index 5c6614a80..37513c05c 100644 --- a/src/Orchard.Web/Core/Routable/Views/Web.config +++ b/src/Orchard.Web/Core/Routable/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Settings/Views/Web.config b/src/Orchard.Web/Core/Settings/Views/Web.config index bf2230060..dd900f1a0 100644 --- a/src/Orchard.Web/Core/Settings/Views/Web.config +++ b/src/Orchard.Web/Core/Settings/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Shapes/Styles/Web.config b/src/Orchard.Web/Core/Shapes/Styles/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Core/Shapes/Styles/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Shapes/Views/UI/Switchable.cshtml b/src/Orchard.Web/Core/Shapes/Views/UI/Switchable.cshtml deleted file mode 100644 index 8f3d5b92c..000000000 --- a/src/Orchard.Web/Core/Shapes/Views/UI/Switchable.cshtml +++ /dev/null @@ -1,5 +0,0 @@ -@{ - Style.Require("Switchable"); - Script.Require("Switchable"); -} -@string.Format("{0} switchable", Model) \ No newline at end of file diff --git a/src/Orchard.Web/Core/Shapes/Views/Web.config b/src/Orchard.Web/Core/Shapes/Views/Web.config index bf2230060..dd900f1a0 100644 --- a/src/Orchard.Web/Core/Shapes/Views/Web.config +++ b/src/Orchard.Web/Core/Shapes/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Content/Web.config b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Content/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Content/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Orchard.ArchiveLater.csproj b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Orchard.ArchiveLater.csproj index d63ddfbbf..8e940f29b 100644 --- a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Orchard.ArchiveLater.csproj +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Orchard.ArchiveLater.csproj @@ -106,6 +106,16 @@ Designer + + + Designer + + + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Views/Web.config b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Views/Web.config index 1295710ba..9a4455a74 100644 --- a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj b/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj index 1bad3749b..de39cc240 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Orchard.Blogs.csproj @@ -162,6 +162,15 @@ + + Designer + + + Designer + + + Designer + diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Scripts/Web.config b/src/Orchard.Web/Modules/Orchard.Blogs/Scripts/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Scripts/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.Blogs/Styles/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Styles/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Web.config index bf2230060..dd900f1a0 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ViewsWebConfig.txt b/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ViewsWebConfig.txt index 7022197d4..260e8318d 100644 --- a/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ViewsWebConfig.txt +++ b/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ViewsWebConfig.txt @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/Web.config b/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/Web.config index 3e2ccce91..271dd8ba1 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Views/Web.config @@ -3,7 +3,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Media/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Media/Controllers/AdminController.cs index 42be7e649..14d2898fe 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Media/Controllers/AdminController.cs @@ -3,10 +3,13 @@ using System.Collections.Generic; using System.IO; using System.Web; using System.Web.Mvc; +using JetBrains.Annotations; +using Orchard.ContentManagement; using Orchard.Localization; using Orchard.Media.Models; using Orchard.Media.Services; using Orchard.Media.ViewModels; +using Orchard.Settings; using Orchard.UI.Notify; using Orchard.Utility.Extensions; @@ -153,6 +156,15 @@ namespace Orchard.Media.Controllers { if (!ModelState.IsValid) return View(viewModel); + // first validate them all + foreach (string fileName in Request.Files) { + HttpPostedFileBase file = Request.Files[fileName]; + if (!_mediaService.FileAllowed(file)) { + ModelState.AddModelError("File", T("That file type is not allowed.").ToString()); + return View(viewModel); + } + } + // then save them foreach (string fileName in Request.Files) { HttpPostedFileBase file = Request.Files[fileName]; _mediaService.UploadMediaFile(viewModel.MediaPath, file); @@ -195,10 +207,11 @@ namespace Orchard.Media.Controllers { } } - public ActionResult EditMedia(string name, string caption, DateTime lastUpdated, long size, string folderName, string mediaPath) { + public ActionResult EditMedia(string name, DateTime lastUpdated, long size, string folderName, string mediaPath) { var model = new MediaItemEditViewModel(); model.Name = name; - model.Caption = caption ?? String.Empty; + // todo: reimplement + //model.Caption = caption ?? String.Empty; model.LastUpdated = lastUpdated; model.Size = size; model.FolderName = folderName; diff --git a/src/Orchard.Web/Modules/Orchard.Media/Handlers/MediaSettingsPartHandler.cs b/src/Orchard.Web/Modules/Orchard.Media/Handlers/MediaSettingsPartHandler.cs new file mode 100644 index 000000000..dd480a4c9 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Media/Handlers/MediaSettingsPartHandler.cs @@ -0,0 +1,15 @@ +using JetBrains.Annotations; +using Orchard.Data; +using Orchard.ContentManagement.Handlers; +using Orchard.Media.Models; + +namespace Orchard.Media.Handlers { + [UsedImplicitly] + public class MediaSettingsPartHandler : ContentHandler { + public MediaSettingsPartHandler(IRepository repository) { + Filters.Add(new ActivatingFilter("Site")); + Filters.Add(StorageFilter.For(repository)); + Filters.Add(new TemplateFilterForRecord("MediaSettings", "Parts/Media.MediaSettings")); + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Media/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Media/Migrations.cs new file mode 100644 index 000000000..0830945b6 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Media/Migrations.cs @@ -0,0 +1,16 @@ +using Orchard.Data.Migration; +using Orchard.Media.Models; + +namespace Orchard.Media { + public class MediaDataMigration : DataMigrationImpl { + public int Create() { + SchemaBuilder.CreateTable("MediaSettingsPartRecord", + table => table + .ContentPartRecord() + .Column("UploadAllowedFileTypeWhitelist", c => c.WithDefault(MediaSettingsPartRecord.DefaultWhitelist).WithLength(255)) + ); + + return 1; + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPart.cs b/src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPart.cs new file mode 100644 index 000000000..39228bf9c --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPart.cs @@ -0,0 +1,11 @@ +using Orchard.ContentManagement; +using System; + +namespace Orchard.Media.Models { + public class MediaSettingsPart : ContentPart { + public string UploadAllowedFileTypeWhitelist { + get { return Record.UploadAllowedFileTypeWhitelist; } + set { Record.UploadAllowedFileTypeWhitelist = value; } + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPartRecord.cs b/src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPartRecord.cs new file mode 100644 index 000000000..758732576 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Media/Models/MediaSettingsPartRecord.cs @@ -0,0 +1,16 @@ +using System.Net.Mail; +using Orchard.ContentManagement.Records; +using System.ComponentModel.DataAnnotations; + +namespace Orchard.Media.Models { + public class MediaSettingsPartRecord : ContentPartRecord { + internal const string DefaultWhitelist = "jpg jpeg gif png txt doc docx xls xlsx pdf ppt pptx pps ppsx odt ods odp"; + private string _whitelist = DefaultWhitelist; + + [StringLength(255)] + public virtual string UploadAllowedFileTypeWhitelist { + get { return _whitelist; } + set { _whitelist = value; } + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj b/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj index 3bebf0e29..5c165af9b 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj +++ b/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj @@ -71,6 +71,10 @@ + + + + @@ -113,6 +117,17 @@ + + + + Designer + + + + + Designer + + + + +
+ + + + + + +
diff --git a/src/Orchard.Web/Modules/Orchard.Media/ViewModels/MediaItemAddViewModel.cs b/src/Orchard.Web/Modules/Orchard.Media/ViewModels/MediaItemAddViewModel.cs index b71641e71..eadef0eff 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/ViewModels/MediaItemAddViewModel.cs +++ b/src/Orchard.Web/Modules/Orchard.Media/ViewModels/MediaItemAddViewModel.cs @@ -1,4 +1,6 @@ -namespace Orchard.Media.ViewModels { +using Orchard.Media.Models; + +namespace Orchard.Media.ViewModels { public class MediaItemAddViewModel { public string FolderName { get; set; } public string MediaPath { get; set; } diff --git a/src/Orchard.Web/Modules/Orchard.Media/Views/Admin/EditMedia.cshtml b/src/Orchard.Web/Modules/Orchard.Media/Views/Admin/EditMedia.cshtml index 6f1ac4f0d..9dee177e3 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Views/Admin/EditMedia.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Media/Views/Admin/EditMedia.cshtml @@ -19,7 +19,7 @@ @Html.ValidationSummary()
- @Model.Caption +
@* todo: make these real (including markup) *@ @@ -32,7 +32,7 @@
- + @T("Copy this html to add this image to your site.")
@@ -42,9 +42,6 @@
- - - @T("This will be used for the image alt tag.") @@ -58,7 +55,7 @@ @*

@T("Preview")

-
@Model.Caption
+
    @// todo: make these real (including markup)
  • @@ -66,7 +63,7 @@
  • - ", ResolveUrl("~/Media/" + Model.RelativePath + "/" + Model.Name), 500, 375, Model.Caption)" /> + ", ResolveUrl("~/Media/" + Model.RelativePath + "/" + Model.Name), 500, 375)" /> @T("Copy this html to add this image to your site.")

diff --git a/src/Orchard.Web/Modules/Orchard.Media/Views/EditorTemplates/Parts/Media.MediaSettings.cshtml b/src/Orchard.Web/Modules/Orchard.Media/Views/EditorTemplates/Parts/Media.MediaSettings.cshtml new file mode 100644 index 000000000..5cc0a1d31 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Media/Views/EditorTemplates/Parts/Media.MediaSettings.cshtml @@ -0,0 +1,9 @@ +@model Orchard.Media.Models.MediaSettingsPartRecord + +
+ @T("Media Settings") +
+ @Html.LabelFor(m => m.UploadAllowedFileTypeWhitelist, T("Upload allowed file types (list of extensions separated by spaces)")) + @Html.TextBoxFor(m => m.UploadAllowedFileTypeWhitelist, new { @class = "textMedium" }) +
+
\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Media/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Media/Views/Web.config index 5c6614a80..37513c05c 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Media/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Modules/Orchard.Modules.csproj b/src/Orchard.Web/Modules/Orchard.Modules/Orchard.Modules.csproj index ff839c0d7..9bacc6bc8 100644 --- a/src/Orchard.Web/Modules/Orchard.Modules/Orchard.Modules.csproj +++ b/src/Orchard.Web/Modules/Orchard.Modules/Orchard.Modules.csproj @@ -106,7 +106,16 @@ - + + + Designer + + + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Content/Web.config b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Content/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Content/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj index e6dfd3eba..76aeae4ed 100644 --- a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Orchard.MultiTenancy.csproj @@ -100,6 +100,16 @@ False + + + Designer + + + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Web.config b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Web.config index bf2230060..dd900f1a0 100644 --- a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Orchard.Packaging.csproj b/src/Orchard.Web/Modules/Orchard.Packaging/Orchard.Packaging.csproj index 2d26b8dec..8b9868e5c 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Orchard.Packaging.csproj +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Orchard.Packaging.csproj @@ -108,9 +108,7 @@ - - @@ -121,6 +119,21 @@ + + + Designer + + + + + Designer + + + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.Packaging/Styles/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Styles/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Packaging/Views/Web.config index 3e2ccce91..271dd8ba1 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Views/Web.config @@ -3,7 +3,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Drivers/PublishLaterPartDriver.cs b/src/Orchard.Web/Modules/Orchard.PublishLater/Drivers/PublishLaterPartDriver.cs index a8ba7544a..5724829e3 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Drivers/PublishLaterPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Drivers/PublishLaterPartDriver.cs @@ -7,7 +7,6 @@ using Orchard.PublishLater.Services; using Orchard.PublishLater.ViewModels; using Orchard.Localization; using System.Globalization; -using Orchard.Core.Localization.Services; namespace Orchard.PublishLater.Drivers { public class PublishLaterPartDriver : ContentPartDriver { @@ -49,8 +48,8 @@ namespace Orchard.PublishLater.Drivers { // date and time are formatted using the same patterns as DateTimePicker is, preventing other cultures issues var model = new PublishLaterViewModel(part) { ScheduledPublishUtc = part.ScheduledPublishUtc.Value, - ScheduledPublishDate = part.ScheduledPublishUtc.Value.HasValue ? part.ScheduledPublishUtc.Value.Value.ToLocalTime().ToString(DatePattern, CultureInfo.InvariantCulture) : String.Empty, - ScheduledPublishTime = part.ScheduledPublishUtc.Value.HasValue ? part.ScheduledPublishUtc.Value.Value.ToLocalTime().ToString(TimePattern, CultureInfo.InvariantCulture) : String.Empty + ScheduledPublishDate = part.ScheduledPublishUtc.Value.HasValue && !part.IsPublished() ? part.ScheduledPublishUtc.Value.Value.ToLocalTime().ToString(DatePattern, CultureInfo.InvariantCulture) : String.Empty, + ScheduledPublishTime = part.ScheduledPublishUtc.Value.HasValue && !part.IsPublished() ? part.ScheduledPublishUtc.Value.Value.ToLocalTime().ToString(TimePattern, CultureInfo.InvariantCulture) : String.Empty }; return ContentShape("Parts_PublishLater_Edit", @@ -60,27 +59,24 @@ namespace Orchard.PublishLater.Drivers { var model = new PublishLaterViewModel(part); updater.TryUpdateModel(model, Prefix, null, null); - switch (model.Command) { - case "PublishNow": - _commonService.Publish(model.ContentItem); - break; - case "PublishLater": - DateTime scheduled; - string parseDateTime = String.Concat(model.ScheduledPublishDate, " ", model.ScheduledPublishTime); - - // use an english culture as it is the one used by jQuery.datepicker by default - if (DateTime.TryParse(parseDateTime, CultureInfo.GetCultureInfo("en-US"), DateTimeStyles.AssumeLocal, out scheduled)) { - model.ScheduledPublishUtc = part.ScheduledPublishUtc.Value = scheduled.ToUniversalTime(); - _publishLaterService.Publish(model.ContentItem, model.ScheduledPublishUtc.Value); - } - else { - updater.AddModelError(Prefix, T("{0} is an invalid date and time", parseDateTime)); - } - break; - case "SaveDraft": - break; + if (!string.IsNullOrWhiteSpace(model.ScheduledPublishDate) && !string.IsNullOrWhiteSpace(model.ScheduledPublishTime)) { + DateTime scheduled; + string parseDateTime = String.Concat(model.ScheduledPublishDate, " ", model.ScheduledPublishTime); + + // use an english culture as it is the one used by jQuery.datepicker by default + if (DateTime.TryParse(parseDateTime, CultureInfo.GetCultureInfo("en-US"), DateTimeStyles.AssumeLocal, out scheduled)) { + model.ScheduledPublishUtc = part.ScheduledPublishUtc.Value = scheduled.ToUniversalTime(); + _publishLaterService.Publish(model.ContentItem, model.ScheduledPublishUtc.Value); + } + else { + updater.AddModelError(Prefix, T("{0} is an invalid date and time", parseDateTime)); + } } + else if (!string.IsNullOrWhiteSpace(model.ScheduledPublishDate) || !string.IsNullOrWhiteSpace(model.ScheduledPublishTime)) { + updater.AddModelError(Prefix, T("Both the date and time need to be specified for when this is to be published. If you don't want to schedule publishing then clear both the date and time fields.")); + } + return ContentShape("Parts_PublishLater_Edit", () => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix)); } diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Orchard.PublishLater.csproj b/src/Orchard.Web/Modules/Orchard.PublishLater/Orchard.PublishLater.csproj index 40a706eda..05e35b33d 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Orchard.PublishLater.csproj +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Orchard.PublishLater.csproj @@ -83,7 +83,11 @@ - + + + Designer + + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} @@ -123,6 +127,11 @@ Designer + + + Designer + + - + diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/datetime.css b/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/datetime.css index 21684b460..af6b87158 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/datetime.css +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Styles/datetime.css @@ -7,8 +7,8 @@ html.dyn input.hinted { font-style:italic; } input#PublishLater_ScheduledPublishDate { - width:50%; + width:49%; } input#PublishLater_ScheduledPublishTime { - width:36%; + width:43%; } \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/ViewModels/PublishLaterViewModel.cs b/src/Orchard.Web/Modules/Orchard.PublishLater/ViewModels/PublishLaterViewModel.cs index 3961d56c4..4c5392c16 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/ViewModels/PublishLaterViewModel.cs +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/ViewModels/PublishLaterViewModel.cs @@ -11,7 +11,6 @@ namespace Orchard.PublishLater.ViewModels { _publishLaterPart = publishLaterPart; } - public string Command { get; set; } public ContentItem ContentItem { get { return _publishLaterPart.ContentItem; } } public bool IsPublished { diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml b/src/Orchard.Web/Modules/Orchard.PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml index 5b7681ce3..1ac58b8ee 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Views/EditorTemplates/Parts/PublishLater.cshtml @@ -4,48 +4,36 @@ Script.Require("jQueryUI_DatePicker"); Style.Require("PublishLater_DatePicker"); Style.Require("jQueryUtils_TimePicker"); - Style.Require("jQueryUI_DatePicker"); + Style.Require("jQueryUI_DatePicker"); } -
+
@T("Publish Settings") -
- @Html.RadioButton("Command", "SaveDraft", Model.ContentItem.VersionRecord == null || !Model.ContentItem.VersionRecord.Published, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_SaveDraft") }) - -
-
- @Html.RadioButton("Command", "PublishNow", Model.ContentItem.VersionRecord != null && Model.ContentItem.VersionRecord.Published, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishNow") }) - -
-
- @Html.RadioButton("Command", "PublishLater", Model.ScheduledPublishUtc != null, new { id = ViewData.TemplateInfo.GetFullHtmlFieldId("Command_PublishLater") }) - -
-
- - @Html.EditorFor(m => m.ScheduledPublishDate) - - @Html.EditorFor(m => m.ScheduledPublishTime) -
+ + @Html.EditorFor(m => m.ScheduledPublishDate) + + @Html.EditorFor(m => m.ScheduledPublishTime)
@using(Script.Foot()) { diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Views/Web.config b/src/Orchard.Web/Modules/Orchard.PublishLater/Views/Web.config index 5c6614a80..37513c05c 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Roles/Orchard.Roles.csproj b/src/Orchard.Web/Modules/Orchard.Roles/Orchard.Roles.csproj index 3da13ed25..12638ae72 100644 --- a/src/Orchard.Web/Modules/Orchard.Roles/Orchard.Roles.csproj +++ b/src/Orchard.Web/Modules/Orchard.Roles/Orchard.Roles.csproj @@ -111,6 +111,11 @@ + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Search/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Search/Views/Web.config index 5c6614a80..37513c05c 100644 --- a/src/Orchard.Web/Modules/Orchard.Search/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Search/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Themes/Orchard.Themes.csproj b/src/Orchard.Web/Modules/Orchard.Themes/Orchard.Themes.csproj index 655a14554..1c8eaf9af 100644 --- a/src/Orchard.Web/Modules/Orchard.Themes/Orchard.Themes.csproj +++ b/src/Orchard.Web/Modules/Orchard.Themes/Orchard.Themes.csproj @@ -108,6 +108,16 @@ + + + Designer + + + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Themes/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Themes/Views/Web.config index bf2230060..dd900f1a0 100644 --- a/src/Orchard.Web/Modules/Orchard.Themes/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Themes/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Users/Orchard.Users.csproj b/src/Orchard.Web/Modules/Orchard.Users/Orchard.Users.csproj index 83673764a..a375dcbd1 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Orchard.Users.csproj +++ b/src/Orchard.Web/Modules/Orchard.Users/Orchard.Users.csproj @@ -122,6 +122,11 @@ Designer + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj b/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj index d599039a4..f8bd1b93c 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Orchard.Widgets.csproj @@ -126,6 +126,16 @@ + + + Designer + + + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Views/Web.config b/src/Orchard.Web/Modules/Orchard.Widgets/Views/Web.config index d52f8e346..1f92a3531 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Views/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Views/Web.config @@ -2,8 +2,6 @@ - + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.jQuery/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.jQuery/Styles/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.jQuery/Styles/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/TinyMce/Scripts/Web.config b/src/Orchard.Web/Modules/TinyMce/Scripts/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Modules/TinyMce/Scripts/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/TinyMce/TinyMce.csproj b/src/Orchard.Web/Modules/TinyMce/TinyMce.csproj index 2d87f211c..77afab906 100644 --- a/src/Orchard.Web/Modules/TinyMce/TinyMce.csproj +++ b/src/Orchard.Web/Modules/TinyMce/TinyMce.csproj @@ -158,6 +158,11 @@ + + + Designer + + + + + + + + + + + + diff --git a/src/Orchard.Web/Themes/SafeMode/Styles/Web.config b/src/Orchard.Web/Themes/SafeMode/Styles/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Themes/SafeMode/Styles/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Themes/TheAdmin/Scripts/Web.config b/src/Orchard.Web/Themes/TheAdmin/Scripts/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Themes/TheAdmin/Scripts/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Themes/TheAdmin/Styles/Web.config b/src/Orchard.Web/Themes/TheAdmin/Styles/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Themes/TheAdmin/Styles/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Themes/TheAdmin/Styles/site.css b/src/Orchard.Web/Themes/TheAdmin/Styles/site.css index 8ae765e65..865e0ee9f 100644 --- a/src/Orchard.Web/Themes/TheAdmin/Styles/site.css +++ b/src/Orchard.Web/Themes/TheAdmin/Styles/site.css @@ -128,13 +128,13 @@ number of columns: 24; actual width: 946; column width: 26; gutter width:14 .sections .primary { display:inline; float:left; - width:74.543%; + width:69.452%; } .sections .secondary { display:inline; float:left; margin-left:1.71%; - width:23.629%; + width:28.721%; } /* Headings and defaults @@ -842,6 +842,29 @@ table .button { .settings legend { margin:0 0 -.4em 0; } +/* Core Contents and Orchard.PublishLater */ +fieldset.save-button { + clear:none; + float:left; + padding-right:0; + width:auto; +} +fieldset.publish-later-datetime { + clear:none; + float:left; + min-width:13.6em; + padding-left:6px; + padding-right:0; + width:68%; +} +fieldset.publish-later-datetime legend { + display:none; +} +fieldset.publish-later-datetime input { + padding:1px; + text-align:center; + color:#666; +} /* Fields ----------------------------------------------------------*/ diff --git a/src/Orchard.Web/Themes/TheThemeMachine/Styles/Web.config b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Web.config new file mode 100644 index 000000000..b4210f3e0 --- /dev/null +++ b/src/Orchard.Web/Themes/TheThemeMachine/Styles/Web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Themes/Themes.csproj b/src/Orchard.Web/Themes/Themes.csproj index 7d12ed2ce..e5e154151 100644 --- a/src/Orchard.Web/Themes/Themes.csproj +++ b/src/Orchard.Web/Themes/Themes.csproj @@ -58,9 +58,15 @@ - + Designer + + Designer + + + Designer + @@ -94,7 +100,22 @@ - + + + + + Designer + + + + + Designer + + + + + Designer + diff --git a/src/Orchard.Web/Themes/Web.config b/src/Orchard.Web/Themes/Web.config index ae3d47d77..dd900f1a0 100644 --- a/src/Orchard.Web/Themes/Web.config +++ b/src/Orchard.Web/Themes/Web.config @@ -2,11 +2,6 @@ - - - - - - - + + + + + - - - - - - - - - - + + + + + + + + diff --git a/src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs b/src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs index 7f0817619..94109df69 100644 --- a/src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs +++ b/src/Orchard/FileSystems/Media/FileSystemStorageProvider.cs @@ -1,4 +1,5 @@ -using System; +#if !AZURE +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -45,7 +46,7 @@ namespace Orchard.FileSystems.Media { public string GetPublicUrl(string path) { - return _publicPath + path.Replace(Path.DirectorySeparatorChar, '/'); + return Map(_publicPath + path.Replace(Path.DirectorySeparatorChar, '/')); } public IStorageFile GetFile(string path) { @@ -248,4 +249,5 @@ namespace Orchard.FileSystems.Media { } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/src/Tools/PackageIndexReferenceImplementation/Controllers/FeedController.cs b/src/Tools/PackageIndexReferenceImplementation/Controllers/FeedController.cs index 06d6ef74b..9bcdaf383 100644 --- a/src/Tools/PackageIndexReferenceImplementation/Controllers/FeedController.cs +++ b/src/Tools/PackageIndexReferenceImplementation/Controllers/FeedController.cs @@ -16,6 +16,9 @@ using PackageIndexReferenceImplementation.Services; namespace PackageIndexReferenceImplementation.Controllers { [HandleError] public class FeedController : Controller { + private const string VersionTag = "Version"; + private const string ExtensionsNamespace = "http://orchardproject.net"; + private readonly FeedStorage _feedStorage; private readonly MediaStorage _mediaStorage; @@ -104,7 +107,12 @@ namespace PackageIndexReferenceImplementation.Controllers { } if ( !string.IsNullOrEmpty(packageProperties.Version) ) { - item.ElementExtensions.Add("Version", "http://orchardproject.net", packageProperties.Version); + var versionExtensions = item.ElementExtensions.Where(e => e.OuterName == VersionTag && e.OuterNamespace == ExtensionsNamespace); + foreach(var versionExtension in versionExtensions) { + item.ElementExtensions.Remove(versionExtension); + } + + item.ElementExtensions.Add(VersionTag, ExtensionsNamespace, packageProperties.Version); } var mediaIdentifier = packageProperties.Identifier + "-" + packageProperties.Version + ".zip";