ok, so we don't want to re-load page content into the form on preview..
parent
44eefb7f22
commit
3a31d28970
4
ikiwiki
4
ikiwiki
|
@ -1079,14 +1079,16 @@ sub cgi_editpage ($$) { #{{{
|
||||||
$form->title("creating $page");
|
$form->title("creating $page");
|
||||||
}
|
}
|
||||||
elsif ($form->field("do") eq "edit") {
|
elsif ($form->field("do") eq "edit") {
|
||||||
|
if (! length $form->field('content')) {
|
||||||
my $content="";
|
my $content="";
|
||||||
if (exists $pagesources{lc($page)}) {
|
if (exists $pagesources{lc($page)}) {
|
||||||
$content=readfile("$config{srcdir}/$pagesources{lc($page)}");
|
$content=readfile("$config{srcdir}/$pagesources{lc($page)}");
|
||||||
$content=~s/\n/\r\n/g;
|
$content=~s/\n/\r\n/g;
|
||||||
}
|
}
|
||||||
$form->tmpl_param("page_select", 0);
|
|
||||||
$form->field(name => "content", value => $content,
|
$form->field(name => "content", value => $content,
|
||||||
force => 1);
|
force => 1);
|
||||||
|
}
|
||||||
|
$form->tmpl_param("page_select", 0);
|
||||||
$form->field(name => "page", type => 'hidden');
|
$form->field(name => "page", type => 'hidden');
|
||||||
$form->title("editing $page");
|
$form->title("editing $page");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue