--- loncom/lonnet/perl/lonnet.pm 2022/10/22 21:13:47 1.1499 +++ loncom/lonnet/perl/lonnet.pm 2022/10/29 18:13:29 1.1500 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1499 2022/10/22 21:13:47 raeburn Exp $ +# $Id: lonnet.pm,v 1.1500 2022/10/29 18:13:29 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -12468,7 +12468,7 @@ sub count_supptools { my $chome=&homeserver($cnum,$cdom); $numexttools = 0; unless ($chome eq 'no_host') { - my ($supplemental) = &get_supplemental($cnum,$cdom,$reload); + my ($supplemental) = &Apache::loncommon::get_supplemental($cnum,$cdom,$reload); if (ref($supplemental) eq 'HASH') { if ((ref($supplemental->{'ids'}) eq 'HASH') && (ref($supplemental->{'hidden'}) eq 'HASH')) { foreach my $key (keys(%{$supplemental->{'ids'}})) { @@ -12494,7 +12494,7 @@ sub has_unhidden_suppfiles { unless (defined($cached)) { my $chome=&homeserver($cnum,$cdom); unless ($chome eq 'no_host') { - my ($supplemental) = &get_supplemental($cnum,$cdom,$ignorecache,$possdel); + my ($supplemental) = &Apache::loncommon::get_supplemental($cnum,$cdom,$ignorecache,$possdel); if (ref($supplemental) eq 'HASH') { if ((ref($supplemental->{'ids'}) eq 'HASH') && (ref($supplemental->{'hidden'}) eq 'HASH')) { foreach my $key (keys(%{$supplemental->{'ids'}})) { @@ -12517,43 +12517,6 @@ sub has_unhidden_suppfiles { return $showsupp; } -sub get_supplemental { - my ($cnum,$cdom,$ignorecache,$possdel)=@_; - my $hashid=$cnum.':'.$cdom; - my ($supplemental,$cached,$set_httprefs); - unless ($ignorecache) { - ($supplemental,$cached) = &is_cached_new('supplemental',$hashid); - } - unless (defined($cached)) { - my $chome=&homeserver($cnum,$cdom); - unless ($chome eq 'no_host') { - my @order = @LONCAPA::map::order; - my @resources = @LONCAPA::map::resources; - my @resparms = @LONCAPA::map::resparms; - my @zombies = @LONCAPA::map::zombies; - my ($errors,%ids,%hidden); - $errors = - &Apache::loncommon::recurse_supplemental($cnum,$cdom, - 'supplemental.sequence', - $errors,$possdel,\%ids,\%hidden); - @LONCAPA::map::order = @order; - @LONCAPA::map::resources = @resources; - @LONCAPA::map::resparms = @resparms; - @LONCAPA::map::zombies = @zombies; - $set_httprefs = 1; - if ($env{'request.course.id'} eq $cdom.'_'.$cnum) { - &Apache::lonnet::appenv({'request.course.suppupdated' => time}); - } - $supplemental = { - ids => \%ids, - hidden => \%hidden, - }; - &do_cache_new('supplemental',$hashid,$supplemental,600); - } - } - return ($supplemental,$set_httprefs); -} - # # EXT resource caching routines #