--- loncom/interface/lonwhatsnew.pm 2009/02/10 09:30:16 1.86 +++ loncom/interface/lonwhatsnew.pm 2009/11/24 02:43:45 1.98 @@ -1,5 +1,5 @@ # -# $Id: lonwhatsnew.pm,v 1.86 2009/02/10 09:30:16 schafran 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 @@ -99,7 +100,7 @@ sub handler { &Apache::lonhtmlcommon::clear_breadcrumbs(); &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/whatsnew', - text=>"Display Action Items"}); + text=>"What's New?"}); if (($command eq 'chgthreshold') && $checkallowed{'abovethreshold'}) { &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/whatsnew?command=chgthreshold&refpage='.$refpage, @@ -194,7 +195,7 @@ sub display_main_box { ); my %initpage = &Apache::lonlocal::texthash ( firstres => "first resource in the $lctype", - whatsnew => "what's new? page", + whatsnew => "What's New Page", userpref => 'your general user preferences', coursespecific => "specific setting for this $lctype", ); @@ -267,7 +268,7 @@ END '; } my $course_type=&Apache::loncommon::course_type(); - return &Apache::loncommon::start_page($course_type.' Action Items', + return &Apache::loncommon::start_page("What's New?", $scripttag); } @@ -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', @@ -327,7 +328,7 @@ sub display_actions_box { my %threshold = (); my %pagedesc = &Apache::lonlocal::texthash ( firstres => 'First resource', - whatsnew => "What's New? page", + whatsnew => "What's New Page", userpref => 'user preference', coursespecific => $lctype.' only', default => 'default', @@ -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(); @@ -594,7 +600,7 @@ sub display_threshold_config { &Apache::loncommon::end_data_table_row()); } $r->print(&Apache::loncommon::end_data_table()."\n". - '
+ '
'); @@ -650,7 +656,7 @@ sub display_interval_config { } $r->print('   '); + &mt('Save').'" />'); return; } @@ -683,7 +689,7 @@ function toggle_countunread(choice) { $r->print('
' .&mt('Choose whether or not to display a count of the number of new posts for each resource or discussion board which has unread posts.') .'
' - .&mt("This can increase the time taken to gather data for the 'What's New?' page by a few seconds.") + .&mt("This can increase the time taken to gather data for the [_1]What's New Page[_2] by a few seconds.",'','') .'  ' .&mt('Currently set to [_1].',''.$current.'.') ); @@ -725,7 +731,7 @@ sub courseinit_config { 'anis' => 'and is set to display', 'padc' => 'Page display controlled by', 'chce' => 'Choose '.$lctype.' entry', - 'moce' => 'Modify '.$lctype.' entry', + 'moce' => 'Save', ); $r->print(<<"END");
$lt{'chwp'} @@ -1161,9 +1167,9 @@ sub getnormalmail { if (($fromcid) && ($fromcid eq $env{'request.course.id'})) { if (defined($sendtime) && $sendtime!~/error/) { my $numsendtime = $sendtime; - $sendtime = &Apache::lonlocal::locallocaltime($sendtime); if ($status eq 'new') { - $msgcount ++; + $sendtime = &Apache::lonlocal::locallocaltime($sendtime); + $msgcount ++; if ($shortsubj eq '') { $shortsubj = &mt('No subject'); } @@ -1952,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'}.' '); } }