--- loncom/interface/londocs.pm 2009/07/01 13:16:42 1.374
+++ loncom/interface/londocs.pm 2009/12/07 02:22:24 1.411.2.1
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.374 2009/07/01 13:16:42 tempelho Exp $
+# $Id: londocs.pm,v 1.411.2.1 2009/12/07 02:22:24 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;
@@ -116,15 +117,15 @@ 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 ''.
+ my $link = "".&mt('Dump '.$crstype.' DOCS to Construction Space')."";
+ return $link.' '.
&Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs').' ';
} else {
return '
'.
- &mt('Dump '.$type.
+ &mt('Dump '.$crstype.
' DOCS to Construction Space: available on other servers').
'
';
}
@@ -140,10 +141,10 @@ sub clean {
sub dumpcourse {
my ($r) = @_;
- my $type = &Apache::loncommon::course_type();
- $r->print(&Apache::loncommon::start_page('Dump '.$type.' DOCS to Construction Space').
+ my $crstype = &Apache::loncommon::course_type();
+ $r->print(&Apache::loncommon::start_page('Dump '.$crstype.' DOCS to Construction Space').
'');
+ '');
}
}
sub exportbutton {
- my $type = &Apache::loncommon::course_type();
- return ''.
+ my $crstype = &Apache::loncommon::course_type();
+ return "".&mt('IMS Export')."".
&Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').' ';
}
@@ -271,18 +271,28 @@ sub exportbutton {
sub exportcourse {
my $r=shift;
- my $type = &Apache::loncommon::course_type();
+ my $crstype = &Apache::loncommon::course_type();
my %discussiontime = &Apache::lonnet::dump('discussiontimes',
$env{'course.'.$env{'request.course.id'}.'.domain'}, $env{'course.'.$env{'request.course.id'}.'.num'});
my $numdisc = keys(%discussiontime);
my $navmap = Apache::lonnavmaps::navmap->new();
if (!defined($navmap)) {
- $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package').
- '
IMS Export Failed
'.
- '
'.
- &mt('Unable to retrieve information about course contents').
- '
'.&mt('Return to Course Editor').'');
- &Apache::lonnet::logthis('IMS export failed - could not create navmap object in '.lc($type).':'.$env{'request.course.id'});
+ $r->print(&Apache::loncommon::start_page('Export '.$crstype.' to IMS Package').
+ '
'.&mt('IMS Export Failed').'
'.
+ '
');
+ if ($crstype eq 'Community') {
+ $r->print(&mt('Unable to retrieve information about community contents'));
+ } else {
+ $r->print(&mt('Unable to retrieve information about course contents'));
+ }
+ $r->print('
');
+ if ($crstype eq 'Community') {
+ $r->print(&mt('Return to Community Editor'));
+ } else {
+ $r->print(&mt('Return to Course Editor'));
+ }
+ $r->print('');
+ &Apache::lonnet::logthis('IMS export failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'});
return;
}
my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef);
@@ -298,7 +308,17 @@ sub exportcourse {
my @exportitems = &Apache::loncommon::get_env_multiple('form.archive');
my @discussions = &Apache::loncommon::get_env_multiple('form.discussion');
if (@exportitems == 0 && @discussions == 0) {
- $outcome = ' As you did not select any content items or discussions for export, an IMS package has not been created. Please go back to select either content items or discussions for export';
+ $outcome =
+ '
'
+ .&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.'
+ ,''
+ ,'')
+ .'
'
- .&mt('Download the zip file from [_1]IMS '.lc($type).' archive[_2]'
- ,'','')
- .'
';
if ($copyresult) {
$outcome .= '
'
.&mt('The following errors occurred during export - [_1]'
,$copyresult)
.'
';
}
+ $outcome .= '
'
+ .&mt('[_1]Your IMS package[_2] is ready for download.'
+ ,'','')
+ .'
';
} else {
- $outcome = ' '.&mt('Unfortunately you will not be able to retrieve an IMS archive of this posts at this time, because there was a problem creating a manifest file.').' ';
+ $outcome = '
'
+ .&mt('Unfortunately you will not be able to retrieve'
+ .' an IMS archive of this posts at this time,'
+ .' because there was a problem creating a'
+ .' manifest file.')
+ .'