#18975: Maintaining current folder in media management

Work Item: 18975

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-09-20 10:09:11 -07:00
parent ed7b548150
commit 3fe70aa33c

View File

@@ -76,7 +76,7 @@ namespace Orchard.Media.Controllers {
return View(viewModel); return View(viewModel);
} }
return RedirectToAction("Index"); return RedirectToAction("Edit", new { viewModel.Name, viewModel.MediaPath });
} }
public ActionResult Edit(string name, string mediaPath) { public ActionResult Edit(string name, string mediaPath) {
@@ -93,7 +93,7 @@ namespace Orchard.Media.Controllers {
} }
[HttpPost] [HttpPost]
public ActionResult Edit(FormCollection input) { public ActionResult Edit(FormCollection input, string name, string mediaPath) {
foreach (string key in input.Keys) { foreach (string key in input.Keys) {
if (key.StartsWith("Checkbox.File.") && input[key] == "true") { if (key.StartsWith("Checkbox.File.") && input[key] == "true") {
string fileName = key.Substring("Checkbox.File.".Length); string fileName = key.Substring("Checkbox.File.".Length);
@@ -124,7 +124,8 @@ namespace Orchard.Media.Controllers {
} }
} }
} }
return RedirectToAction("Index");
return RedirectToAction("Edit", new { name, mediaPath });
} }
public ActionResult EditProperties(string folderName, string mediaPath) { public ActionResult EditProperties(string folderName, string mediaPath) {