--- loncom/imspackages/imsimportdocs.pm 2006/05/30 12:45:50 1.18 +++ loncom/imspackages/imsimportdocs.pm 2009/11/06 17:16:53 1.24 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: imsimportdocs.pm,v 1.18 2006/05/30 12:45:50 www Exp $ +# $Id: imsimportdocs.pm,v 1.24 2009/11/06 17:16:53 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -34,6 +34,7 @@ use Apache::loncommon; use Apache::lonlocal; use Apache::imsprocessor; use LONCAPA::Configuration; +use LONCAPA::map(); use lib '/home/httpd/lib/perl/'; use LONCAPA; @@ -206,96 +207,38 @@ sub display_one { my ($r) = @_; &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['folder']); - $r->print(< - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  -
  -    - Specify the Course Management system used to create the package.   - -
 
  - -Please choose the CMS used to create your IMS content package.   - - -
 
 
  -    - Locate the IMS content package you wish to upload.   - -
 
  - - - -
 
 If you have selected the CMS, and located the IMS package, you should click the 'Upload IMS package' button to upload the file to the server.
 
- - - - -
- - - -
-
- - - - -ENDBLOCK + $r->print( + '
' + .&Apache::lonhtmlcommon::topic_bar( + 1,&mt('Specify the Course Management system used to create the package')) + .&mt('Please choose the CMS used to create your IMS content package:').' ' + .'' + ); + $r->print( + &Apache::lonhtmlcommon::topic_bar( + 2,&mt('Locate the IMS content package you wish to upload')) + .'' + .'' + .&mt('File:') + .' ' + ); + $r->print( + '
' + .'

' + .'' + .' ' + .'' + .'

' + ); } @@ -345,7 +288,7 @@ sub display_two { $count{$area} ++; } } - } elsif ($cms eq 'angel') { + } elsif ($cms eq 'angel5') { foreach my $area (keys %{$cmsmap{$cms}}) { if ($area eq 'doc') { if (grep/^$resources{$res}{type}$/,@{$cmsmap{$cms}{doc}}) { @@ -368,7 +311,7 @@ sub display_two { - + 3    Choose which content types you wish to import @@ -438,10 +381,10 @@ ENDBLOCK  

- + 4    - Choose display options for listing of contents of top level of package. + Choose display options for listing of contents of top level of package @@ -480,7 +423,7 @@ ENDBLOCK
- + @@ -495,10 +438,19 @@ ENDBLOCK
ENDDOCUMENT } else { - $r->print("Unpacking of your IMS package failed because an IMS manifest file was not located in the package\n"); + $r->print( + '

' + .&mt('Unpacking of your IMS package failed because an IMS manifest file was not located in the package.') + .'

' + ); } } else { - $r->print("Processing of your IMS package failed because the file you uploaded could not be unzipped\n"); + $r->print( + '

' + .&mt('Processing of your IMS package failed because the file you' + .' uploaded could not be unzipped.') + .'

' + ); } } @@ -552,7 +504,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; } @@ -640,23 +592,23 @@ 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; ($errtext,$fatal)= &Apache::londocs::mapread($crs,$cdom,$folder.'.sequence'); - if ($#Apache::lonratedt::order<1) { - $Apache::lonratedt::order[0]=1; - $Apache::lonratedt::resources[1]=''; + if ($#LONCAPA::map::order<1) { + $LONCAPA::map::order[0]=1; + $LONCAPA::map::resources[1]=''; } 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}/) { @@ -672,7 +624,7 @@ sub display_three { - + 5    Your import is complete