aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2017-01-11 13:24:00 +0000
committerSimon McVittie <smcv@debian.org>2017-01-11 18:11:21 +0000
commit2486d83706a48044c88d6ffc8501a63d60d190a4 (patch)
tree689d052941ac198b301670957e11f18107e8488e /IkiWiki
parentd157a97452ae0641f87996b6d0f21c9d222cef3d (diff)
downloadikiwiki-2486d83706a48044c88d6ffc8501a63d60d190a4.tar
ikiwiki-2486d83706a48044c88d6ffc8501a63d60d190a4.tar.gz
remove: make it clearer that repeated page parameter is OK here
ikiwiki's web interface does not currently have UI for removing multiple pages simultaneously, but the remove plugin is robust against doing so. Use a clearer idiom to make that obvious.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/remove.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm
index 6875844a3..859c39066 100644
--- a/IkiWiki/Plugin/remove.pm
+++ b/IkiWiki/Plugin/remove.pm
@@ -196,7 +196,9 @@ sub formbuilder (@) {
my $session=$params{session};
if ($form->submitted eq "Remove" && $form->field("do") eq "edit") {
- removal_confirm($q, $session, 0, $form->field("page"));
+ # deliberately taking multiple values of page
+ my @pages = $form->field("page");
+ removal_confirm($q, $session, 0, @pages);
}
elsif ($form->submitted eq "Remove Attachments") {
my @selected=map { Encode::decode_utf8($_) } $q->param("attachment_select");
@@ -216,14 +218,15 @@ sub sessioncgi ($$) {
my ($form, $buttons)=confirmation_form($q, $session);
IkiWiki::decode_form_utf8($form);
+ # deliberately taking multiple values of page
+ my @pages = $form->field("page");
+
if ($form->submitted eq 'Cancel') {
postremove($session);
}
elsif ($form->submitted eq 'Remove' && $form->validate) {
IkiWiki::checksessionexpiry($q, $session);
- my @pages=$form->field("page");
-
# Validate removal by checking that the page exists,
# and that the user is allowed to edit(/remove) it.
my @files;
@@ -288,7 +291,7 @@ sub sessioncgi ($$) {
}
}
else {
- removal_confirm($q, $session, 0, $form->field("page"));
+ removal_confirm($q, $session, 0, @pages);
}
exit 0;