[interchange-cvs] interchange - heins modified lib/Vend/Form.pm

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Sun Feb 3 23:20:00 2002


User:      heins
Date:      2002-02-04 04:19:46 GMT
Modified:  lib/Vend Form.pm
Log:
	* Recognize explicit "multiple" type.

Revision  Changes    Path
2.9       +8 -4      interchange/lib/Vend/Form.pm


rev 2.9, prev_rev 2.8
Index: Form.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Form.pm,v
retrieving revision 2.8
retrieving revision 2.9
diff -u -r2.8 -r2.9
--- Form.pm	4 Feb 2002 01:31:17 -0000	2.8
+++ Form.pm	4 Feb 2002 04:19:46 -0000	2.9
@@ -1,6 +1,6 @@
 # Vend::Form - Generate Form widgets
 # 
-# $Id: Form.pm,v 2.8 2002/02/04 01:31:17 mheins Exp $
+# $Id: Form.pm,v 2.9 2002/02/04 04:19:46 mheins Exp $
 #
 # Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -36,7 +36,7 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 2.8 $, 10);
+$VERSION = substr(q$Revision: 2.9 $, 10);
 
 @EXPORT = qw (
 	display
@@ -559,6 +559,7 @@
 sub dropdown {
 	my($opt, $opts) = @_;
 #::logDebug("called select opt=" . ::uneval($opt) . "\nopts=" . ::uneval($opts));
+	$opt->{multiple} = 1 if $opt->{type} eq 'multiple';
 
 	$opts ||= [];
 
@@ -936,6 +937,8 @@
 	#            in $opt
 	my $type = parse_type($opt);
 
+#::logDebug("type=$type");
+
 	my $look;
 
 	if($opt->{passed}) {
@@ -957,7 +960,7 @@
 		$data ||= [];
 	}
 	elsif($look = $opt->{lookup}) {
-::logDebug("lookup called, opt=" . uneval($opt));
+#::logDebug("lookup called, opt=" . uneval($opt));
 		LOOK: {
 			my $tab = $opt->{db} || $opt->{table} || $Vend::Cfg->{ProductFiles}[0];
 			my $db = Vend::Data::database_exists_ref($tab)
@@ -1066,6 +1069,7 @@
 		display     => \&current_label,
 		links		=> \&links,
 		movecombo	=> \&movecombo,
+		multiple    => \&dropdown,
 		noyes		=> \&noyes,
 		option_format => \&option_widget,
 		options     => \&show_options,
@@ -1097,7 +1101,7 @@
 			|| $daction{default};
 
 	if($opt->{variant}) {
-::logDebug("variant='$opt->{variant}'");
+#::logDebug("variant='$opt->{variant}'");
 		$opt->{subwidget}	=  $Vend::UserWidget->{$opt->{variant}}
 							|| $daction{$opt->{variant}}
 							|| $daction{default};