--- loncom/interface/londocs.pm 2006/05/30 20:09:25 1.229
+++ loncom/interface/londocs.pm 2006/06/03 21:14:27 1.230
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.229 2006/05/30 20:09:25 raeburn Exp $
+# $Id: londocs.pm,v 1.230 2006/06/03 21:14:27 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -121,21 +121,18 @@ sub authorhosts {
sub dumpbutton {
my ($home,$other,%outhash)=&authorhosts();
- my $type = 'Course';
- if (defined($env{'course.'.$env{'request.course.id'}.'.type'})) {
- $type = $env{'course.'.$env{'request.course.id'}.'.type'};
- }
+ my $type = &Apache::loncommon::course_type();
if ($home+$other==0) { return ''; }
my $output='
';
if ($home) {
return '
'.
''.
+ &mt('Dump '.$type.' DOCS to Construction Space').'" />'.
&Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs');
} else {
return'
'.
- &mt('Dump [_1] DOCS to Construction Space: available on other servers',
- $type);
+ &mt('Dump '.$type.
+ ' DOCS to Construction Space: available on other servers');
}
}
@@ -148,12 +145,9 @@ sub clean {
sub dumpcourse {
my ($r) = @_;
- my $type = 'Course';
- if (defined($env{'course.'.$env{'request.course.id'}.'.type'})) {
- $type = $env{'course.'.$env{'request.course.id'}.'.type'};
- }
- $r->print(&Apache::loncommon::start_page('Dump [_1] DOCS to Construction Space',
- $type).'
'.
''.
+ &mt('Export '.$type.' to IMS').'" />'.
&Apache::loncommon::help_open_topic('Docs_Export_Course_Docs');
}
sub exportcourse {
my $r=shift;
- my $type = 'Course';
- if (defined($env{'course.'.$env{'request.course.id'}.'.type'})) {
- $type = $env{'course.'.$env{'request.course.id'}.'.type'};
- }
+ my $type = &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;
@@ -317,7 +305,7 @@ sub exportcourse {
open(OUTPUT, "zip -r $imszip * 2> /dev/null |");
close(OUTPUT);
chdir $cwd;
- $outcome .= &mt('Download the zip file from IMS [_2] archive ',$imszipfile,lc($type));
+ $outcome .= &mt('Download the zip file from IMS '.lc($type).' archive ',$imszipfile,);
if ($copyresult) {
$outcome .= 'The following errors occurred during export - '.$copyresult;
}
@@ -331,7 +319,7 @@ sub exportcourse {
} else {
my $display;
$display = ''.
+ &mt('Export '.$type.' DOCS').'" />'.
&Apache::loncommon::end_page());
}
}
@@ -1780,10 +1768,7 @@ sub list_symbs {
#
sub verifycontent {
my ($r) = @_;
- my $type = 'Course';
- if (defined($env{'course.'.$env{'request.course.id'}.'.type'})) {
- $type = $env{'course.'.$env{'request.course.id'}.'.type'};
- }
+ my $type = &Apache::loncommon::course_type();
my $loaderror=&Apache::lonnet::overloaderror($r);
if ($loaderror) { return $loaderror; }
$r->print(&Apache::loncommon::start_page('Verify '.$type.' Documents'));
@@ -1795,7 +1780,7 @@ sub verifycontent {
if ($hash{$_}=~/\.(page|sequence)$/) {
if (($_=~/^src_/) && ($alreadyseen{&unescape($hash{$_})})) {
$r->print(''.
- &mt('The following sequence or page is included more than once in your [_1]: ',$type).
+ &mt('The following sequence or page is included more than once in your '.$type.': ').
&unescape($hash{$_}).' '.
&mt('Note that grading records for problems included in this sequence or folder will overlap.'));
}
@@ -1820,10 +1805,7 @@ sub devalidateversioncache {
sub checkversions {
my ($r) = @_;
- my $type = 'Course';
- if (defined($env{'course.'.$env{'request.course.id'}.'.type'})) {
- $type = $env{'course.'.$env{'request.course.id'}.'.type'};
- }
+ my $type = &Apache::loncommon::course_type();
$r->print(&Apache::loncommon::start_page("Check $type Document Versions"));
my $header='';
my $startsel='';
@@ -1885,7 +1867,7 @@ sub checkversions {
&changewarning($r,'');
if ($env{'form.timerange'} eq 'all') {
# show all documents
- $header=&mt('All Documents in [_1]',$type);
+ $header=&mt('All Documents in '.$type);
$allsel=1;
foreach (keys %hash) {
if ($_=~/^ids\_(\/res\/.+)$/) {
@@ -2101,10 +2083,7 @@ sub changewarning {
}
$url='/adm/coursedocs?'.$pathvar.'='.$path;
}
- my $crstype = 'course';
- if (defined($env{'course.'.$env{'request.course.id'}.'.type'})) {
- $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};
- }
+ my $course_type = &Apache::loncommon::course_type();
if (!defined($message)) {
$message='Changes will become active for your current session after [_1], or the next time you log in.';
}
@@ -2115,7 +2094,7 @@ sub changewarning {
'" />