version 1.75, 2003/09/08 19:21:10
|
version 1.76, 2003/09/08 21:19:44
|
Line 126 sub dumpbutton {
|
Line 126 sub dumpbutton {
|
sub dumpcourse { |
sub dumpcourse { |
my $r=shift; |
my $r=shift; |
$r->print('<html><head><title>Dump DOCS</title></head>'. |
$r->print('<html><head><title>Dump DOCS</title></head>'. |
&Apache::loncommon::bodytag('Dump Course DOCS to Construction Space')); |
&Apache::loncommon::bodytag('Dump Course DOCS to Construction Space'). |
|
'<form name="dumpdoc" method="post">'); |
my ($home,$other,%outhash)=&authorhosts(); |
my ($home,$other,%outhash)=&authorhosts(); |
unless ($home) { return ''; } |
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 ''; } |
unless ($outhash{'home_'.$ENV{'form.authorspace'}}) { return ''; } |
my ($ca,$cd)=split(/\@/,$ENV{'form.authorspace'}); |
my ($ca,$cd)=split(/\@/,$ENV{'form.authorspace'}); |
|
my $title=$ENV{'form.authorfolder'}; |
|
|
|
} else { |
|
# Input form |
|
unless ($home==1) { |
|
$r->print( |
|
'<h3>Select the Construction Space</h3><select name="authorspace">'); |
|
} |
|
foreach (sort keys %outhash) { |
|
if ($_=~/^home_(.+)$/) { |
|
if ($home==1) { |
|
$r->print( |
|
'<input type="hidden" name="authorspace" value="'.$1.'" />'); |
|
} else { |
|
$r->print('<option value="'.$1.'">'.$_.'</option>'); |
|
} |
|
} |
|
} |
|
unless ($home==1) { |
|
$r->print('</select>'); |
|
} |
|
my $title=$origcrsdata{'description'}; |
|
$title=~s/\s+/\_/gs; |
|
$title=~s/\W//gs; |
|
$r->print('<h3>Folder in Construction Space</h3><input type="text" size="50" name="authorfolder" value="'.$title.'" /><br />'); |
|
&tiehash(); |
|
foreach (&Apache::loncreatecourse::crsdirlist($origcrsid,'userfiles')) { |
|
$r->print("\n<br />".$_.' '. |
|
$hash{'title_'.$hash{ |
|
'ids_/uploaded/'.$origcrsdata{'domain'}.'/'.$origcrsdata{'num'}.'/'.$_}} |
|
); |
|
} |
|
&untiehash(); |
|
$r->print( |
|
'<input type="submit" name="dumpcourse" value="Dump Course DOCS" /></form>'); |
} |
} |
} |
} |
|
|
|
|
# Imports the given (name, url) resources into the course |
# Imports the given (name, url) resources into the course |
# coursenum, coursedom, and folder must precede the list |
# coursenum, coursedom, and folder must precede the list |
sub group_import { |
sub group_import { |