Diff for /loncom/interface/loncommon.pm between versions 1.282 and 1.283

version 1.282, 2005/11/08 02:12:24 version 1.283, 2005/11/08 03:08:15
Line 1168  Args: Line 1168  Args:
   $name - name of the <select> element    $name - name of the <select> element
   $value - sclara or array ref of values that should already be selected    $value - sclara or array ref of values that should already be selected
   $size - number of rows long the select element is    $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())            (shown text should already have been &mt())
   
 =cut  =cut
   
 #-------------------------------------------  #-------------------------------------------
 sub multiple_select_form {  sub multiple_select_form {
     my ($name,$value,$size,%hash)=@_;      my ($name,$value,$size,$hash)=@_;
     my %selected = map { $_ => 1 } ref($value)?@{$value}:($value);      my %selected = map { $_ => 1 } ref($value)?@{$value}:($value);
     my $output='';      my $output='';
     if (! defined($size)) {      if (! defined($size)) {
         $size = 4;          $size = 4;
         if (scalar(keys(%hash))<4) {          if (scalar(keys(%$hash))<4) {
             $size = scalar(keys(%hash));              $size = scalar(keys(%$hash));
         }          }
     }      }
     $output.="\n<select name='$name' size='$size' multiple='1'>";      $output.="\n<select name='$name' size='$size' multiple='1'>";
     foreach (sort(keys(%hash))) {      foreach (sort(keys(%$hash))) {
         $output.='<option value="'.$_.'" ';          $output.='<option value="'.$_.'" ';
         $output.='selected="selected" ' if ($selected{$_});          $output.='selected="selected" ' if ($selected{$_});
         $output.='>'.$hash{$_}."</option>\n";          $output.='>'.$hash->{$_}."</option>\n";
     }      }
     $output.="</select>\n";      $output.="</select>\n";
     return $output;      return $output;
Line 2529  sub pgrdlink { Line 2530  sub pgrdlink {
 Inputs: $text $uname $udom $symb $target  Inputs: $text $uname $udom $symb $target
   
 Returns: A link to parmset.pm such as to see the PPRM view of a  Returns: A link to parmset.pm such as to see the PPRM view of a
 student andn resource  student and a specific resource
   
 =cut  =cut
   

Removed from v.1.282  
changed lines
  Added in v.1.283


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>