summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-03-16 21:43:30 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-03-16 21:43:30 +0000
commit3a31d28970c54b00b0a161e6eb1bbb10a692802e (patch)
treef3243e3a339cc79abfd9a85e940bdada36673d26
parent44eefb7f22d946c70429cdba7a6c90f6ffcbb6d3 (diff)
ok, so we don't want to re-load page content into the form on preview..
-rwxr-xr-xikiwiki14
1 files changed, 8 insertions, 6 deletions
diff --git a/ikiwiki b/ikiwiki
index 0463ba15d..de7c60cc9 100755
--- a/ikiwiki
+++ b/ikiwiki
@@ -1079,14 +1079,16 @@ sub cgi_editpage ($$) { #{{{
$form->title("creating $page");
}
elsif ($form->field("do") eq "edit") {
- my $content="";
- if (exists $pagesources{lc($page)}) {
- $content=readfile("$config{srcdir}/$pagesources{lc($page)}");
- $content=~s/\n/\r\n/g;
+ if (! length $form->field('content')) {
+ my $content="";
+ if (exists $pagesources{lc($page)}) {
+ $content=readfile("$config{srcdir}/$pagesources{lc($page)}");
+ $content=~s/\n/\r\n/g;
+ }
+ $form->field(name => "content", value => $content,
+ force => 1);
}
$form->tmpl_param("page_select", 0);
- $form->field(name => "content", value => $content,
- force => 1);
$form->field(name => "page", type => 'hidden');
$form->title("editing $page");
}