Added Multi-file delete support to media grid

Added file name change support to multi-file uploader
This commit is contained in:
Matt@MBP13-PC
2012-08-07 09:30:11 -01:00
parent 9b8d40ee2d
commit 872ef1fadc
4 changed files with 71 additions and 53 deletions

View File

@@ -18,7 +18,7 @@ namespace Umbraco.Web.WebServices
public class FolderBrowserService
{
[RestExtensionMethod(returnXml = false)]
public static string GetChildNodes(int parentId, string filterTerm)
public static string GetChildren(int parentId, string filterTerm)
{
var parentMedia = new global::umbraco.cms.businesslogic.media.Media(parentId);
var currentUser = User.GetCurrent();
@@ -63,6 +63,27 @@ namespace Umbraco.Web.WebServices
return new JavaScriptSerializer().Serialize(data);
}
[RestExtensionMethod(returnXml = false)]
public static string Delete(string nodeIds)
{
var nodeIdParts = nodeIds.Split(',');
foreach (var nodeIdPart in nodeIdParts.Where(x => !string.IsNullOrEmpty(x)))
{
var nodeId = 0;
if (!Int32.TryParse(nodeIdPart, out nodeId))
continue;
var node = new global::umbraco.cms.businesslogic.media.Media(nodeId);
node.delete(("," + node.Path + ",").Contains(",-21,"));
}
return new JavaScriptSerializer().Serialize(new
{
success = true
});
}
[RestExtensionMethod(returnXml = false)]
public static string Upload(int parentId)
{