--- loncom/interface/londocs.pm 2009/02/17 10:02:59 1.345 +++ loncom/interface/londocs.pm 2011/12/04 15:51:58 1.467 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.345 2009/02/17 10:02:59 weissno Exp $ +# $Id: londocs.pm,v 1.467 2011/12/04 15:51:58 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -35,6 +35,7 @@ use Apache::Constants qw(:common :http); use Apache::imsexport; use Apache::lonnet; use Apache::loncommon; +use Apache::lonhtmlcommon; use LONCAPA::map(); use Apache::lonratedt(); use Apache::lonxml; @@ -72,7 +73,7 @@ sub storemap { &LONCAPA::map::storemap('/uploaded/'.$coursedom.'/'.$coursenum.'/'. $map,1); if ($errtext) { return ($errtext,2); } - + $hadchanges=1; return ($errtext,0); } @@ -116,17 +117,22 @@ sub authorhosts { sub dumpbutton { my ($home,$other,%outhash)=&authorhosts(); - my $type = &Apache::loncommon::course_type(); + my $crstype = &Apache::loncommon::course_type(); if ($home+$other==0) { return ''; } if ($home) { - return ''. - &Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs'); - } else { - return '
' + .&mt('As you did not select any content items or discussions' + .' for export, an IMS package has not been created.') + .'
' + .'' + .&mt('Please [_1]go back[_2] to select either content items' + .' or discussions for export.' + ,'' + ,'') + .'
'; } else { my $now = time; my %symbs; @@ -306,9 +333,10 @@ sub exportcourse { my $imsresources; my $tempexport; my $copyresult; - my $ims_manifest = &create_ims_store($now,\$manifestok,\$outcome,\$tempexport); + my $testbank; + my $ims_manifest = &create_ims_store($now,\$manifestok,\$outcome,\$tempexport,$format,\$testbank); if ($manifestok) { - &build_package($now,$navmap,\@exportitems,\@discussions,\$outcome,$tempexport,\$copyresult,$ims_manifest); + &build_package($now,$navmap,\@exportitems,\@discussions,\$outcome,$tempexport,\$copyresult,$ims_manifest,$format,$testbank); close($ims_manifest); #Create zip file in prtspool @@ -321,35 +349,53 @@ sub exportcourse { open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); close(OUTPUT); chdir $cwd; - $outcome .= &mt('Download the zip file from IMS '.lc($type).' archive' + .&mt('[_1]Your IMS package[_2] is ready for download.' + ,'','') + .'
'; if ($copyresult) { - $outcome .= &mt('The following errors occurred during export - [_1]',$copyresult); + $outcome .= '' + .&mt('The following errors occurred during export - [_1]' + ,$copyresult) + .'
'; } } else { - $outcome = '' + .&mt('Unfortunately you will not be able to retrieve' + .' an IMS archive of your course at this time,' + .' because there was a problem creating a' + .' manifest file.') + .'
' + .''; } } - $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package')); - $r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package')); + $r->print(&Apache::loncommon::start_page('Export '.$crstype.' to IMS Package')); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('IMS Export')); $r->print($outcome); $r->print(&Apache::loncommon::end_page()); } else { - my $display; - $display = ''); + &mt('Export').'" />'); } } sub create_ims_store { - my ($now,$manifestok,$outcome,$tempexport) = @_; + my ($now,$manifestok,$outcome,$tempexport,$format,$testbank) = @_; $$tempexport = $Apache::lonnet::perlvar{'lonDaemons'}.'/tmp/ims_exports'; my $ims_manifest; if (!-e $$tempexport) { @@ -525,7 +586,11 @@ sub create_ims_store { '