if (!webInterface.getCore().isLocalSone(album.getSone())) {
throw new RedirectException("noPermission.html");
}
+ if (request.getHttpRequest().isPartSet("abortDelete")) {
+ throw new RedirectException("imageBrowser.html?album=" + album.getId());
+ }
Album parentAlbum = album.getParent();
webInterface.getCore().deleteAlbum(album);
if (parentAlbum == null) {
}
throw new RedirectException("imageBrowser.html?album=" + parentAlbum.getId());
}
+ String albumId = request.getHttpRequest().getParam("album");
+ Album album = webInterface.getCore().getAlbum(albumId, false);
+ if (album == null) {
+ throw new RedirectException("invalid.html");
+ }
+ templateContext.set("album", album);
}
}
Template deleteSoneTemplate = TemplateParser.parse(createReader("/templates/deleteSone.html"));
Template imageBrowserTemplate = TemplateParser.parse(createReader("/templates/imageBrowser.html"));
Template createAlbumTemplate = TemplateParser.parse(createReader("/templates/createAlbum.html"));
+ Template deleteAlbumTemplate = TemplateParser.parse(createReader("/templates/deleteAlbum.html"));
Template noPermissionTemplate = TemplateParser.parse(createReader("/templates/noPermission.html"));
Template optionsTemplate = TemplateParser.parse(createReader("/templates/options.html"));
Template aboutTemplate = TemplateParser.parse(createReader("/templates/about.html"));
pageToadlets.add(pageToadletFactory.createPageToadlet(new ImageBrowserPage(imageBrowserTemplate, this), "ImageBrowser"));
pageToadlets.add(pageToadletFactory.createPageToadlet(new CreateAlbumPage(createAlbumTemplate, this)));
pageToadlets.add(pageToadletFactory.createPageToadlet(new EditAlbumPage(emptyTemplate, this)));
- pageToadlets.add(pageToadletFactory.createPageToadlet(new DeleteAlbumPage(emptyTemplate, this)));
+ pageToadlets.add(pageToadletFactory.createPageToadlet(new DeleteAlbumPage(deleteAlbumTemplate, this)));
pageToadlets.add(pageToadletFactory.createPageToadlet(new UploadImagePage(invalidTemplate, this)));
pageToadlets.add(pageToadletFactory.createPageToadlet(new EditImagePage(emptyTemplate, this)));
pageToadlets.add(pageToadletFactory.createPageToadlet(new DeleteImagePage(emptyTemplate, this)));
Page.EditImage.Title=Edit Image
Page.DeleteImage.Title=Delete Image
Page.EditAlbum.Title=Edit Album
+
Page.DeleteAlbum.Title=Delete Album
+Page.DeleteAlbum.Page.Title=Delete Album
+Page.DeleteAlbum.Text.AlbumWillBeGone=This will remove your album “{title}”. Do you really want to do that?
+Page.DeleteAlbum.Button.Yes=Yes, delete album.
+Page.DeleteAlbum.Button.No=No, don’t delete album.
Page.Trust.Title=Trust Sone - Sone
--- /dev/null
+<%include include/head.html>
+
+ <h1><%= Page.DeleteAlbum.Page.Title|l10n|html></h1>
+
+ <p><%= Page.DeleteAlbum.Text.AlbumWillBeGone|l10n|replace needle="{title}" replacementKey=album.title|html></p>
+
+ <form method="post">
+ <input type="hidden" name="formPassword" value="<% formPassword|html>" />
+ <input type="hidden" name="album" value="<%album.id|html>" />
+ <button type="submit" name="confirmDelete" value="1"><%= Page.DeleteAlbum.Button.Yes|l10n|html></button>
+ <button type="submit" name="abortDelete" value="1"><%= Page.DeleteAlbum.Button.No|l10n|html></button>
+ </form>
+
+<%include include/tail.html>
</form>
<%if album.empty>
- <form id="delete-album" action="deleteAlbum.html" method="post">
- <input type="hidden" name="formPassword" value="<%formPassword|html>" />
+ <form id="delete-album" action="deleteAlbum.html" method="get">
<input type="hidden" name="album" value="<%album.id|html>" />
<button type="submit"><%= Page.ImageBrowser.Album.Button.Delete|l10n|html></button>
</form>