--- loncom/interface/londocs.pm 2008/11/18 19:14:22 1.316 +++ loncom/interface/londocs.pm 2012/03/28 12:58:42 1.479 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.316 2008/11/18 19:14:22 jms Exp $ +# $Id: londocs.pm,v 1.479 2012/03/28 12:58:42 goltermann Exp $ # # Copyright Michigan State University Board of Trustees # @@ -26,22 +26,6 @@ # http://www.lon-capa.org/ # - -=head1 NAME - -Apache::londocs.pm - -=head1 SYNOPSIS - -This is part of the LearningOnline Network with CAPA project -described at http://www.lon-capa.org. - -=head1 SUBROUTINES - -=over - -=cut - package Apache::londocs; use strict; @@ -49,11 +33,13 @@ use Apache::Constants qw(:common :http); use Apache::imsexport; use Apache::lonnet; use Apache::loncommon; +use Apache::lonhtmlcommon; use LONCAPA::map(); use Apache::lonratedt(); use Apache::lonxml; use Apache::lonclonecourse; use Apache::lonnavmaps; +use Apache::lonnavdisplay(); use HTML::Entities; use GDBM_File; use Apache::lonlocal; @@ -70,26 +56,8 @@ my %alreadyseen=(); my $hadchanges; -=pod - -=item %help=() - - Available help topics - -=cut - my %help=(); -=pod - -=item mapread() - -Mapread read maps into LONCAPA::map:: global arrays -@order and @resources, determines status -sets @order - pointer to resources in right order -sets @resources - array with the resources with correct idx - -=cut sub mapread { my ($coursenum,$coursedom,$map)=@_; @@ -104,32 +72,25 @@ sub storemap { &LONCAPA::map::storemap('/uploaded/'.$coursedom.'/'.$coursenum.'/'. $map,1); if ($errtext) { return ($errtext,2); } - + $hadchanges=1; return ($errtext,0); } -=pod - -=item authorhosts() - - Return hash with valid author names - -=cut sub authorhosts { my %outhash=(); my $home=0; my $other=0; - foreach (keys %env) { - if ($_=~/^user\.role\.(au|ca)\.(.+)$/) { + foreach my $key (keys(%env)) { + if ($key=~/^user\.role\.(au|ca)\.(.+)$/) { my $role=$1; my $realm=$2; - my ($start,$end)=split(/\./,$env{$_}); + my ($start,$end)=split(/\./,$env{$key}); if (($start) && ($start>time)) { next; } if (($end) && (time>$end)) { next; } - my $ca; my $cd; + my ($ca,$cd); if ($1 eq 'au') { $ca=$env{'user.name'}; $cd=$env{'user.domain'}; @@ -151,52 +112,43 @@ sub authorhosts { } return ($home,$other,%outhash); } -=pod -=item dumpbutton() - - Generate "dump" button - -=cut sub dumpbutton { my ($home,$other,%outhash)=&authorhosts(); - my $type = &Apache::loncommon::course_type(); + my $crstype = &Apache::loncommon::course_type(); if ($home+$other==0) { return ''; } if ($home) { - return '