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

Stefan Hornburg racke at rt.icdevgroup.org
Sun Mar 28 10:02:13 UTC 2010


       via  b87eabc943487244da1c131c30a42802e84dc8d5 (commit)
      from  dc45c5a8649f8ae84d6b1382cc6ece8c2a4ee3fc (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 b87eabc943487244da1c131c30a42802e84dc8d5
Author: Ton Verhagen <tverhagen at alamerce.nl>
Date:   Sun Mar 28 12:01:49 2010 +0200

    new options type and separate_items for selecting input element and
    adding mv_separate_items to the form

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

Summary of changes and diff:
 code/product_order.tag |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/code/product_order.tag b/code/product_order.tag
index a32288a..c69dc3e 100644
--- a/code/product_order.tag
+++ b/code/product_order.tag
@@ -3,13 +3,17 @@ UserTag product_order AddAttr
 UserTag product_order Routine <<EOR
 sub {
 	my ($sku, $qty, $opt) = @_;
-	my ($class, $qty_el, $qty_class, $text, $form, $sid, $action);
+	my ($class, $qty_el, $qty_class, $text, $form, $sid, $action, $button, $type, $separate_items, $separate_el);
 
 	$class = $opt->{class} || 'cart';
 
+	$type = $opt->{type} || 'button';
+
+	$separate_items = $opt->{separate_items} || 0;
+
 	if ($qty) {
 		$qty_class = $opt->{qty_class} || 'cart';
-		$qty_el = qq{<input name="mv_order_quantity" class="$qty_class" value="$qty" size="2">};
+		$qty_el = qq{<input name="mv_order_quantity" class="$qty_class" value="$qty" size="2" />};
 	}
 	else {
 		$qty_el = '';
@@ -21,13 +25,22 @@ sub {
 	$sid = $Tag->form_session_id();
 	$action = $Tag->area({href => $Config->{Special}->{order}, match_security => 1});
 
+	$button = $type eq 'button'
+			?
+			qq{<button class="$class" type="submit"><span>$text</span></button>}
+			:
+			qq{<input type="submit" class="$class" value="$text" />};
+
+	$separate_el = qq{<input type="hidden" name="mv_separate_items" value="$separate_items" />} if defined $opt->{separate_items};
+
 	$form = <<EOF;
 <form action="$action" method="post">
 $sid
-<input type="hidden" name="mv_action" value="refresh">
-<input type="hidden" name="mv_order_item" value="$sku">
+<input type="hidden" name="mv_action" value="refresh" />
+<input type="hidden" name="mv_order_item" value="$sku" />
+$separate_el
 $qty_el
-<button class="$class" type="submit"><span>$text</span></button>
+$button
 </form>
 EOF
 


hooks/post-receive
-- 
Interchange wellwell catalog



More information about the wellwell-devel mailing list