--- loncom/interface/loncommon.pm 2005/11/01 20:47:15 1.281 +++ loncom/interface/loncommon.pm 2005/11/08 03:08:15 1.283 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.281 2005/11/01 20:47:15 albertel Exp $ +# $Id: loncommon.pm,v 1.283 2005/11/08 03:08:15 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1155,21 +1155,40 @@ sub domain_select { } } +#------------------------------------------- + +=pod + +=item * multiple_select_form($name,$value,$size,%hash) + +Returns a string containing a element + $value - sclara or array ref of values that should already be selected + $size - number of rows long the select element is + $hash - the elements should be 'option' => 'shown text' + (shown text should already have been &mt()) + +=cut + +#------------------------------------------- sub multiple_select_form { - my ($name,$value,$size,%hash)=@_; + my ($name,$value,$size,$hash)=@_; my %selected = map { $_ => 1 } ref($value)?@{$value}:($value); my $output=''; if (! defined($size)) { $size = 4; - if (scalar(keys(%hash))<4) { - $size = scalar(keys(%hash)); + if (scalar(keys(%$hash))<4) { + $size = scalar(keys(%$hash)); } } $output.="\n\n"; return $output; @@ -2511,7 +2530,7 @@ sub pgrdlink { Inputs: $text $uname $udom $symb $target Returns: A link to parmset.pm such as to see the PPRM view of a -student andn resource +student and a specific resource =cut