--- loncom/interface/lonwhatsnew.pm 2009/05/06 19:25:56 1.93 +++ loncom/interface/lonwhatsnew.pm 2009/12/14 22:24:31 1.98.2.1 @@ -1,5 +1,5 @@ # -# $Id: lonwhatsnew.pm,v 1.93 2009/05/06 19:25:56 droeschl Exp $ +# $Id: lonwhatsnew.pm,v 1.98.2.1 2009/12/14 22:24:31 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 @@ -281,6 +282,7 @@ END sub display_actions_box { my ($r,$command,$refpage,$threshold_titles,$interval_titles,$initpage, $cdom,$crs,$checkallowed) = @_; + my $custommenu = &Apache::loncommon::needs_gci_custom(); my $udom = $env{'user.domain'}; my $uname = $env{'user.name'}; my $cid = $env{'request.course.id'}; @@ -288,7 +290,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 +343,32 @@ sub display_actions_box { return; } - if ($refpage eq 'start') { + my $header = ''; + if (($refpage eq 'start') && (!$custommenu)) { 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).'.' + unless ($custommenu) { + $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 +385,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(); @@ -468,7 +477,12 @@ sub display_actions_box { $threshold{'av_attempts'},$threshold{'degdiff'}, '
',$threshold{'numstudents'}); - my @actionorder = ('handgrading','haserrors','abovethreshold','versionchanges','coursediscussion','coursenormalmail','coursecritmail','newroles','oldroles'); + my @actionorder; + if ($custommenu) { + @actionorder = ('coursenormalmail','coursecritmail','newroles','oldroles'); + } else { + @actionorder = ('handgrading','haserrors','abovethreshold','versionchanges','coursediscussion','coursenormalmail','coursecritmail','newroles','oldroles'); + } foreach my $key (keys(%{$checkallowed})) { if ($key =~ /_section$/) { next; } @@ -529,6 +543,9 @@ sub display_actions_box { } my $halfway = 4; # my $halfway = int($totalboxes/2) + $totalboxes%2; + if ($custommenu) { + $halfway = 2; + } foreach my $actionitem (@actionorder) { if ($$checkallowed{$actionitem}) { if ($displayed == $halfway) { @@ -1952,35 +1969,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'}.' '); } }