--- loncom/interface/lonwhatsnew.pm 2005/12/19 21:39:37 1.39 +++ loncom/interface/lonwhatsnew.pm 2006/01/06 21:04:34 1.43 @@ -1,5 +1,5 @@ # -# $Id: lonwhatsnew.pm,v 1.39 2005/12/19 21:39:37 raeburn Exp $ +# $Id: lonwhatsnew.pm,v 1.43 2006/01/06 21:04:34 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -60,12 +60,14 @@ sub handler { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; - my $crsid = $env{'request.course.id'}; - $crsid =~ s/_/\//; - if ((!($env{'request.course.id'})) || - ($env{'request.role'} !~ /\Q$crsid\E$/)) { - # Not in a course, or no role in course - $env{'user.error.msg'}="/adm/whatsnew::0:0:Cannot display what's new screen"; + + if ( ! $env{'request.course.fn'} + || + (!( &Apache::lonnet::allowed('whn',$env{'request.course.id'}) + || &Apache::lonnet::allowed('whn',$env{'request.course.id'} + .'/'.$env{'request.course.sec'})))) { + # Not in a course, or no whn priv in course + $env{'user.error.msg'}="/adm/whatsnew::whn:0:0:Cannot display what's new page"; return HTTP_NOT_ACCEPTABLE; } @@ -90,28 +92,28 @@ sub handler { ({href=>'/adm/whatsnew?command=chgthreshold&refpage='.$refpage, text=>"Change thresholds"}); $r->print(&Apache::lonhtmlcommon::breadcrumbs - (undef,'Course Action Items','Course_Action_Items_Thresholds')); + (undef,"What's New?",'Course_Action_Items_Thresholds')); } elsif (($command eq 'chginterval') && (&Apache::lonnet::allowed('vgr',$env{'request.course.id'}))) { &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/whatsnew?command=chginterval&refpage='.$refpage, text=>"Change interval"}); $r->print(&Apache::lonhtmlcommon::breadcrumbs - (undef,'Course Action Items','Course_Action_Items_Intervals')); + (undef,"What's New?",'Course_Action_Items_Intervals')); } elsif (($command eq 'chgdisc') && (&Apache::lonnet::allowed('pch',$env{'request.course.id'}))) { &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/whatsnew?command=chgdisc&refpage='.$refpage, text=>"Change discussion display"}); $r->print(&Apache::lonhtmlcommon::breadcrumbs - (undef,'Course Action Items','Course_Action_Items_Intervals')); + (undef,"What's New?",'Course_Action_Items_Intervals')); } elsif ($command eq 'courseinit') { &Apache::lonhtmlcommon::add_breadcrumb ({href=>'/adm/whatsnew?command=courseinit&refpage='.$refpage, text=>"Course initialization preference"}); $r->print(&Apache::lonhtmlcommon::breadcrumbs - (undef,'Course Action Items','Course_Action_Items_Initialization')); + (undef,"What's New?",'Course_Action_Items_Initialization')); } else { $r->print(&Apache::lonhtmlcommon::breadcrumbs - (undef,'Course Action Items','Course_Action_Items_Display')); + (undef,"What's New?",'Course_Action_Items_Display')); } &display_main_box($r,$command,$refpage,\%checkallowed); return OK; @@ -126,7 +128,8 @@ sub handler { sub display_main_box { my ($r,$command,$refpage,$checkallowed) = @_; my $domain=&Apache::loncommon::determinedomain(); - my $tabbg=&Apache::loncommon::designparm('coordinator.tabbg',$domain); + my $function = &Apache::loncommon::get_users_function(); + my $tabbg=&Apache::loncommon::designparm($function.'.tabbg',$domain); $r->print('
');
my %threshold_titles = &Apache::lonlocal::texthash (
@@ -164,7 +167,7 @@ sub display_main_box {
} elsif ($command eq 'courseinit') {
&courseinit_config($r,$refpage,\%initpage);
} else {
- &display_actions_box($r,$command,$refpage,\%threshold_titles,
+ &display_actions_box($r,$tabbg,$command,$refpage,\%threshold_titles,
\%interval_titles,\%initpage,$cdom,$crs,$checkallowed);
}
$r->print(< '); return; @@ -413,12 +404,17 @@ sub display_actions_box { $r->print('
|