version 1.56, 2004/05/08 00:48:30
|
version 1.58, 2004/06/08 22:09:44
|
Line 1
|
Line 1
|
# The LearningOnline Network |
#meserver The LearningOnline Network |
# Create a course |
# Create a course |
# |
# |
# $Id$ |
# $Id$ |
Line 42 use localenroll;
|
Line 42 use localenroll;
|
|
|
# ================================================ Get course directory listing |
# ================================================ Get course directory listing |
|
|
|
#FIXME - doesn't support directories under /userfiles/ BUG#2999 |
sub crsdirlist { |
sub crsdirlist { |
my ($courseid,$which)=@_; |
my ($courseid,$which)=@_; |
unless ($which) { $which=''; } |
unless ($which) { $which=''; } |
Line 51 sub crsdirlist {
|
Line 52 sub crsdirlist {
|
&Apache::loncommon::propath($crsdata{'domain'},$crsdata{'num'})); |
&Apache::loncommon::propath($crsdata{'domain'},$crsdata{'num'})); |
my @output=(); |
my @output=(); |
foreach (@listing) { |
foreach (@listing) { |
|
#FIXME if list is a DIR need to recurse |
unless ($_=~/^\./) { |
unless ($_=~/^\./) { |
push (@output,(split(/\&/,$_))[0]); |
push (@output,(split(/\&/,$_))[0]); |
} |
} |
Line 477 ENDDOCUMENT
|
Line 479 ENDDOCUMENT
|
sub create_course { |
sub create_course { |
my $r=shift; |
my $r=shift; |
my $topurl='/res/'.&Apache::lonnet::declutter($ENV{'form.topmap'}); |
my $topurl='/res/'.&Apache::lonnet::declutter($ENV{'form.topmap'}); |
|
my $this_server = $Apache::lonnet::perlvar{'lonHostID'}; |
my $ccuname=$ENV{'form.ccuname'}; |
my $ccuname=$ENV{'form.ccuname'}; |
my $ccdomain=$ENV{'form.ccdomain'}; |
my $ccdomain=$ENV{'form.ccdomain'}; |
$ccuname=~s/\W//g; |
$ccuname=~s/\W//g; |
Line 625 ENDENHEAD
|
Line 628 ENDENHEAD
|
if (@affiliates > 0) { |
if (@affiliates > 0) { |
my @badclasses = (); |
my @badclasses = (); |
foreach my $class (@affiliates) { |
foreach my $class (@affiliates) { |
my $addcheck = &localenroll::new_course($class,$cenv{'internal.courseowner'}); |
my $addcheck = &Apache::lonnet::auto_new_course($crsuhome,$class,$cenv{'internal.courseowner'}); |
unless ($addcheck eq 'ok') { |
unless ($addcheck eq 'ok') { |
push @badclasses, $class; |
push @badclasses, $class; |
} |
} |