--- loncom/interface/loncommon.pm 2006/12/17 01:49:34 1.494 +++ loncom/interface/loncommon.pm 2006/12/23 07:17:34 1.496 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.494 2006/12/17 01:49:34 raeburn Exp $ +# $Id: loncommon.pm,v 1.496 2006/12/23 07:17:34 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3636,8 +3636,6 @@ sub standard_css { my $mail_replied_hover = '#888855'; my $mail_other = '#99BBBB'; my $mail_other_hover = '#669999'; - my $mail_even = '#EEEEEE'; - my $mail_odd = '#FFFFFF'; my $table_header = '#DDDDDD'; my $feedback_link_bg = '#BBBBBB'; @@ -3928,10 +3926,8 @@ table.LC_mail_list tr.LC_mail_other:hove background-color: $mail_other_hover; } table.LC_mail_list tr.LC_mail_even { - background-color: $mail_even } table.LC_mail_list tr.LC_mail_odd { - background-color: $mail_odd } @@ -6078,16 +6074,19 @@ Returns: both routines return nothing ####################################################### ####################################################### sub store_course_settings { + return &store_settings($env{'request.course.id'},@_); +} + +sub store_settings { # save to the environment # appenv the same items, just to be safe - my $courseid = $env{'request.course.id'}; my $udom = $env{'user.domain'}; my $uname = $env{'user.name'}; - my ($prefix,$Settings) = @_; + my ($context,$prefix,$Settings) = @_; my %SaveHash; my %AppHash; while (my ($setting,$type) = each(%$Settings)) { - my $basename = join('.','internal',$courseid,$prefix,$setting); + my $basename = join('.','internal',$context,$prefix,$setting); my $envname = 'environment.'.$basename; if (exists($env{'form.'.$setting})) { # Save this value away @@ -6123,15 +6122,19 @@ sub store_course_settings { } # Make sure these settings stick around in this session, too &Apache::lonnet::appenv(%AppHash); + &Apache::lonnet::logthis(join(':',%AppHash)); return; } sub restore_course_settings { - my $courseid = $env{'request.course.id'}; - my ($prefix,$Settings) = @_; + return &return_settings($env{'request.course.id'},@_); +} + +sub restore_settings { + my ($context,$prefix,$Settings) = @_; while (my ($setting,$type) = each(%$Settings)) { next if (exists($env{'form.'.$setting})); - my $envname = 'environment.internal.'.$courseid.'.'.$prefix. + my $envname = 'environment.internal.'.$context.'.'.$prefix. '.'.$setting; if (exists($env{$envname})) { if ($type eq 'scalar') {