--- loncom/imspackages/imsimportdocs.pm 2005/02/21 23:47:46 1.11
+++ loncom/imspackages/imsimportdocs.pm 2005/04/07 06:56:22 1.12
@@ -143,19 +143,19 @@ sub handler {
&Apache::imsprocessor::ims_config(\@areas,\%cmsmap,\%areaname);
# get course data
- my $coursenum=$ENV{'course.'.$ENV{'request.course.id'}.'.num'};
- my $coursedom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
- my $coursehome=$ENV{'course.'.$ENV{'request.course.id'}.'.home'};
+ my $coursenum=$env{'course.'.$env{'request.course.id'}.'.num'};
+ my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $coursehome=$env{'course.'.$env{'request.course.id'}.'.home'};
# get personal data
- my $uname=$ENV{'user.name'};
- my $udom=$ENV{'user.domain'};
+ my $uname=$env{'user.name'};
+ my $udom=$env{'user.domain'};
my $plainname=&Apache::lonnet::escape(
&Apache::loncommon::plainname($uname,$udom));
# does this user have privileges to post, etc?
- my $allowed=&Apache::lonnet::allowed('mdc',$ENV{'request.course.id'});
+ my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
unless ($allowed) {
$r->print("
The LearningOnline Network with CAPA ");
$r->print(&Apache::loncommon::bodytag('Import IMS package',undef,'',1));
@@ -166,11 +166,11 @@ sub handler {
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['phase']);
- if ($ENV{'form.phase'} eq 'one') {
+ if ($env{'form.phase'} eq 'one') {
&jscript_one(\$javascript);
- } elsif ($ENV{'form.phase'} eq 'two') {
+ } elsif ($env{'form.phase'} eq 'two') {
&jscript_two(\$javascript);
- } elsif ($ENV{'form.phase'} eq 'three') {
+ } elsif ($env{'form.phase'} eq 'three') {
&jscript_three(\$javascript);
}
@@ -188,11 +188,11 @@ $javascript
ENDHEAD
# -------------------------------------------------------------------- Body tag
$r->print(&Apache::loncommon::bodytag('Import IMS package',undef,'',1));
- if ($ENV{'form.phase'} eq 'one') {
+ if ($env{'form.phase'} eq 'one') {
&display_one($r);
- } elsif ($ENV{'form.phase'} eq 'two') {
+ } elsif ($env{'form.phase'} eq 'two') {
&display_two($r,$coursenum,\@areas,\%areaname,%cmsmap);
- } elsif ($ENV{'form.phase'} eq 'three') {
+ } elsif ($env{'form.phase'} eq 'three') {
&display_three($r,$coursenum,$coursedom,$coursehome,$uname,$udom,\@areas,%cmsmap);
}
$r->print("");
@@ -259,7 +259,7 @@ Please choose the CMS used to create you
-
+
@@ -300,7 +300,7 @@ ENDBLOCK
sub display_two {
my ($r,$crs,$areasref,$areaname,%cmsmap) = @_;
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['folder','source']);
- my $cms = $ENV{'form.source'};
+ my $cms = $env{'form.source'};
my $timenow = time;
my $tempdir = &Apache::imsprocessor::create_tempdir('DOCS',$crs,$timenow);
my $fname = &Apache::imsprocessor::uploadzip('DOCS',$tempdir);
@@ -467,7 +467,7 @@ ENDBLOCK
-
+
@@ -503,9 +503,9 @@ ENDDOCUMENT
sub display_three {
my ($r,$crs,$cdom,$chome,$uname,$udom,$areas,%cmsmap) = @_;
- my $folder = $ENV{'form.folder'};
- my $cms = $ENV{'form.source'};
- my $tempdir = $ENV{'form.tempdir'};
+ my $folder = $env{'form.folder'};
+ my $cms = $env{'form.source'};
+ my $tempdir = $env{'form.tempdir'};
my $longcrs = '';
if ($crs =~ m/^(\d)(\d)(\d)/) {
$longcrs = $1.'/'.$2.'/'.$3.'/'.$crs;
@@ -541,15 +541,15 @@ sub display_three {
my $toplevel = '';
my $foldername = '';
my %topitems = ();
- if (defined($ENV{'form.toplevel'}) ) {
- $toplevel = $ENV{'form.toplevel'};
+ if (defined($env{'form.toplevel'}) ) {
+ $toplevel = $env{'form.toplevel'};
}
- if (defined($ENV{'form.foldername'}) ) {
- $foldername = $ENV{'form.foldername'};
+ if (defined($env{'form.foldername'}) ) {
+ $foldername = $env{'form.foldername'};
}
foreach my $area (@{$areas}) {
- if (defined($ENV{"form.$area"}) && ($ENV{'form.'.$area} ne '')) {
+ if (defined($env{"form.$area"}) && ($env{'form.'.$area} ne '')) {
if ($cms eq 'angel' && $area eq 'doc') {
foreach (@{$cmsmap{$cms}{$area}}) {
$importareas{$_} = 1;
@@ -558,9 +558,9 @@ sub display_three {
$importareas{$cmsmap{$cms}{$area}} = 1;
}
if ($area eq 'board') {
- $db_handling = $ENV{'form.db_handling'};
+ $db_handling = $env{'form.db_handling'};
} elsif ($area eq 'users') {
- $user_handling = $ENV{'form.user_handling'};
+ $user_handling = $env{'form.user_handling'};
}
}
}
@@ -642,7 +642,7 @@ sub display_three {
}
} elsif ($toplevel eq 'newfolder') {
my $url = &Apache::lonnet::unescape("/uploaded/$cdom/$crs/$timenow/sequences/Top.sequence");
- my $name = &Apache::lonnet::unescape("$ENV{'form.foldername'}");
+ my $name = &Apache::lonnet::unescape("$env{'form.foldername'}");
push @imports, $name, $url;
}
my $errtext='';
@@ -688,7 +688,7 @@ ENDBLOCK
Changes will become active for your current session after
-
+
|;