--- loncom/interface/londocs.pm 2003/09/22 03:02:05 1.83 +++ loncom/interface/londocs.pm 2003/10/22 21:41:11 1.88 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.83 2003/09/22 03:02:05 www Exp $ +# $Id: londocs.pm,v 1.88 2003/10/22 21:41:11 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -138,7 +138,7 @@ sub dumpcourse { # Do the dumping unless ($outhash{'home_'.$ENV{'form.authorspace'}}) { return ''; } my ($ca,$cd)=split(/\@/,$ENV{'form.authorspace'}); - $r->print('

Copying Files

'); + $r->print('

'.&mt('Copying Files').'

'); my $title=$ENV{'form.authorfolder'}; $title=~s/[^\w\/]+/\_/g; my %replacehash=(); @@ -395,8 +395,8 @@ sub entryline { ) { $foldertitle=&Apache::lontexconvert::msgtexconverted($4); $renametitle=$4; - $title=''.localtime($1).' '. - &Apache::loncommon::plainname($2,$3).':
'. + $title=''.&Apache::lonlocal::locallocaltime($1).' '. + &Apache::loncommon::plainname($2,$3).':
'. $foldertitle; } $renametitle=~s/\"\;/\\\"/g; @@ -490,7 +490,7 @@ sub checkonthis { my $result=&Apache::lonnet::repcopy( &Apache::lonnet::filelocation('',$url)); if ($result==OK) { - $r->print('ok'); + $r->print(''.&mt('ok').''); $r->rflush(); &Apache::lonnet::countacc($url); $url=~/\.(\w+)$/; @@ -500,7 +500,7 @@ sub checkonthis { for (my $i=0;$i<=$level*5;$i++) { $r->print(' '); } - $r->print('- Rendering: '); + $r->print('- '.&mt('Rendering').': '); my $oldpath=$ENV{'request.filename'}; $ENV{'request.filename'}=&Apache::lonnet::filelocation('',$url); &Apache::lonxml::xmlparse($r,'web', @@ -511,14 +511,16 @@ sub checkonthis { ($Apache::lonxml::warningcount)) { if ($Apache::lonxml::errorcount) { $r->print(''. - $Apache::lonxml::errorcount.' error(s) '); + $Apache::lonxml::errorcount.' '. + &mt('error(s)').' '); } if ($Apache::lonxml::warningcount) { $r->print(''. - $Apache::lonxml::warningcount.' warning(s)'); + $Apache::lonxml::warningcount.' '. + &mt('warning(s)').''); } } else { - $r->print('ok'); + $r->print(''.&mt('ok').''); } $r->rflush(); } @@ -530,11 +532,11 @@ sub checkonthis { } } } elsif ($result==HTTP_SERVICE_UNAVAILABLE) { - $r->print('connection down'); + $r->print(''.&mt('connection down').''); } elsif ($result==HTTP_NOT_FOUND) { - $r->print('not found'); + $r->print(''.&mt('not found').''); } else { - $r->print('access denied'); + $r->print(''.&mt('access denied').''); } } } @@ -580,11 +582,13 @@ sub checkversions { unless ($ENV{'form.timerange'}) { $ENV{'form.timerange'}=604800; } - my $seltext='during the last '.$ENV{'form.timerange'}.' seconds'; + my $seltext=&mt('during the last').' '.$ENV{'form.timerange'}.' ' + .&mt('seconds'); my $startsel=''; my $monthsel=''; my $weeksel=''; my $daysel=''; + my $allsel=''; if ($ENV{'form.timerange'}==-1) { $seltext='since start of course'; $startsel='selected'; @@ -592,31 +596,47 @@ sub checkversions { } my $starttime=time-$ENV{'form.timerange'}; if ($ENV{'form.timerange'}==2592000) { - $seltext='during the last month ('.localtime($starttime).')'; + $seltext=&mt('during the last month').' ('.&Apache::lonlocal::locallocaltime($starttime).')'; $monthsel='selected'; } elsif ($ENV{'form.timerange'}==604800) { - $seltext='during the last week ('.localtime($starttime).')'; + $seltext=&mt('during the last week').' ('.&Apache::lonlocal::locallocaltime($starttime).')'; $weeksel='selected'; } elsif ($ENV{'form.timerange'}==86400) { - $seltext='since yesterday ('.localtime($starttime).')'; + $seltext=&mt('since yesterday').' ('.&Apache::lonlocal::locallocaltime($starttime).')'; $daysel='selected'; + } elsif ($ENV{'form.timerange'} eq 'all') { + $allsel='all'; } - + my %lt=&Apache::lonlocal::texthash + ('st' => 'Version changes since start of Course', + 'lm' => 'Version changes since last Month', + 'lw' => 'Version changes since last Week', + 'sy' => 'Version changes since Yesterday', + 'al' => 'All Resources', + 'sd' => 'Display', + 'cc' => 'Content changed', + 'fi' => 'File', + 'md' => 'Modification Date', + 'mr' => 'Most recently published Version', + 've' => 'Version used in Course', + 'vu' => 'Set Version to be used in Course', + 'di' => 'Differences'); $r->print(< - + -

Content changed $seltext

+

$lt{'cc'} $seltext

- - + + ENDHEADERS foreach (keys %changes) { if ($changes{$_}>$starttime) { @@ -626,8 +646,24 @@ ENDHEADERS $r->print( ''. - '
FileModification DateVersionDifferences
$lt{'fi'}$lt{'md'}$lt{'mr'}$lt{'ve'}$lt{'vu'}$lt{'di'}
'.$linkurl. ''. - localtime($changes{$_}).''.$currentversion.''); + &Apache::lonlocal::locallocaltime($changes{$_}). + ''. + $currentversion.''); +# Used in course + my $usedversion=$hash{'version_'.$linkurl}; + if ($usedversion) { + $r->print($usedversion); + } else { + $r->print($currentversion); + } + $r->print(''); +# Set version + $r->print(&Apache::loncommon::select_form($usedversion, + 'set_version_'.$linkurl, + ('' => '', + 'current' => 'current', + map {$_,$_} (1..$currentversion)))); + $r->print(''); my $lastold=1; for (my $prevvers=1;$prevvers<$currentversion;$prevvers++) { my $url=$root.'.'.$prevvers.'.'.$extension; @@ -639,14 +675,14 @@ ENDHEADERS for (my $prevvers=$lastold;$prevvers<$currentversion;$prevvers++) { my $url=$root.'.'.$prevvers.'.'.$extension; $r->print('Version '.$prevvers.' ('. - localtime(&Apache::lonnet::metadata($url,'lastrevisiondate')). + '">'.&mt('Version').' '.$prevvers.' ('. + &Apache::lonlocal::locallocaltime(&Apache::lonnet::metadata($url,'lastrevisiondate')). ')'); if (&Apache::loncommon::fileembstyle($extension) eq 'ssi') { $r->print(' Diffs'); + '">'.&mt('Diffs').''); } $r->print('
'); } @@ -682,6 +718,8 @@ sub handler { 'Docs_About_Syllabus,Docs_Editing_Templated_Pages'); $help{'Simple Page'} = &Apache::loncommon::help_open_topic( 'Docs_About_Simple_Page,Docs_Editing_Templated_Pages'); + $help{'Simple Problem'} = &Apache::loncommon::help_open_topic( + 'Option_Response_Simple'); $help{'Bulletin Board'} = &Apache::loncommon::help_open_topic( 'Docs_About_Bulletin_Board,Docs_Editing_Templated_Pages'); $help{'My Personal Info'} = &Apache::loncommon::help_open_topic( @@ -863,6 +901,10 @@ ENDNEWSCRIPT # ----------------------------------------------------------------------------- if ($allowed) { my $dumpbut=&dumpbutton(); + my %lt=&Apache::lonlocal::texthash( + 'vc' => 'Verify Content', + 'cv' => 'Check/Set Resource Versions', + ); $r->print(< @@ -876,9 +918,9 @@ ENDNEWSCRIPT
- + - + $dumpbut