mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#20479: Getting MediaLibrary root folder from IMediaLibraryService
Work Item: 20479
This commit is contained in:

committed by
Nicholas Mayne

parent
90692dedce
commit
058531cd60
@@ -47,11 +47,13 @@ namespace Orchard.MediaLibrary.Controllers {
|
||||
explorer.Weld(new MediaLibraryExplorerPart());
|
||||
|
||||
var explorerShape = Services.ContentManager.BuildDisplay(explorer);
|
||||
|
||||
|
||||
var rootMediaFolder = _mediaLibraryService.GetRootMediaFolder();
|
||||
|
||||
var viewModel = new MediaManagerIndexViewModel {
|
||||
DialogMode = dialog,
|
||||
FolderPath = folderPath,
|
||||
ChildFoldersViewModel = new MediaManagerChildFoldersViewModel{Children = _mediaLibraryService.GetMediaFolders(null)},
|
||||
ChildFoldersViewModel = new MediaManagerChildFoldersViewModel{Children = _mediaLibraryService.GetMediaFolders(rootMediaFolder == null ? null : rootMediaFolder.MediaPath)},
|
||||
MediaTypes = _mediaLibraryService.GetMediaTypes(),
|
||||
CustomActionsShapes = explorerShape.Actions,
|
||||
CustomNavigationShapes = explorerShape.Navigation,
|
||||
|
@@ -36,6 +36,8 @@ namespace Orchard.MediaLibrary.Services {
|
||||
/// <returns>The public URL for the media.</returns>
|
||||
string GetMediaPublicUrl(string mediaPath, string fileName);
|
||||
|
||||
MediaFolder GetRootMediaFolder();
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the media folders within a given relative path.
|
||||
/// </summary>
|
||||
|
@@ -198,6 +198,10 @@ namespace Orchard.MediaLibrary.Services {
|
||||
return GetPublicUrl(Path.Combine(mediaPath, fileName));
|
||||
}
|
||||
|
||||
public MediaFolder GetRootMediaFolder() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the media folders within a given relative path.
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user