#20479: Getting MediaLibrary root folder from IMediaLibraryService

Work Item: 20479
This commit is contained in:
Stanley Goldman
2014-02-04 09:29:07 -05:00
committed by Nicholas Mayne
parent 90692dedce
commit 058531cd60
3 changed files with 10 additions and 2 deletions

View File

@@ -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,

View File

@@ -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>

View File

@@ -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>