--- loncom/interface/loncommon.pm 2005/11/08 02:12:24 1.282 +++ loncom/interface/loncommon.pm 2005/11/10 18:05:47 1.287 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.282 2005/11/08 02:12:24 albertel Exp $ +# $Id: loncommon.pm,v 1.287 2005/11/10 18:05:47 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1149,7 +1149,7 @@ sub domain_select { } &get_domains; if ($multiple) { $domains{''}=&mt('Any domain'); - return &multiple_select_form($name,$value,4,%domains); + return &multiple_select_form($name,$value,4,\%domains); } else { return &select_form($name,$value,%domains); } @@ -1159,7 +1159,7 @@ sub domain_select { =pod -=item * multiple_select_form($name,$value,$size,%hash) +=item * multiple_select_form($name,$value,$size,$hash,$order) 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' + $hash - the elements should be 'option' => 'shown text' (shown text should already have been &mt()) + $order - (optional) array ref of the order to show the elments in + =cut #------------------------------------------- sub multiple_select_form { - my ($name,$value,$size,%hash)=@_; + my ($name,$value,$size,$hash,$order)=@_; 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; @@ -2529,7 +2533,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 @@ -2770,6 +2774,10 @@ sub bodytag { @@ -2878,7 +2886,7 @@ ENDROLE # return(< +
$upperleft $messages