--- loncom/lonnet/perl/lonnet.pm 2013/08/06 23:17:39 1.1235 +++ loncom/lonnet/perl/lonnet.pm 2013/08/07 00:03:33 1.1236 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1235 2013/08/06 23:17:39 raeburn Exp $ +# $Id: lonnet.pm,v 1.1236 2013/08/07 00:03:33 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -9637,6 +9637,26 @@ sub resdata { return undef; } +sub get_numsuppfiles { + my ($cnum,$cdom,$ignorecache)=@_; + my $hashid=$cnum.':'.$cdom; + my ($suppcount,$cached); + unless ($ignorecache) { + ($suppcount,$cached) = &is_cached_new('suppcount',$hashid); + } + unless (defined($cached)) { + my $chome=&homeserver($cnum,$cdom); + unless ($chome eq 'no_host') { + ($suppcount,my $errors) = (0,0); + my $suppmap = 'supplemental.sequence'; + ($suppcount,$errors) = + &Apache::loncommon::recurse_supplemental($cnum,$cdom,$suppmap,$suppcount,$errors); + } + &do_cache_new('suppcount',$hashid,$suppcount,600); + } + return $suppcount; +} + # # EXT resource caching routines # @@ -12862,6 +12882,10 @@ data base, returning a hash that is keye values that are the resource value. I believe that the timestamps and versions are also returned. +get_numsuppfiles($cnum,$cdom) : retrieve number of files in a course's +supplemental content area. This routine caches the number of files for +10 minutes. + =back =head2 Course Modification