--- loncom/interface/lonwhatsnew.pm 2009/05/04 21:44:54 1.92 +++ loncom/interface/lonwhatsnew.pm 2009/11/24 02:43:45 1.98 @@ -1,5 +1,5 @@ # -# $Id: lonwhatsnew.pm,v 1.92 2009/05/04 21:44:54 lueken Exp $ +# $Id: lonwhatsnew.pm,v 1.98 2009/11/24 02:43:45 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -42,6 +42,7 @@ use Time::Local; use GDBM_File; use lib '/home/httpd/lib/perl/'; use LONCAPA; +use HTML::Entities; #---------------------------- # handler @@ -288,7 +289,7 @@ sub display_actions_box { my $lctype = lc($crstype); my %stulabel = ( 'Course' => 'students', - 'Group' => 'members', + 'Community' => 'members', ); my %lt = &Apache::lonlocal::texthash( 'yacc' => 'You are accessing an invalid course', @@ -341,27 +342,30 @@ sub display_actions_box { return; } + my $header = ''; if ($refpage eq 'start') { if (tie(my %bighash,'GDBM_File',$env{'request.course.fn'}.'.db', &GDBM_READER(),0640)) { - my $furl=$bighash{'first_url'}; + my $furl=&HTML::Entities::encode($bighash{'first_url'},'"<>&'); untie(%bighash); - $r->print(''.$lt{'gtfr'}. - '
'); + $header .= ''.$lt{'gtfr'}. + '
'; } } - $r->print(&mt('Page set to be displayed after you have selected a role in this '.$lctype).'.' + $header .= &mt('Page set to be displayed after you have selected a role in this '.$lctype).'.' .' ' .&mt('Currently: [_1].',''.$currinit.'') .'  ' - .&mt('[_1]Change[_2] for just [_3]this course[_4] or for all [_5]your courses[_6].' + .&mt('[_1]Change[_2] for just [_3]this '.$lctype.'[_4] or for [_5]all your courses/communities[_6].' ,'' ,'' ,'' ,'' ,'' ,'') - .'

'); + .' '; + + $r->print(&Apache::loncommon::head_subbox($header)); if ($command eq 'reset') { $result = &process_reset($cdom,$crs); @@ -378,12 +382,14 @@ sub display_actions_box { unless ($store_result eq 'ok') { &Apache::lonnet::logthis('Error saving whatsnew settings: '. $store_result.' for '.'user '.$uname.':'.$udom.' in '.$lctype.' '.$cid); - $result .= &mt('Unable to save visibility settings due to [_1]', - $store_result); + $result .= '' + .&mt('Unable to save visibility settings due to [_1]', + $store_result) + .''; } if ($result) { - $r->print($result.'
'); + $r->print($result.'
'); } $r->rflush(); @@ -1153,8 +1159,6 @@ sub getnormalmail { # Check for unread mail in course my $msgcount = 0; - my $datetime; - my @messages = sort(&Apache::lonnet::getkeys('nohist_email')); foreach my $message (@messages) { my $msgid=&escape($message); @@ -1164,7 +1168,7 @@ sub getnormalmail { if (defined($sendtime) && $sendtime!~/error/) { my $numsendtime = $sendtime; if ($status eq 'new') { - $sendtime = &Apache::lonlocal::locallocaltime($sendtime,'',\$datetime); + $sendtime = &Apache::lonlocal::locallocaltime($sendtime); $msgcount ++; if ($shortsubj eq '') { $shortsubj = &mt('No subject'); @@ -1188,7 +1192,6 @@ sub getcritmail { # Check for critical messages in course my %what=&Apache::lonnet::dump('critical'); my $result = ''; - my $datetime; my $critmsgcount = 0; foreach my $msgid (sort(keys(%what))) { my ($sendtime,$shortsubj,$fromname,$fromdom,$status,$fromcid)= @@ -1196,7 +1199,7 @@ sub getcritmail { if (($fromcid) && ($fromcid eq $env{'request.course.id'})) { if (defined($sendtime) && $sendtime!~/error/) { my $numsendtime = $sendtime; - $sendtime = &Apache::lonlocal::locallocaltime($sendtime,'',\$datetime); + $sendtime = &Apache::lonlocal::locallocaltime($sendtime); $critmsgcount ++; if ($shortsubj eq '') { $shortsubj = &mt('No subject'); @@ -1617,7 +1620,6 @@ sub display_versionchanges { sub display_rolechanges { my ($r,$chgcount,$changed,$interval,$crstype) = @_; my $now = time(); - my $datetime; my %lt = &Apache::lonlocal::texthash( 'user' => 'User', 'tich' => 'Time of change', @@ -1655,7 +1657,7 @@ sub display_rolechanges { my $link = &Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$udom),$uname,$udom); $r->print(''. - ''.&Apache::lonlocal::locallocaltime($item,'',\$datetime).''. + ''.&Apache::lonlocal::locallocaltime($item).''. ''.$link.''. ''.$role.''. ''.$section.''. @@ -1956,35 +1958,35 @@ sub start_box { if ($$show{$caller}) { $r->print(' - '.$lt{'chth'}.' + '.$lt{'chth'}.' '); } } elsif (($caller eq 'versionchanges') && ($$show{$caller})) { if ($$show{$caller}) { $r->print(' - '.$lt{'chin'}.' + '.$lt{'chin'}.' '); } } elsif ($caller eq 'coursediscussion') { if ($$show{$caller}) { $r->print(' - '.$lt{'chop'}.' + '.$lt{'chop'}.' '); } } elsif (($caller eq 'newroles') && ($$show{$caller})) { if ($$show{$caller}) { $r->print(' - '.$lt{'chin'}.' + '.$lt{'chin'}.' '); } } elsif (($caller eq 'oldroles') && ($$show{$caller})) { if ($$show{$caller}) { $r->print(' - '.$lt{'chin'}.' + '.$lt{'chin'}.' '); } }