diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Views/EditorTemplates/EncodingSettingsViewModel.cshtml b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Views/EditorTemplates/EncodingSettingsViewModel.cshtml
index 7aaf12a96..a5e5b0e32 100644
--- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Views/EditorTemplates/EncodingSettingsViewModel.cshtml
+++ b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Views/EditorTemplates/EncodingSettingsViewModel.cshtml
@@ -30,7 +30,7 @@
- @T("Leave empty if this is standard preset (in which case the name must match a standard Microsoft Azure Media Services encoding preset name.")
+ @T("Leave empty if this is a standard preset (in which case the name must match a standard Microsoft Azure Media Services encoding preset name).")
diff --git a/src/Orchard.Web/Modules/Orchard.CustomForms/Views/Item/Create.cshtml b/src/Orchard.Web/Modules/Orchard.CustomForms/Views/Item/Create.cshtml
index 6fe2fcd59..72365658a 100644
--- a/src/Orchard.Web/Modules/Orchard.CustomForms/Views/Item/Create.cshtml
+++ b/src/Orchard.Web/Modules/Orchard.CustomForms/Views/Item/Create.cshtml
@@ -1,8 +1,11 @@
@using Orchard.ContentManagement
@using Orchard.Utility.Extensions
+@using Orchard.ContentManagement.Aspects;
@{
ContentItem customForm = Model.ContentItem;
string returnUrl = Model.ReturnUrl;
+ var metadata = customForm.ContentManager.GetItemMetadata(customForm);
+ var displayText = metadata != null ? MvcHtmlString.Create(metadata.DisplayText) : null;
Html.AddPageClassNames("edit-" + customForm.ContentType.HtmlClassify());
@@ -12,7 +15,7 @@
var submitButtonText = String.IsNullOrEmpty(Model.ContentItem.CustomFormPart.SubmitButtonText) ? T("Submit").Text : Model.ContentItem.CustomFormPart.SubmitButtonText;
}
-@Display(New.Parts_Title().Title(Html.ItemDisplayText(customForm)))
+@Display(New.Parts_Title().Title(displayText))
@using (Html.BeginFormAntiForgeryPost(returnUrl)) {
@Html.ValidationSummary()
diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Services/FormService.cs b/src/Orchard.Web/Modules/Orchard.DynamicForms/Services/FormService.cs
index 97f2fbaca..ab24a07bf 100644
--- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Services/FormService.cs
+++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Services/FormService.cs
@@ -263,7 +263,7 @@ namespace Orchard.DynamicForms.Services {
ReadElementValues(element, context);
var value = context.Output[element.Name];
- var bindingSettings = element.Data.GetModel(null);
+ var bindingSettings = element.Data.GetModel();
if (bindingSettings != null) {
foreach (var partBindingSettings in bindingSettings.Parts) {
diff --git a/src/Orchard.Web/Modules/Orchard.Indexing/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Indexing/Migrations.cs
index 488973394..fac6a86e7 100644
--- a/src/Orchard.Web/Modules/Orchard.Indexing/Migrations.cs
+++ b/src/Orchard.Web/Modules/Orchard.Indexing/Migrations.cs
@@ -33,14 +33,13 @@ namespace Orchard.Indexing {
}
}
- return 2;
+ return 4; // Returns 4 instead of 2 due to the modified/deleted migrations in UpdateFrom2-3.
}
public int UpdateFrom2() {
-
// A table for a custom job implementation was here, but since we use JobsQueue that table is deprecated.
- return 3;
+ return 4; // See the comment in UpdateFrom1.
}
public int UpdateFrom3() {
diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Controllers/AdminController.cs
index 8031b2dea..065cffafc 100644
--- a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Controllers/AdminController.cs
+++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Controllers/AdminController.cs
@@ -56,11 +56,13 @@ namespace Orchard.MediaLibrary.Controllers {
explorer.Weld(new MediaLibraryExplorerPart());
var explorerShape = Services.ContentManager.BuildDisplay(explorer);
+ var rootMediaFolderPath = rootMediaFolder == null ? null : rootMediaFolder.MediaPath;
var viewModel = new MediaManagerIndexViewModel {
DialogMode = dialog,
FolderPath = folderPath,
- ChildFoldersViewModel = new MediaManagerChildFoldersViewModel{Children = _mediaLibraryService.GetMediaFolders(rootMediaFolder == null ? null : rootMediaFolder.MediaPath)},
+ RootFolderPath = rootMediaFolderPath,
+ ChildFoldersViewModel = new MediaManagerChildFoldersViewModel { Children = _mediaLibraryService.GetMediaFolders(rootMediaFolderPath) },
MediaTypes = _mediaLibraryService.GetMediaTypes(),
CustomActionsShapes = explorerShape.Actions,
CustomNavigationShapes = explorerShape.Navigation,
@@ -158,8 +160,8 @@ namespace Orchard.MediaLibrary.Controllers {
var rootMediaFolder = _mediaLibraryService.GetRootMediaFolder();
var rootMediaFolderPath = rootMediaFolder == null ? null : rootMediaFolder.MediaPath;
- var mediaParts = _mediaLibraryService.GetMediaContentItems(rootMediaFolderPath, skip, count, order, mediaType);
- var mediaPartsCount = _mediaLibraryService.GetMediaContentItemsCount(rootMediaFolderPath, mediaType);
+ var mediaParts = _mediaLibraryService.GetMediaContentItemsRecursive(rootMediaFolderPath, skip, count, order, mediaType);
+ var mediaPartsCount = _mediaLibraryService.GetMediaContentItemsCountRecursive(rootMediaFolderPath, mediaType);
var mediaItems = mediaParts.Select(x => new MediaManagerMediaItemViewModel {
diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Controllers/FolderController.cs b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Controllers/FolderController.cs
index da6065f17..33927b245 100644
--- a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Controllers/FolderController.cs
+++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Controllers/FolderController.cs
@@ -165,7 +165,7 @@ namespace Orchard.MediaLibrary.Controllers {
foreach (var media in Services.ContentManager.Query().ForPart().ForContentItems(mediaItemIds).List()) {
// don't try to rename the file if there is no associated media file
- if (!String.IsNullOrEmpty(media.FileName)) {
+ if (!string.IsNullOrEmpty(media.FileName)) {
var uniqueFilename = _mediaLibraryService.GetUniqueFilename(folderPath, media.FileName);
_mediaLibraryService.MoveFile(media.FolderPath, media.FileName, folderPath, uniqueFilename);
media.FileName = uniqueFilename;
@@ -179,7 +179,10 @@ namespace Orchard.MediaLibrary.Controllers {
private bool IsRootFolder(string folderPath) {
var rootMediaFolder = _mediaLibraryService.GetRootMediaFolder();
- return String.Equals(rootMediaFolder.MediaPath, folderPath, StringComparison.OrdinalIgnoreCase);
+
+ return rootMediaFolder == null ?
+ string.IsNullOrEmpty(folderPath) :
+ string.Equals(rootMediaFolder.MediaPath, folderPath, StringComparison.OrdinalIgnoreCase);
}
}
}
\ No newline at end of file
diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Scripts/media-library.js b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Scripts/media-library.js
index d48fac633..f7d7a29d6 100644
--- a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Scripts/media-library.js
+++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Scripts/media-library.js
@@ -434,7 +434,7 @@ $(function () {
ko.applyBindings(viewModel);
- if (settings.hasFolderPath) {
+ if (settings.hasFolderPath && settings.folderPath != settings.rootFolderPath) {
viewModel.displayFolder(settings.folderPath);
//fetch displayed folder structure
diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Services/IMediaLibraryService.cs b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Services/IMediaLibraryService.cs
index 695c5a1ed..f30934c1c 100644
--- a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Services/IMediaLibraryService.cs
+++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Services/IMediaLibraryService.cs
@@ -13,8 +13,10 @@ namespace Orchard.MediaLibrary.Services {
IContentQuery GetMediaContentItems(VersionOptions versionOptions = null);
IEnumerable GetMediaContentItems(string folderPath, int skip, int count, string order, string mediaType, VersionOptions versionOptions = null);
IEnumerable GetMediaContentItems(int skip, int count, string order, string mediaType, VersionOptions versionOptions = null);
+ IEnumerable GetMediaContentItemsRecursive(string folderPath, int skip, int count, string order, string mediaType, VersionOptions versionOptions = null);
int GetMediaContentItemsCount(string folderPath, string mediaType, VersionOptions versionOptions = null);
int GetMediaContentItemsCount(string mediaType, VersionOptions versionOptions = null);
+ int GetMediaContentItemsCountRecursive(string folderPath, string mediaType, VersionOptions versionOptions = null);
MediaPart ImportMedia(string relativePath, string filename);
MediaPart ImportMedia(string relativePath, string filename, string contentType);
MediaPart ImportMedia(Stream stream, string relativePath, string filename);
diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Services/MediaLibraryService.cs b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Services/MediaLibraryService.cs
index 2abb41ff0..42e23a75d 100644
--- a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Services/MediaLibraryService.cs
+++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Services/MediaLibraryService.cs
@@ -59,6 +59,11 @@ namespace Orchard.MediaLibrary.Services {
return GetMediaContentItems(null, skip, count, order, mediaType, versionOptions);
}
+ public IEnumerable GetMediaContentItemsRecursive(string folderPath, int skip, int count, string order, string mediaType, VersionOptions versionOptions = null) {
+ return BuildGetMediaContentItemsQuery(_orchardServices.ContentManager, folderPath, true, order, mediaType, versionOptions)
+ .Slice(skip, count);
+ }
+
public int GetMediaContentItemsCount(string folderPath, string mediaType, VersionOptions versionOptions = null) {
return BuildGetMediaContentItemsQuery(_orchardServices.ContentManager, folderPath, mediaType: mediaType, versionOptions: versionOptions)
.Count();
@@ -68,6 +73,11 @@ namespace Orchard.MediaLibrary.Services {
return GetMediaContentItemsCount(null, mediaType, versionOptions);
}
+ public int GetMediaContentItemsCountRecursive(string folderPath, string mediaType, VersionOptions versionOptions = null) {
+ return BuildGetMediaContentItemsQuery(_orchardServices.ContentManager, folderPath, true, mediaType: mediaType, versionOptions: versionOptions)
+ .Count();
+ }
+
private static IContentQuery BuildGetMediaContentItemsQuery(
IContentManager contentManager, string folderPath = null, bool recursive = false, string order = null, string mediaType = null, VersionOptions versionOptions = null) {
diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary/ViewModels/MediaManagerIndexViewModel.cs b/src/Orchard.Web/Modules/Orchard.MediaLibrary/ViewModels/MediaManagerIndexViewModel.cs
index 8d4db509e..8847028e0 100644
--- a/src/Orchard.Web/Modules/Orchard.MediaLibrary/ViewModels/MediaManagerIndexViewModel.cs
+++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary/ViewModels/MediaManagerIndexViewModel.cs
@@ -6,6 +6,7 @@ namespace Orchard.MediaLibrary.ViewModels {
public class MediaManagerIndexViewModel {
public MediaManagerChildFoldersViewModel ChildFoldersViewModel { get; set; }
public string FolderPath { get; set; }
+ public string RootFolderPath { get; set; }
public bool DialogMode { get; set; }
public IEnumerable MediaTypes { get; set; }
public dynamic CustomActionsShapes { get; set; }
diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Views/Admin/Index.cshtml b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Views/Admin/Index.cshtml
index b08ce0b75..bb3f7c63e 100644
--- a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Views/Admin/Index.cshtml
+++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Views/Admin/Index.cshtml
@@ -96,8 +96,9 @@ var mediaLibrarySettings = {
moveActionUrl: '@Url.Action("Move", "Folder", new {area = "Orchard.MediaLibrary"})',
deleteActionUrl: '@Url.Action("Delete", "Admin", new {area = "Orchard.MediaLibrary"})',
cloneActionUrl: '@Url.Action("Clone", "Admin", new {area = "Orchard.MediaLibrary"})',
- hasFolderPath: @(viewModel.FolderPath != null ? "true" : "false"),
+ hasFolderPath: @(!string.IsNullOrEmpty(viewModel.FolderPath) ? "true" : "false"),
folderPath: '@HttpUtility.JavaScriptStringEncode(viewModel.FolderPath)',
+ rootFolderPath: '@HttpUtility.JavaScriptStringEncode(viewModel.RootFolderPath ?? "")',
deleteConfirmationMessage: '@HttpUtility.JavaScriptStringEncode(T("Are you sure you want to delete these media items ?").Text)',
cloneConfirmationMessage: '@HttpUtility.JavaScriptStringEncode(T("Are you sure you want to clone this media item ?").Text)',
errorMessage: '@HttpUtility.JavaScriptStringEncode(T("An unexpected error occured, please refresh the page and try again.").Text)',
@@ -110,7 +111,7 @@ var mediaLibrarySettings = {
|