--- loncom/interface/londocs.pm 2002/08/31 00:43:12 1.14 +++ loncom/interface/londocs.pm 2002/09/02 15:27:08 1.15 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.14 2002/08/31 00:43:12 www Exp $ +# $Id: londocs.pm,v 1.15 2002/09/02 15:27:08 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -34,6 +34,7 @@ use Apache::lonnet; use Apache::loncommon; use Apache::lonratedt; use Apache::lonratsrv; +use Apache::lonxml; my $iconpath; @@ -54,7 +55,7 @@ sub storemap { my ($coursenum,$coursedom,$map)=@_; return &Apache::lonratedt::storemap('/uploaded/'.$coursedom.'/'.$coursenum.'/'. - $map); + $map,1); } sub editor { @@ -192,17 +193,31 @@ sub handler { # is this a standard course? - &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['folder']); my $standard=($ENV{'request.course.uri'}=~/^\/uploaded\//); - my $forcestandard=($ENV{'form.folder'}=~/^default_/); - my $forcesupplement=($ENV{'form.folder'}=~/^supplemental_/); + my $forcestandard; + my $forcesupplement; + my $script=''; + my $allowed; + my $events=''; + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, + ['folder','showdoc']); + unless ($ENV{'form.showdoc'}) { # got called from remote + $forcestandard=($ENV{'form.folder'}=~/^default_/); + $forcesupplement=($ENV{'form.folder'}=~/^supplemental_/); # does this user have privileges to post, etc? - my $allowed=&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}); - my $script=''; - if ($allowed) { - &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']); - $script=&Apache::lonratedt::editscript('simple'); + $allowed=&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}); + if ($allowed) { + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']); + $script=&Apache::lonratedt::editscript('simple'); + } + } else { # got called in sequence from course + $allowed=0; + $forcestandard=1; + $forcesupplement=0; + $script=&Apache::&Apache::lonxml::registerurl(1,undef); + $events='onLoad="'.&Apache::lonxml::loadevents. + '" onUnload="'.&Apache::lonxml::unloadevents.'"'; } # get course data @@ -228,7 +243,7 @@ sub handler { ENDDOCUMENT -$r->print(&Apache::loncommon::bodytag('Course Documents')); +$r->print(&Apache::loncommon::bodytag('Course Documents','',$events)); # --------------------------------------------------0------ Standard documents if (($standard) && ($allowed) && (!$forcesupplement)) { $r->print('

Main Course Documents

'); @@ -277,6 +292,11 @@ value="External Resource" /> value="Syllabus=/public/$coursedom/$coursenum/syllabus"> +
+ + +