From: David ‘Bombe’ Roden Date: Thu, 22 Sep 2011 05:53:54 +0000 (+0200) Subject: Add return page to form parameters. X-Git-Tag: 0.7^2~2^2~42 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f71a4ea27ef8a7ef12466a81d62b5ca60fc69854;p=Sone.git Add return page to form parameters. --- diff --git a/src/main/java/net/pterodactylus/sone/web/EditImagePage.java b/src/main/java/net/pterodactylus/sone/web/EditImagePage.java index afb8787..8bb5a44 100644 --- a/src/main/java/net/pterodactylus/sone/web/EditImagePage.java +++ b/src/main/java/net/pterodactylus/sone/web/EditImagePage.java @@ -54,6 +54,7 @@ public class EditImagePage extends SoneTemplatePage { super.processTemplate(request, templateContext); if (request.getMethod() == Method.POST) { String imageId = request.getHttpRequest().getPartAsStringFailsafe("image", 36); + String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256); Image image = webInterface.getCore().getImage(imageId, false); if (image == null) { throw new RedirectException("invalid.html"); @@ -69,7 +70,7 @@ public class EditImagePage extends SoneTemplatePage { image.setTitle(title); image.setDescription(description); webInterface.getCore().touchConfiguration(); - throw new RedirectException("imageBrowser.html?image=" + image.getId()); + throw new RedirectException(returnPage); } } diff --git a/src/main/resources/templates/imageBrowser.html b/src/main/resources/templates/imageBrowser.html index 6adb3dd..5a26c1a 100644 --- a/src/main/resources/templates/imageBrowser.html +++ b/src/main/resources/templates/imageBrowser.html @@ -229,6 +229,7 @@
+