Diff for /loncom/interface/loncommon.pm between versions 1.779 and 1.780

version 1.779, 2009/03/26 14:59:10 version 1.780, 2009/03/27 02:14:43
Line 7017  If the user's status includes multiple t Line 7017  If the user's status includes multiple t
 the largest default quota which applies to the user determines the  the largest default quota which applies to the user determines the
 default quota returned.  default quota returned.
   
   =back
   
 =cut  =cut
   
 ###############################################  ###############################################
Line 7565  sub get_institutional_codes { Line 7567  sub get_institutional_codes {
   
 =pod  =pod
   
   =head1 Slot Helpers
   
   =over 4
   
   =item * sorted_slots()
   
   Sorts an array of slot names in order of slot start time (earliest first). 
   
   Inputs:
   
   =over 4
   
   slotsarr  - Reference to array of unsorted slot names.
   
   slots     - Reference to hash of hash, where outer hash keys are slot names.
   
   =back
   
   Returns:
   
   =over 4
   
   sorted   - An array of slot names sorted by the start time of the slot.
   
   =back
   
 =back  =back
   
   =cut
   
   
   sub sorted_slots {
       my ($slotsarr,$slots) = @_;
       my @sorted;
       if ((ref($slotsarr) eq 'ARRAY') && (ref($slots) eq 'HASH')) {
           @sorted =
               sort {
                        if (ref($slots->{$a}) && ref($slots->{$b})) {
                            return $slots->{$a}{'starttime'} <=> $slots->{$b}{'starttime'}
                        }
                        if (ref($slots->{$a})) { return -1;}
                        if (ref($slots->{$b})) { return 1;}
                        return 0;
                    } @{$slotsarr};
       }
       return @sorted;
   }
   
   
   =pod
   
 =head1 HTTP Helpers  =head1 HTTP Helpers
   
 =over 4  =over 4

Removed from v.1.779  
changed lines
  Added in v.1.780


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