--- loncom/interface/londocs.pm 2006/05/30 12:46:09 1.228 +++ loncom/interface/londocs.pm 2006/06/08 16:00:54 1.231 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.228 2006/05/30 12:46:09 www Exp $ +# $Id: londocs.pm,v 1.231 2006/06/08 16:00:54 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -121,16 +121,18 @@ sub authorhosts { sub dumpbutton { my ($home,$other,%outhash)=&authorhosts(); + 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 Course DOCS to Construction Space: available on other servers'); + &mt('Dump '.$type. + ' DOCS to Construction Space: available on other servers'); } } @@ -143,8 +145,8 @@ sub clean { sub dumpcourse { my ($r) = @_; - - $r->print(&Apache::loncommon::start_page('Dump Course DOCS to Construction Space'). + my $type = &Apache::loncommon::course_type(); + $r->print(&Apache::loncommon::start_page('Dump '.$type.' DOCS to Construction Space'). '
'); my ($home,$other,%outhash)=&authorhosts(); unless ($home) { return ''; } @@ -246,21 +248,23 @@ sub dumpcourse { $r->print("\n"); &untiehash(); $r->print( - '

'); + '

'); } } # ------------------------------------------------------ Generate "export" button sub exportbutton { + my $type = &Apache::loncommon::course_type(); return ''. ''. + &mt('Export '.$type.' to IMS').'" />'. &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs'); } sub exportcourse { my $r=shift; + 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; @@ -301,7 +305,7 @@ sub exportcourse { open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); close(OUTPUT); chdir $cwd; - $outcome .= 'Download the zip file from IMS course archive
'; + $outcome .= &mt('Download the zip file from IMS '.lc($type).' archive
',$imszipfile,); if ($copyresult) { $outcome .= 'The following errors occurred during export - '.$copyresult; } @@ -309,13 +313,13 @@ sub exportcourse { $outcome = '
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.
'; } } - $r->print(&Apache::loncommon::start_page('Export course to IMS content package')); + $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package')); $r->print($outcome); $r->print(&Apache::loncommon::end_page()); } else { my $display; $display = '
'."\n"; - $display .= 'Choose which items you wish to export from your course.

'; + $display .= &mt('Choose which items you wish to export from your '.$type.'.

'); $display .= ''. '
 Content items'. ' |; - $r->print(&Apache::loncommon::start_page('Export course to IMS content package', + $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package', $scripttag)); $r->print($display.'
'. '

'. '

'. + &mt('Export '.$type.' DOCS').'" />

'. &Apache::loncommon::end_page()); } } @@ -950,7 +954,6 @@ sub breadcrumbs { my $folderpath; my $cpinfo=''; if ($env{'form.markedcopy_url'}) { - &Apache::lonnet::logthis('Found '.$env{'form.markedcopy_url'}); $cpinfo='&markedcopy_url='. &escape($env{'form.markedcopy_url'}). '&markedcopy_title='. @@ -1764,9 +1767,10 @@ sub list_symbs { # sub verifycontent { my ($r) = @_; + my $type = &Apache::loncommon::course_type(); my $loaderror=&Apache::lonnet::overloaderror($r); if ($loaderror) { return $loaderror; } - $r->print(&Apache::loncommon::start_page('Verify Course Documents')); + $r->print(&Apache::loncommon::start_page('Verify '.$type.' Documents')); $hashtied=0; undef %alreadyseen; %alreadyseen=(); @@ -1775,7 +1779,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 course: '). + &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.
')); } @@ -1800,7 +1804,8 @@ sub devalidateversioncache { sub checkversions { my ($r) = @_; - $r->print(&Apache::loncommon::start_page('Check Course Document Versions')); + my $type = &Apache::loncommon::course_type(); + $r->print(&Apache::loncommon::start_page("Check $type Document Versions")); my $header=''; my $startsel=''; my $monthsel=''; @@ -1861,7 +1866,7 @@ sub checkversions { &changewarning($r,''); if ($env{'form.timerange'} eq 'all') { # show all documents - $header=&mt('All Documents in Course'); + $header=&mt('All Documents in '.$type); $allsel=1; foreach (keys %hash) { if ($_=~/^ids\_(\/res\/.+)$/) { @@ -1906,7 +1911,7 @@ sub checkversions { $env{'course.'.$env{'request.course.id'}.'.domain'}, $env{'course.'.$env{'request.course.id'}.'.num'}); my %lt=&Apache::lonlocal::texthash - ('st' => 'Version changes since start of Course', + ('st' => 'Version changes since start of '.$type, 'lm' => 'Version changes since last Month', 'lw' => 'Version changes since last Week', 'sy' => 'Version changes since Yesterday', @@ -1915,9 +1920,9 @@ sub checkversions { 'fi' => 'File', 'md' => 'Modification Date', 'mr' => 'Most recently published Version', - 've' => 'Version used in Course', - 'vu' => 'Set Version to be used in Course', -'sv' => 'Set Versions to be used in Course according to Selections below', + 've' => 'Version used in '.$type, + 'vu' => 'Set Version to be used in '.$type, +'sv' => 'Set Versions to be used in '.$type.' according to Selections below', 'sm' => 'Keep all Resources up-to-date with most recent Versions (default)', 'sc' => 'Set all Resource Versions to current Version (Fix Versions)', 'di' => 'Differences'); @@ -1964,7 +1969,7 @@ ENDHEADERS 'Most Recent: '. ''.$currentversion.''. ''. - 'In Course: '. + 'In '.$type.': '. ''); # Used in course my $usedversion=$hash{'version_'.$linkurl}; @@ -2077,6 +2082,7 @@ sub changewarning { } $url='/adm/coursedocs?'.$pathvar.'='.$path; } + 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.'; } @@ -2087,7 +2093,7 @@ sub changewarning { '" />

'. &mt($message,' '). + &mt('re-initializing '.$course_type).'" onClick="reinit(this.form)" />'). $help{'Caching'}.'

'."\n\n"); } @@ -2097,6 +2103,7 @@ sub handler { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; return OK if $r->header_only; + my $type = &Apache::loncommon::course_type(); # --------------------------------------------- Initialize help topics for this foreach ('Adding_Course_Doc','Main_Course_Documents', @@ -2198,7 +2205,7 @@ sub handler { } # -------------------------------------------------------------------- Body tag $script = ''; - $r->print(&Apache::loncommon::start_page('Course Documents', $script, + $r->print(&Apache::loncommon::start_page("$type Documents", $script, {'force_register' => $showdoc,}). &Apache::loncommon::help_open_menu('','','','',273,'RAT')); @@ -2287,8 +2294,8 @@ sub handler { unless ($showdoc || $upload_result eq 'phasetwo') { # ----------------------------------------------------------------------------- my %lt=&Apache::lonlocal::texthash( - 'uplm' => 'Upload a new main course document', - 'upls' => 'Upload a new supplemental course document', + 'uplm' => 'Upload a new main '.lc($type).' document', + 'upls' => 'Upload a new supplemental '.lc($type).' document', 'impp' => 'Import a document', 'pubd' => 'Published documents', 'copm' => 'All documents out of a published map into this folder', @@ -2332,7 +2339,7 @@ sub handler { if ($env{'form.folder'} eq '' || $env{'form.folder'} eq 'supplemental') { $folderpath='default&'. - &escape(&mt('Main Course Documents')); + &escape(&mt('Main '.$type.' Documents')); } } unless ($env{'form.pagepath'}) { @@ -2365,7 +2372,7 @@ $exportbut ENDCOURSEVERIFY $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc', - &mt('Editing the Table of Contents for your Course'))); + &mt('Editing the Table of Contents for your '.$type))); } # --------------------------------------------------------- Standard documents $r->print(''); @@ -2376,7 +2383,7 @@ ENDCOURSEVERIFY my $folder=$env{'form.folder'}; if ($folder eq '' || $folder eq 'supplemental') { $folder='default'; - $env{'form.folderpath'}='default&'.&escape(&mt('Main Course Documents')); + $env{'form.folderpath'}='default&'.&escape(&mt('Main '.$type.' Documents')); } my $postexec=''; if ($folder eq 'default') { @@ -2607,7 +2614,7 @@ ENDBLOCK if ($folder =~ /^supplemental$/ && $env{'form.folderpath'} =~ /^default\&/) { $env{'form.folderpath'}='supplemental&'. - &escape(&mt('Supplemental Course Documents')); + &escape(&mt('Supplemental '.$type.' Documents')); } &editor($r,$coursenum,$coursedom,$folder,$allowed); if ($allowed) {