--- loncom/imspackages/imsimportdocs.pm 2006/11/02 21:07:15 1.19
+++ loncom/imspackages/imsimportdocs.pm 2009/11/20 18:25:34 1.29
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: imsimportdocs.pm,v 1.19 2006/11/02 21:07:15 albertel Exp $
+# $Id: imsimportdocs.pm,v 1.29 2009/11/20 18:25:34 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -165,9 +165,15 @@ sub handler {
my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
unless ($allowed) {
$r->print(&Apache::loncommon::start_page('Import IMS package',undef,
- {'only_body' => 1,}));
- $r->print('
'.&mt('Modification of Course Contents Disallowed').'
'.&mt('Your current role does not grant you the right to modify course content in this course.').
- &Apache::loncommon::end_page());
+ {'only_body' => 1,}));
+ $r->print(
+ '
'
+ .&mt('Modification of Course Contents Disallowed')
+ .'
'
+ .&mt('Your current role does not grant you the right to modify course content in this course.')
+ .'
- Choose display options for listing of contents of top level of package.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Once you have checked the checkboxes for all areas you wish to import from the IMS package, selected options (if available), and selected a display option for the package contents you should click the 'Complete Import' button.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-ENDDOCUMENT
+ } else { # Unknown cms format
+ $r->print(
+ ''
+ .&mt('Unsupported IMS format: [_1]',$cms)
+ .' '
+ );
+ # return();
+ }
+ }
+
+
+ # Start output: Step 3 and step 4
+
+ $r->print(
+ '');
}
@@ -553,7 +509,7 @@ sub display_three {
foreach my $area (@{$areas}) {
if (defined($env{"form.$area"}) && ($env{'form.'.$area} ne '')) {
- if ($cms eq 'angel' && $area eq 'doc') {
+ if ($cms eq 'angel5' && $area eq 'doc') {
foreach (@{$cmsmap{$cms}{$area}}) {
$importareas{$_} = 1;
}
@@ -641,12 +597,12 @@ sub display_three {
for (my $i=0; $i<@topurls; $i++) {
my $url = &unescape($topurls[$i]);
my $name = &unescape($topnames[$i]);
- push @imports, $name, $url;
+ push(@imports, [$name, $url]);
}
} elsif ($toplevel eq 'newfolder') {
my $url = &unescape("/uploaded/$cdom/$crs/$timenow/sequences/Top.sequence");
my $name = &unescape("$env{'form.foldername'}");
- push @imports, $name, $url;
+ push(@imports, [$name, $url]);
}
my $errtext='';
my $fatal=0;
@@ -657,53 +613,36 @@ sub display_three {
}
my ($errtext,$fatal)=&Apache::londocs::group_import($crs,$cdom,$folder,'sequence','imsimport',@imports);
if ($fatal) {
- print STDERR "Fatal error during group_import\n";
+ &Apache::lonnet::logthis("Fatal error during group_import.");
}
}
if ($tempdir =~ m/^\/home\/httpd\/perl\/tmp\/$crs\/\d{10}/) {
system("rm -r -f $tempdir");
}
- $r->print(<
-