[wellwell-devel] [SCM] Interchange wellwell catalog branch, master, updated. ec313b5be3a0d100dab51a7e7886b38145f1ac5c

Stefan Hornburg racke at rt.icdevgroup.org
Tue Apr 7 12:03:09 UTC 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Interchange wellwell catalog".

The branch, master has been updated
       via  ec313b5be3a0d100dab51a7e7886b38145f1ac5c (commit)
      from  7197bc592453a1aa6476bc37c35877ed01083a2f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ec313b5be3a0d100dab51a7e7886b38145f1ac5c
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Tue Apr 7 14:02:42 2009 +0200

    allow load hook to bounce instead of displaying the form

-----------------------------------------------------------------------

Summary of changes and diff:
 README           |   12 ++++++++++++
 code/compose.tag |    6 ++++++
 code/form.tag    |    5 +++++
 3 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/README b/README
index d1f9ab2..5369433 100755
--- a/README
+++ b/README
@@ -181,9 +181,21 @@ form_NAME_save (e.g. form_checkout_save)
 
 The first parameter for the hook sub is the part name.
 
+Load
+....
+
 The load hook is called for the setup of a form part. It is not
 called if the profile check for the form part has been failed.
 
+The return value of the load hook is either a false value or
+a hash reference which can contain the following members:
+
+page	triggers a bounce to that page instead of displaying
+        the form
+
+Save
+....
+
 The save hook is called if the form part has been successfully
 submitted (e.g. profile check successful).
 
diff --git a/code/compose.tag b/code/compose.tag
index 3009b13..66b696e 100644
--- a/code/compose.tag
+++ b/code/compose.tag
@@ -46,6 +46,12 @@ sub {
 					template => $forms{$k}->{template}});
 			}
 		}
+
+		# form bounce to another page
+		if ($Scratch->{form_series_bounce}) {
+			$Tag->deliver({location => $Tag->area($Scratch->{form_series_bounce}), status => '302 move temporarily'});
+			return;
+		}
 	}
 
 	$opt->{body} ||= $body;
diff --git a/code/form.tag b/code/form.tag
index bff6f3c..3e987d9 100644
--- a/code/form.tag
+++ b/code/form.tag
@@ -116,6 +116,11 @@ sub {
 
 				if ($hooksub) {
 					$hookret = $hooksub->($_->{part});
+
+					if ($hookret && $hookret->{page}) {
+						$Tag->tmp('form_series_bounce', $hookret->{page});
+						return;
+					}
 				}
 				else {
 					Log("Hook $hook not found.");


hooks/post-receive
-- 
Interchange wellwell catalog



More information about the wellwell-devel mailing list