X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/e9e75f5f29d78b0631f98d9b0fa93184fcb181fe..4af4d26582f0c2b915d7102fb4a604b176385748:/IkiWiki/Plugin/remove.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm index 2e3614cca..3c1e0c713 100644 --- a/IkiWiki/Plugin/remove.pm +++ b/IkiWiki/Plugin/remove.pm @@ -51,14 +51,14 @@ sub check_canremove ($$$) { IkiWiki::Plugin::attachment::check_canattach($session, $page, $file); } else { - error("renaming of attachments is not allowed"); + error("removal of attachments is not allowed"); } } my $canremove; IkiWiki::run_hooks(canremove => sub { return if defined $canremove; - my $ret=shift->($page, $q, $session); + my $ret=shift->(page => $page, cgi => $q, session => $session); if (defined $ret) { if ($ret eq "") { $canremove=1; @@ -73,7 +73,6 @@ sub check_canremove ($$$) { } } }); - return $canremove; } sub formbuilder_setup (@) { @@ -167,7 +166,7 @@ sub formbuilder (@) { removal_confirm($q, $session, 0, $form->field("page")); } elsif ($form->submitted eq "Remove Attachments") { - my @selected=$q->param("attachment_select"); + my @selected=map { Encode::decode_utf8($_) } $q->param("attachment_select"); if (! @selected) { error(gettext("Please select the attachments to remove.")); } @@ -188,7 +187,7 @@ sub sessioncgi ($$) { postremove($session); } elsif ($form->submitted eq 'Remove' && $form->validate) { - my @pages=$q->param("page"); + my @pages=$form->field("page"); # Validate removal by checking that the page exists, # and that the user is allowed to edit(/remove) it. @@ -238,7 +237,7 @@ sub sessioncgi ($$) { } } else { - IkiWiki::showform($form, $buttons, $session, $q); + removal_confirm($q, $session, 0, $form->field("page")); } exit 0;