--- loncom/lonnet/perl/lonnet.pm 2022/10/22 17:24:55 1.1497 +++ loncom/lonnet/perl/lonnet.pm 2022/11/05 06:00:07 1.1501 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1497 2022/10/22 17:24:55 raeburn Exp $ +# $Id: lonnet.pm,v 1.1501 2022/11/05 06:00:07 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2924,6 +2924,7 @@ sub get_dom_instcats { if (&auto_instcode_format($caller,$dom,\%coursecodes,\%codes, \@codetitles,\%cat_titles,\%cat_order) eq 'ok') { $instcats = { + totcodes => $totcodes, codes => \%codes, codetitles => \@codetitles, cat_titles => \%cat_titles, @@ -12468,7 +12469,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'}})) { @@ -12485,7 +12486,7 @@ sub count_supptools { } sub has_unhidden_suppfiles { - my ($cnum,$cdom,$ignorecache,$possdell)=@_; + my ($cnum,$cdom,$ignorecache,$possdel)=@_; my $hashid=$cnum.':'.$cdom; my ($showsupp,$cached); unless ($ignorecache) { @@ -12494,7 +12495,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,35 +12518,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 ($errors,%ids,%hidden); - $errors = - &Apache::loncommon::recurse_supplemental($cnum,$cdom, - 'supplemental.sequence', - $errors,$possdel,\%ids,\%hidden); - $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 #