- $form->field(name => "do", type => 'hidden');
- $form->field(name => "from", type => 'hidden');
- $form->field(name => "rcsinfo", type => 'hidden');
- $form->field(name => "subpage", type => 'hidden');
- $form->field(name => "page", value => $page, force => 1);
- $form->field(name => "type", value => $type, force => 1);
- $form->field(name => "comments", type => "text", size => 80);
- $form->field(name => "editcontent", type => "textarea", rows => 20,
- cols => 80);
- $form->tmpl_param("can_commit", $config{rcs});
- $form->tmpl_param("indexlink", indexlink());
- $form->tmpl_param("helponformattinglink",
- htmllink("", "", "HelpOnFormatting", 1));
- $form->tmpl_param("baseurl", baseurl());
- if (! $form->submitted) {
- $form->field(name => "rcsinfo", value => rcs_prepedit($file),
- force => 1);
- }
-
- if ($form->submitted eq "Cancel") {
- if ($newfile && defined $from) {
- redirect($q, "$config{url}/".htmlpage($from));
- }
- elsif ($newfile) {
- redirect($q, $config{url});
- }
- else {
- redirect($q, "$config{url}/".htmlpage($page));
- }
- return;
- }
- elsif ($form->submitted eq "Preview") {
- my $content=$form->field('editcontent');
- my $comments=$form->field('comments');
- $form->field(name => "editcontent",
- value => $content, force => 1);
- $form->field(name => "comments",
- value => $comments, force => 1);
- $config{rss}=$config{atom}=0; # avoid preview writing a feed!
- $form->tmpl_param("page_preview",
- htmlize($page, $type,
- linkify($page, "",
- preprocess($page, $page,
- filter($page, $content)))));
- }
- else {
- $form->tmpl_param("page_preview", "");