-
+
@@ -500,14 +503,16 @@ 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;
}
- my %imports = ();
+ my %importareas = ();
+ my %includedres = ();
+ my %includeditems = ();
my @targets = ();
my %resources = ();
my %items = ();
@@ -536,32 +541,48 @@ 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}}) {
- $imports{$_} = 1;
+ $importareas{$_} = 1;
}
} else {
- $imports{$cmsmap{$cms}{$area}} = 1;
+ $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'};
}
}
}
-
- my $manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir,\%resources,\%items,\%hrefs,\%resinfo);
+
+ my $manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir,\%resources,\%items,\%hrefs,\%resinfo,'prepare',\%includedres,\%includeditems);
if ($manifest_result eq 'ok') {
+ foreach my $res (sort keys %resources) {
+ if ($importareas{$resources{$res}{type}}) {
+ $includedres{$res} = 1;
+ }
+ }
+ foreach my $itm (sort keys %items) {
+ &Apache::imsprocessor::get_imports(\%includeditems,\%items,\%resources,\%importareas,$itm);
+ }
+ }
+ foreach my $itm (sort keys %includeditems) {
+ &Apache::imsprocessor::get_parents(\%includeditems,\%items,$itm);
+ }
+
+ $manifest_result = &Apache::imsprocessor::process_manifest($cms,$tempdir,\%resources,\%items,\%hrefs,\%resinfo,'build',\%includedres,\%includeditems);
+ if ($manifest_result eq 'ok') {
+
my @path = ($cdom,$crs,$timenow);
my $fullpath = $Apache::lonnet::perlvar{'lonDocRoot'}.'/userfiles';
foreach my $item (@path) {
@@ -576,12 +597,13 @@ sub display_three {
mkdir("$fullpath/$name",0770);
}
}
- &Apache::imsprocessor::target_resources(\%resources,\%imports,\@targets);
+ &Apache::imsprocessor::target_resources(\%resources,\%importareas,\@targets);
my @boards = ();
my @announcements = ();
my @quizzes = ();
my @surveys = ();
+ my @pools = ();
my @groups = ();
my %messages = ();
my @timestamp = ();
@@ -590,12 +612,12 @@ sub display_three {
my @topnames = ();
my @packages = ();
- &Apache::imsprocessor::process_resinfo($cms,'DOCS',$tempdir,$destdir,\%items,\%resources,\@boards,\@announcements,\@quizzes,\@surveys,\@groups,\%messages,\@timestamp,\%boardnum,\%resinfo,$udom,$uname,$cdom,$crs,$db_handling,$user_handling,\%total,$seqstem,$seqstem,\@resrcfiles,\@packages,\%hrefs,\@pages,\@sequences);
+ &Apache::imsprocessor::process_resinfo($cms,'DOCS',$tempdir,$destdir,\%items,\%resources,\@targets,\@boards,\@announcements,\@quizzes,\@surveys,\@pools,\@groups,\%messages,\@timestamp,\%boardnum,\%resinfo,$udom,$uname,$cdom,$crs,$db_handling,$user_handling,\%total,$seqstem,$seqstem,\@resrcfiles,\@packages,\%hrefs,\@pages,\@sequences);
- my $copy_result = &Apache::imsprocessor::copy_resources('DOCS',$cms,\%hrefs,$tempdir,\@targets,\%urls,$crs,$cdom,$chome,$destdir,$timenow);
+ my $copy_result = &Apache::imsprocessor::copy_resources('DOCS',$cms,\%hrefs,$tempdir,\@targets,\%urls,$crs,$cdom,$chome,$destdir,$timenow,\%importareas);
+
+ &Apache::imsprocessor::build_structure($cms,'DOCS',$destdir,\%items,\%resinfo,\%resources,\@targets,\%hrefs,$udom,$uname,'',$timenow,$cdom,$crs,\@timestamp,\%total,\@boards,\@announcements,\@quizzes,\@surveys,\@pools,\%boardnum,\@pages,\@sequences,\@topurls,\@topnames,\@packages,\%includeditems);
- &Apache::imsprocessor::build_structure($cms,'DOCS',$destdir,\%items,\%resinfo,\%resources,\%hrefs,$udom,$uname,'',$timenow,$cdom,$crs,\@timestamp,\%total,\@boards,\@announcements,\@quizzes,\@surveys,\%boardnum,\@pages,\@sequences,\@topurls,\@topnames,\@packages);
-
foreach my $item (@pages) {
my $filename = $timenow.'/pages/'.$item;
my $fetchresult= &Apache::lonnet::process_coursefile('propagate',$crs,$cdom,$chome,$filename,'');
@@ -620,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='';
@@ -666,7 +688,7 @@ ENDBLOCK
Changes will become active for your current session after
-
+
|;