--- loncom/interface/londocs.pm 2003/09/08 19:21:10 1.75 +++ loncom/interface/londocs.pm 2003/09/15 15:24:18 1.78 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.75 2003/09/08 19:21:10 www Exp $ +# $Id: londocs.pm,v 1.78 2003/09/15 15:24:18 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -126,15 +126,65 @@ sub dumpbutton { sub dumpcourse { my $r=shift; $r->print('Dump DOCS'. - &Apache::loncommon::bodytag('Dump Course DOCS to Construction Space')); + &Apache::loncommon::bodytag('Dump Course DOCS to Construction Space'). + '
'); my ($home,$other,%outhash)=&authorhosts(); unless ($home) { return ''; } - if ($ENV{'form.authorspace'}) { + my $origcrsid=$ENV{'request.course.id'}; + my %origcrsdata=&Apache::lonnet::coursedescription($origcrsid); + if (($ENV{'form.authorspace'}) && ($ENV{'form.authorfolder'}=~/\w/)) { +# Do the dumping unless ($outhash{'home_'.$ENV{'form.authorspace'}}) { return ''; } my ($ca,$cd)=split(/\@/,$ENV{'form.authorspace'}); + my $title=$ENV{'form.authorfolder'}; + + } else { +# Input form + unless ($home==1) { + $r->print( + '

Select the Construction Space

'); + } else { + $r->print(''); + } + } + } + unless ($home==1) { + $r->print(''); + } + my $title=$origcrsdata{'description'}; + $title=~s/\s+/\_/gs; + $title=~s/\W//gs; + $r->print('

Folder in Construction Space


'); + &tiehash(); + $r->print('

Filenames in Construction Space

'); + foreach (&Apache::loncreatecourse::crsdirlist($origcrsid,'userfiles')) { + $r->print(''); + my ($ext)=($_=~/\.(\w+)$/); + my $title=$hash{'title_'.$hash{ + 'ids_/uploaded/'.$origcrsdata{'domain'}.'/'.$origcrsdata{'num'}.'/'.$_}}; + $r->print(''); + unless ($title) { + $title=$_; + } + $title=~s/\.(\w+)$//; + $title=~s/\W+/\_/gs; + $title.='.'.$ext; + $r->print("\n\n"); + } + $r->print("
Internal FilenameTitleSave as ...
'.$_.''.($title?$title:' ').'
\n"); + &untiehash(); + $r->print( + '

'); } } + # Imports the given (name, url) resources into the course # coursenum, coursedom, and folder must precede the list sub group_import { @@ -618,7 +668,7 @@ sub handler { $forcesupplement=($ENV{'form.folder'}=~/^supplemental_/); # does this user have privileges to post, etc? - $allowed=&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}); + $allowed=&Apache::lonnet::allowed('mdc',$ENV{'request.course.id'}); if ($allowed) { &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']); $script=&Apache::lonratedt::editscript('simple');