summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-10-02 12:48:06 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-10-02 12:48:06 -0400
commitc9459523813052ee187bdad1c8594ae114bece62 (patch)
tree602f82a24bd0d91d1fd4940814cacf83c1727cfb /IkiWiki
parente0fd02acf1d40d8f049a7f470e07eebad28cab3d (diff)
attachment: Support adding attachments to pages even as they are being created.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/attachment.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm
index 837992841..2d1fe51cf 100644
--- a/IkiWiki/Plugin/attachment.pm
+++ b/IkiWiki/Plugin/attachment.pm
@@ -94,7 +94,8 @@ 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")) {
# Add attachment field, set type to multipart.
$form->enctype(&CGI::MULTIPART);
$form->field(name => 'attachment', type => 'file');
@@ -158,7 +159,7 @@ sub formbuilder (@) { #{{{
my $form=$params{form};
my $q=$params{cgi};
- return if ! defined $form->field("do") || $form->field("do") ne "edit";
+ return if ! defined $form->field("do") || ($form->field("do") ne "edit" && $form->field("do") ne "create") ;
my $filename=$q->param('attachment');
if (defined $filename && length $filename &&