diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-03-16 21:43:30 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-03-16 21:43:30 +0000 |
commit | 3a31d28970c54b00b0a161e6eb1bbb10a692802e (patch) | |
tree | f3243e3a339cc79abfd9a85e940bdada36673d26 /ikiwiki | |
parent | 44eefb7f22d946c70429cdba7a6c90f6ffcbb6d3 (diff) |
ok, so we don't want to re-load page content into the form on preview..
Diffstat (limited to 'ikiwiki')
-rwxr-xr-x | ikiwiki | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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"); } |