save attachments when page is saved too
A user might specify an attachment, but not click the upload button, and just save the whole page instead.master
parent
1405006fbf
commit
14cb2b0869
|
@ -52,7 +52,7 @@ sub formbuilder (@) { #{{{
|
||||||
|
|
||||||
return if $form->field("do") ne "edit";
|
return if $form->field("do") ne "edit";
|
||||||
|
|
||||||
if ($form->submitted eq "Upload") {
|
if ($form->submitted eq "Upload" || $form->submitted eq "Save Page") {
|
||||||
my $q=$params{cgi};
|
my $q=$params{cgi};
|
||||||
my $session=$params{session};
|
my $session=$params{session};
|
||||||
|
|
||||||
|
@ -112,7 +112,6 @@ sub formbuilder (@) { #{{{
|
||||||
error("failed to get filehandle");
|
error("failed to get filehandle");
|
||||||
}
|
}
|
||||||
binmode($fh);
|
binmode($fh);
|
||||||
print STDERR "copying $filename\n";
|
|
||||||
writefile($filename, $config{srcdir}, undef, 1, sub {
|
writefile($filename, $config{srcdir}, undef, 1, sub {
|
||||||
IkiWiki::fast_file_copy($tempfile, $filename, $fh, @_);
|
IkiWiki::fast_file_copy($tempfile, $filename, $fh, @_);
|
||||||
});
|
});
|
||||||
|
@ -128,7 +127,6 @@ sub formbuilder (@) { #{{{
|
||||||
IkiWiki::enable_commit_hook();
|
IkiWiki::enable_commit_hook();
|
||||||
IkiWiki::rcs_update();
|
IkiWiki::rcs_update();
|
||||||
}
|
}
|
||||||
print STDERR "refreshing\n";
|
|
||||||
IkiWiki::refresh();
|
IkiWiki::refresh();
|
||||||
IkiWiki::saveindex();
|
IkiWiki::saveindex();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue