--- loncom/interface/lonwhatsnew.pm 2006/07/19 22:01:37 1.60 +++ loncom/interface/lonwhatsnew.pm 2007/06/06 17:35:32 1.72 @@ -1,5 +1,5 @@ # -# $Id: lonwhatsnew.pm,v 1.60 2006/07/19 22:01:37 raeburn Exp $ +# $Id: lonwhatsnew.pm,v 1.72 2007/06/06 17:35:32 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -144,7 +144,6 @@ sub display_main_box { my ($r,$command,$refpage,$checkallowed) = @_; my $domain=&Apache::loncommon::determinedomain(); my $function = &Apache::loncommon::get_users_function(); - my $tabbg=&Apache::loncommon::designparm($function.'.tabbg',$domain); my $lctype = lc(&Apache::loncommon::course_type()); $r->print('
');
@@ -172,7 +171,7 @@ sub display_main_box {
if (($command eq 'chgthreshold')
&& $checkallowed->{'abovethreshold'}) {
- &display_threshold_config($r,$refpage,$tabbg,\%threshold_titles,
+ &display_threshold_config($r,$refpage,\%threshold_titles,
$cdom,$crs);
} elsif (($command eq 'chginterval')
&& $checkallowed->{'versionchanges'}) {
@@ -183,7 +182,7 @@ sub display_main_box {
} elsif ($command eq 'courseinit') {
&courseinit_config($r,$refpage,\%initpage);
} else {
- &display_actions_box($r,$tabbg,$command,$refpage,\%threshold_titles,
+ &display_actions_box($r,$command,$refpage,\%threshold_titles,
\%interval_titles,\%initpage,$cdom,$crs,$checkallowed);
}
my $end_page = &Apache::loncommon::end_page();
@@ -241,11 +240,8 @@ END
#-------------------------------
sub display_actions_box {
- my ($r,$tabbg,$command,$refpage,$threshold_titles,$interval_titles,
- $initpage,$cdom,$crs,$checkallowed) = @_;
- my $rowColor1 = "#ffffff";
- my $rowColor2 = "#eeeeee";
-
+ my ($r,$command,$refpage,$threshold_titles,$interval_titles,$initpage,
+ $cdom,$crs,$checkallowed) = @_;
my $udom = $env{'user.domain'};
my $uname = $env{'user.name'};
my $cid = $env{'request.course.id'};
@@ -286,11 +282,7 @@ sub display_actions_box {
$result = &store_courseinit_setting($uname,$udom,$cid,$initpage);
}
- my %threshold = (
- av_attempts => 2,
- degdiff => 0.5,
- numstudents => 2,
- );
+ my %threshold = ();
my %pagedesc = &Apache::lonlocal::texthash (
firstres => 'First resource',
whatsnew => "What's New? page",
@@ -319,7 +311,7 @@ sub display_actions_box {
$r->print(&mt('Page set to be displayed after you have selected a role in this '.$lctype).
'. '); + &mt('or for all your courses.',$refpage).' '); if ($command eq 'reset') { $result = &process_reset($cdom,$crs); @@ -334,9 +326,9 @@ sub display_actions_box { my $store_result=&store_display_settings($uname,$udom,$cid,$checkallowed); unless ($store_result eq 'ok') { - &Apache::lonnet::logthis('Error storing whatsnew settings: '. + &Apache::lonnet::logthis('Error saving whatsnew settings: '. $store_result.' for '.'user '.$uname.':'.$udom.' in '.$lctype.' '.$cid); - $result .= &mt('Unable to store visibility settings due to [_1]', + $result .= &mt('Unable to save visibility settings due to [_1]', $store_result); } @@ -400,7 +392,7 @@ sub display_actions_box { } if ($needitems) { - &getitems(\%unread,\%ungraded,\%bombed,\%triggered,\%changed,\@newdiscussions,\@tograde,\@bombs,\@warnings,$rowColor1,$rowColor2,\%threshold,$cdom,$crs,\%res_title,\%show,$starttime,$countunread); + &getitems(\%unread,\%ungraded,\%bombed,\%triggered,\%changed,\@newdiscussions,\@tograde,\@bombs,\@warnings,\%threshold,$cdom,$crs,\%res_title,\%show,$starttime,$countunread); } if ($show{'coursenormalmail'}) { $msgcount = &getnormalmail(\@newmsgs); @@ -436,7 +428,7 @@ sub display_actions_box { if ($displayed == $halfway) { $r->print(' | ');
}
- &display_launcher($r,$actionitem,$refpage,$checkallowed,$tabbg,$rowColor1,$rowColor2,\%show,\%headings,\%res_title,\@tograde,\%ungraded,\@bombs,\%bombed,\%changed,\@warnings,\%triggered,\@newdiscussions,\%unread,$msgcount,\@newmsgs,$critmsgcount,\@critmsgs,$interval,$countunread);
+ &display_launcher($r,$actionitem,$refpage,$checkallowed,\%show,\%headings,\%res_title,\@tograde,\%ungraded,\@bombs,\%bombed,\%changed,\@warnings,\%triggered,\@newdiscussions,\%unread,$msgcount,\@newmsgs,$critmsgcount,\@critmsgs,$interval,$countunread);
$displayed ++;
}
}
@@ -458,7 +450,7 @@ sub display_actions_box {
#-------------------------------
sub display_threshold_config {
- my ($r,$refpage,$tabbg,$threshold_titles,$cdom,$crs) = @_;
+ my ($r,$refpage,$threshold_titles,$cdom,$crs) = @_;
my $uname = $env{'user.name'};
my $udom = $env{'user.dom'};
my $cid = $env{'request.course.id'};
@@ -468,9 +460,6 @@ sub display_threshold_config {
my $rowColor;
my @thresholditems = ("av_attempts","degdiff","numstudents");
- foreach my $item (@thresholditems) {
- $threshold{$item} = '';
- }
my %threshold_titles = &Apache::lonlocal::texthash(
av_attempts => 'Average number of attempts',
degdiff => 'Degree of difficulty',
@@ -478,48 +467,31 @@ sub display_threshold_config {
);
&get_curr_thresholds(\%threshold,$uname,$udom,$cid,$cdom,$crs);
- $r->print(' |