print misctemplate($form->title, $form->render(submit => $buttons), @_);
}
+# Like showform, but the base url will be set to allow edit previews
+# that use links relative to the specified page.
+sub showform_preview ($$$$;@) {
+ my $form=shift;
+ my $buttons=shift;
+ my $session=shift;
+ my $cgi=shift;
+ my %params=@_;
+
+ # The base url needs to be a full URL, and urlto may return a path.
+ my $baseurl = urlabs(urlto($params{page}), $cgi->url);
+
+ showform($form, $buttons, $session, $cgi, @_,
+ forcebaseurl => $baseurl);
+}
+
sub redirect ($$) {
my $q=shift;
eval q{use URI};
- my $url=URI->new(shift);
+ my $url=URI->new(urlabs(shift, $q->url));
if (! $config{w3mmode}) {
print $q->redirect($url);
}