mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-11-28 17:32:44 +08:00
#19711: Returning the created Media Folder
Work Item: 19711 --HG-- branch : 1.x
This commit is contained in:
@@ -24,7 +24,7 @@ namespace Orchard.MediaLibrary.Services {
|
|||||||
|
|
||||||
MediaPart ImportStream(int termId, Stream stream, string filename);
|
MediaPart ImportStream(int termId, Stream stream, string filename);
|
||||||
|
|
||||||
void CreateFolder(int? parentFolderId, string name);
|
MediaFolder CreateFolder(int? parentFolderId, string name);
|
||||||
void RenameFolder(int folderId, string name);
|
void RenameFolder(int folderId, string name);
|
||||||
void DeleteFolder(int folderId);
|
void DeleteFolder(int folderId);
|
||||||
void MoveMedia(int targetId, int[] mediaItemIds);
|
void MoveMedia(int targetId, int[] mediaItemIds);
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ namespace Orchard.MediaLibrary.Services {
|
|||||||
return requestMediaFactoryResults.First().MediaFactory;
|
return requestMediaFactoryResults.First().MediaFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CreateFolder(int? parentFolderId, string name) {
|
public MediaFolder CreateFolder(int? parentFolderId, string name) {
|
||||||
var taxonomy = GetMediaLocationTaxonomy();
|
var taxonomy = GetMediaLocationTaxonomy();
|
||||||
TermPart parentTerm = parentFolderId.HasValue ? _taxonomyService.GetTerm(parentFolderId.Value) : null;
|
TermPart parentTerm = parentFolderId.HasValue ? _taxonomyService.GetTerm(parentFolderId.Value) : null;
|
||||||
var term = _taxonomyService.NewTerm(taxonomy);
|
var term = _taxonomyService.NewTerm(taxonomy);
|
||||||
@@ -154,6 +154,8 @@ namespace Orchard.MediaLibrary.Services {
|
|||||||
|
|
||||||
_taxonomyService.ProcessPath(term);
|
_taxonomyService.ProcessPath(term);
|
||||||
_contentManager.Create(term, VersionOptions.Published);
|
_contentManager.Create(term, VersionOptions.Published);
|
||||||
|
|
||||||
|
return CreateMediaFolder(term);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RenameFolder(int folderId, string name) {
|
public void RenameFolder(int folderId, string name) {
|
||||||
|
|||||||
Reference in New Issue
Block a user