--- loncom/interface/londocs.pm 2006/05/30 20:09:25 1.229 +++ loncom/interface/londocs.pm 2007/07/14 00:50:24 1.293 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.229 2006/05/30 20:09:25 raeburn Exp $ +# $Id: londocs.pm,v 1.293 2007/07/14 00:50:24 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,17 +33,16 @@ use Apache::Constants qw(:common :http); use Apache::imsexport; use Apache::lonnet; use Apache::loncommon; -use Apache::lonratedt; -use Apache::lonratsrv; +use LONCAPA::map(); +use Apache::lonratedt(); use Apache::lonxml; -use Apache::loncreatecourse; +use Apache::lonclonecourse; use Apache::lonnavmaps; use HTML::Entities; use GDBM_File; use Apache::lonlocal; use Cwd; -use lib '/home/httpd/lib/perl/'; -use LONCAPA; +use LONCAPA qw(:DEFAULT :match); my $iconpath; @@ -58,7 +57,7 @@ my $hadchanges; my %help=(); -# Mapread read maps into lonratedt::global arrays +# 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 @@ -67,15 +66,15 @@ my %help=(); sub mapread { my ($coursenum,$coursedom,$map)=@_; return - &Apache::lonratedt::mapread('/uploaded/'.$coursedom.'/'.$coursenum.'/'. - $map); + &LONCAPA::map::mapread('/uploaded/'.$coursedom.'/'.$coursenum.'/'. + $map); } sub storemap { my ($coursenum,$coursedom,$map)=@_; my ($outtext,$errtext)= - &Apache::lonratedt::storemap('/uploaded/'.$coursedom.'/'.$coursenum.'/'. - $map,1); + &LONCAPA::map::storemap('/uploaded/'.$coursedom.'/'.$coursenum.'/'. + $map,1); if ($errtext) { return ($errtext,2); } $hadchanges=1; @@ -100,7 +99,7 @@ sub authorhosts { $ca=$env{'user.name'}; $cd=$env{'user.domain'}; } else { - ($cd,$ca)=($realm=~/^\/(\w+)\/(\w+)$/); + ($cd,$ca)=($realm=~/^\/($match_domain)\/($match_username)$/); } my $allowed=0; my $myhome=&Apache::lonnet::homeserver($ca,$cd); @@ -121,21 +120,19 @@ sub authorhosts { sub dumpbutton { my ($home,$other,%outhash)=&authorhosts(); - my $type = 'Course'; - if (defined($env{'course.'.$env{'request.course.id'}.'.type'})) { - $type = $env{'course.'.$env{'request.course.id'}.'.type'}; - } + my $type = &Apache::loncommon::course_type(); if ($home+$other==0) { return ''; } - my $output='