aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/remove.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-10-02 12:53:53 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-10-02 12:53:53 -0400
commit3b47dae9ca03b31cf5915c0d12215883fe2c32c1 (patch)
tree349d17cb1dd470b0545882d615fa7b35f3575cde /IkiWiki/Plugin/remove.pm
parentc9459523813052ee187bdad1c8594ae114bece62 (diff)
downloadikiwiki-3b47dae9ca03b31cf5915c0d12215883fe2c32c1.tar
ikiwiki-3b47dae9ca03b31cf5915c0d12215883fe2c32c1.tar.gz
remove, rename: Allow acting on attachments as a page is being created.
Diffstat (limited to 'IkiWiki/Plugin/remove.pm')
-rw-r--r--IkiWiki/Plugin/remove.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm
index c8d76368e..cf95026c8 100644
--- a/IkiWiki/Plugin/remove.pm
+++ b/IkiWiki/Plugin/remove.pm
@@ -61,9 +61,10 @@ sub formbuilder_setup (@) { #{{{
my $form=$params{form};
my $q=$params{cgi};
- if (defined $form->field("do") && $form->field("do") eq "edit") {
+ if (defined $form->field("do") && ($form->field("do") eq "edit" ||
+ $form->field("do") eq "create")) {
# Removal button for the page, and also for attachments.
- push @{$params{buttons}}, "Remove";
+ push @{$params{buttons}}, "Remove" if $form->field("do") eq "edit";
$form->tmpl_param("field-remove" => '<input name="_submit" type="submit" value="Remove Attachments" />');
}
} #}}}
@@ -135,11 +136,12 @@ sub formbuilder (@) { #{{{
my %params=@_;
my $form=$params{form};
- if (defined $form->field("do") && $form->field("do") eq "edit") {
+ if (defined $form->field("do") && ($form->field("do") eq "edit" ||
+ $form->field("do") eq "create")) {
my $q=$params{cgi};
my $session=$params{session};
- if ($form->submitted eq "Remove") {
+ if ($form->submitted eq "Remove" && $form->field("do") eq "edit") {
removal_confirm($q, $session, 0, $form->field("page"));
}
elsif ($form->submitted eq "Remove Attachments") {