Diff for /loncom/interface/loncommon.pm between versions 1.168 and 1.169

version 1.168, 2003/12/30 20:47:23 version 1.169, 2004/01/02 19:23:47
Line 726  sub get_domains { Line 726  sub get_domains {
     my @domains;      my @domains;
     my %seen;      my %seen;
     foreach (sort values(%Apache::lonnet::hostdom)) {      foreach (sort values(%Apache::lonnet::hostdom)) {
         push (@domains,$_) unless $seen{$_}++;   push (@domains,$_) unless $seen{$_}++;
     }      }
     return @domains;      return @domains;
 }  }
   
   # ------------------------------------------
   
   sub domain_select {
       my ($name,$value,$multiple)=@_;
       my %domains=map { 
    $_ => $_.' '.$Apache::lonnet::domaindescription{$_} 
       } &get_domains;
       if ($multiple) {
    $domains{''}=&mt('Any domain');
    return &multiple_select_form($name,$value,%domains);
       } else {
    return &select_form($name,$value,%domains);
       }
   }
   
   sub multiple_select_form {
       my ($name,$value,%hash)=@_;
       my %selected = map { $_ => 1 } ref($value)?@{$value}:($value);
       my $output='';
       my $size =(scalar keys %hash<4?scalar keys %hash:4);
       $output.="\n<select name='$name' size='$size' multiple='1'>";
       foreach (sort keys %hash) {
           $output.="<option name='$_'".
               ($selected{$_}?' selected="1"' :'').">$hash{$_}</option>\n";
       }
       $output.="</select>\n";
       return $output;
   }
   
 #-------------------------------------------  #-------------------------------------------
   
 =pod  =pod
Line 1641  sub fileembstyle { Line 1670  sub fileembstyle {
     return $fe{lc(shift(@_))};      return $fe{lc(shift(@_))};
 }  }
   
   
   sub filecategoryselect {
       my ($name,$value)=@_;
       return &select_form($name,$value,
    '' => &mt('Any category'),
    map { $_,$_ } sort(keys(%category_extensions)));
   }
   
 =pod  =pod
   
 =item * filedescription()   =item * filedescription() 

Removed from v.1.168  
changed lines
  Added in v.1.169


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