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

Stefan Hornburg racke at rt.icdevgroup.org
Thu Jan 29 13:26:05 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  8498fd1e0fa4f3c849bdf5011c8a77727cef3968 (commit)
       via  1bc7123358a02c4089871a2002715832307f0900 (commit)
      from  3238de4495d6fa260f860afbcd4ad76b50130052 (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 8498fd1e0fa4f3c849bdf5011c8a77727cef3968
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Thu Jan 29 14:25:36 2009 +0100

    theme_form_element_field theme function added

commit 1bc7123358a02c4089871a2002715832307f0900
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Thu Jan 29 13:54:16 2009 +0100

    debug statement removed

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

Summary of changes and diff:
 code/form.tag                     |   21 ++++++++++-----------
 code/theme_form_element_field.sub |   26 ++++++++++++++++++++++++++
 code/theme_form_element_label.sub |    1 -
 3 files changed, 36 insertions(+), 12 deletions(-)
 create mode 100644 code/theme_form_element_field.sub

diff --git a/code/form.tag b/code/form.tag
index 947b717..0e70d6e 100644
--- a/code/form.tag
+++ b/code/form.tag
@@ -173,19 +173,18 @@ sub {
 			if ($elref->{label} =~ /\S/) {
 				$label = "$elref->{label}$append$opt->{appendlabel}";
 			}
-			push (@out_fields, theme('form_element_label', $elref->{name}, $label));
-			push (@out_fields, $Tag->display({name => $elref->{name},
-									   type => $elref->{widget} || 'text',
-									   value => $value,
-									   class => $required ? 'required' : '',
-									   form_name => $form_name,
-									   %attributes}));
+
 			my $error = $Tag->error({name => $elref->{name},
-								show_error => 1});
+				show_error => 1});
 
-			if ($error) {
-				push (@out_fields, qq{<span class="errors">$error</span>});
-			}
+			push (@out_fields, theme('form_element_label', $elref->{name}, $label));
+			push (@out_fields, theme('form_element_field', $elref->{name},
+				   	$elref->{widget} || 'text',
+					$value,
+					{class => $required ? 'required' : '',
+					form_name => $form_name,
+					error => $error,
+					%attributes}));
 
 			push (@out_fields, '<br/>');
 		}
diff --git a/code/theme_form_element_field.sub b/code/theme_form_element_field.sub
new file mode 100644
index 0000000..1a63d29
--- /dev/null
+++ b/code/theme_form_element_field.sub
@@ -0,0 +1,26 @@
+#
+# Parameters are:
+#
+# name - Element name
+# type - Element type
+# value - Element value
+# attributes - Hash with attributes
+
+Sub theme_form_element_field <<EOS
+sub {
+	my ($name, $type, $value, $attributes) = @_;
+	my ($out);
+
+	$out = $Tag->display({name => $name,
+					   	type => $type,
+					   	value => $value,
+						%$attributes});
+
+	if ($attributes->{error}) {
+		$out .= qq{<span class="errors">$attributes->{error}</span>};
+	}
+
+	return $out;
+}
+EOS
+
diff --git a/code/theme_form_element_label.sub b/code/theme_form_element_label.sub
index d0c4e8e..cc92208 100644
--- a/code/theme_form_element_label.sub
+++ b/code/theme_form_element_label.sub
@@ -7,7 +7,6 @@
 Sub theme_form_element_label <<EOS 
 sub {
 	my ($name, $label) = @_;
-Log("TFEL: $name $label");
 	return qq{<label for="$name">$label</label>};
 }
 EOS


hooks/post-receive
-- 
Interchange wellwell catalog



More information about the wellwell-devel mailing list