[svn:p5ee] r13308 - p5ee/trunk/App-Widget/lib/App

[email protected] Fri, 11 Sep 2009 07:29:47 -0700 (PDT)
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
Author: spadkins
Date: Fri Sep 11 07:29:47 2009
New Revision: 13308

Modified:
   p5ee/trunk/App-Widget/lib/App/Widget.pm

Log:
added the action="$url" to the mainform <form> tag (includes PATH_INFO but not QUERY_STRING)

Modified: p5ee/trunk/App-Widget/lib/App/Widget.pm
==============================================================================
--- p5ee/trunk/App-Widget/lib/App/Widget.pm	(original)
+++ p5ee/trunk/App-Widget/lib/App/Widget.pm	Fri Sep 11 07:29:47 2009
@@ -214,6 +214,14 @@
     $context->get_messages();  # apparently, this also clears messages
     delete $self->{messages};
 
+    my ($request);
+    my $form_options = "";
+    if ($context->can("request")) {
+        my $request = $context->request();
+        my $url = $request->url();
+        $form_options .= " action=\"$url\"";
+    }
+
     my $content = <<EOF;
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -221,7 +229,7 @@
 <title>${title}</title>
 $context_head</head>
 <body${bodyoptions}>
-<form method="POST" id="mainform">
+<form method="POST" id="mainform"${form_options}>
 $session_html
 $event_placeholder
 $onload_support