+# 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 = absurl(urlto($params{page}), $cgi->url);
+
+ showform($form, $buttons, $session, $cgi, @_,
+ forcebaseurl => $baseurl);
+}
+
+# Forces a partial url (path only) to absolute, using the same
+# URL scheme as the CGI. Full URLs are left unchanged.
+sub absurl ($$) {
+ my $partialurl=shift;