--- loncom/interface/lonpreferences.pm 2003/04/19 01:42:34 1.20 +++ loncom/interface/lonpreferences.pm 2003/08/29 03:08:18 1.27 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.20 2003/04/19 01:42:34 www Exp $ +# $Id: lonpreferences.pm,v 1.27 2003/08/29 03:08:18 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -50,6 +50,7 @@ use Apache::File; use Crypt::DES; use DynaLoader; # for Crypt::DES version use Apache::loncommon(); +use Apache::lonhtmlcommon(); # # Write lonnet::passwd to do the call below. @@ -179,16 +180,23 @@ sub msgforwardchanger { my $r = shift; my $user = $ENV{'user.name'}; my $domain = $ENV{'user.domain'}; - my %userenv = &Apache::lonnet::get('environment',['msgforward']); + my %userenv = &Apache::lonnet::get('environment',['msgforward','notification','critnotification']); my $msgforward=$userenv{'msgforward'}; my $notification=$userenv{'notification'}; my $critnotification=$userenv{'critnotification'}; my $bodytag=&Apache::loncommon::bodytag( 'Change Your Message Forwarding and Notification'); + my $forwardingHelp = Apache::loncommon::help_open_topic("Prefs_Forwarding", + "What are forwarding ". + "and notification ". + "addresses"); + my $criticalMessageHelp = Apache::loncommon::help_open_topic("Course_Critical_Message", + "What are critical messages"); + $r->print(< $bodytag - +$forwardingHelp
New Forwarding Address(es) (user:domain,user:domain,...): @@ -196,7 +204,7 @@ New Forwarding Address(es) (user:dom New Message Notification Email Address(es) (joe\@doe.com,jane\@doe.edu,...):
New Critical Message Notification Email Address(es) (joe\@doe.com,jane\@doe.edu,...): -
+$criticalMessageHelp
@@ -272,7 +280,8 @@ ENDVCMSG sub colorschanger { my $r = shift; my $bodytag=&Apache::loncommon::bodytag( - 'Change Color Scheme for Current Role Type'); + 'Change Color Scheme for Current Role Type','', + 'onUnload="pclose();"'); # figure out colors my $function='student'; if ($ENV{'request.role'}=~/^(cc|in|ta|ep)/) { @@ -294,15 +303,16 @@ sub colorschanger { 'vlink' => 'Visited Link', 'alink' => 'Active Link'); my $chtable=''; - foreach my $item (keys %colortypes) { + foreach my $item (sort(keys(%colortypes))) { my $curcol=&Apache::loncommon::designparm($function.'.'.$item,$domain); $chtable.=''.$colortypes{$item}.'      Select'; + .$item."','parmform.pres','psub'".');">Select'; } + my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); $r->print(< $bodytag - +
+ + + +
$chtable
- + +
@@ -385,18 +384,19 @@ sub verify_and_change_colors { 'alink' => 'Active Link'); my $message=''; -# my $newscreen=''; -# $newscreen=~s/\,$//; -# if ($newscreen) { -# &Apache::lonnet::put('environment',{'msgforward' => $newscreen}); -# &Apache::lonnet::appenv('environment.msgforward' => $newscreen); -# $message.='Set new message forwarding to '.$newscreen.'
'; -# } else { -# &Apache::lonnet::del('environment',['msgforward']); -# &Apache::lonnet::delenv('environment\.msgforward'); -# $message.='Reset message forwarding
'; -# } - + foreach my $item (keys %colortypes) { + my $color=$ENV{'form.'.$item}; + my $entry='color.'.$function.'.'.$item; + if (($color=~/^\#[0-9A-Fa-f]{6}$/) && (!$ENV{'form.resetall'})) { + &Apache::lonnet::put('environment',{$entry => $color}); + &Apache::lonnet::appenv('environment.'.$entry => $color); + $message.='Set '.$colortypes{$item}.' to '.$color.'
'; + } else { + &Apache::lonnet::del('environment',[$entry]); + &Apache::lonnet::delenv('environment\.'.$entry); + $message.='Reset '.$colortypes{$item}.'
'; + } + } my $bodytag=&Apache::loncommon::bodytag( 'Change Color Scheme for Current Role Type'); $r->print(< $message +
+ + +
ENDVCCOL } @@ -654,7 +658,9 @@ sub handler { } elsif ($ENV{'form.action'} eq 'verify_and_change_colors') { &verify_and_change_colors($r); } elsif ($ENV{'form.action'} eq 'debugtoggle') { - if ($ENV{'user.name'} eq 'albertel' ) { + if (($ENV{'user.name'} eq 'albertel' ) || + ($ENV{'user.name'} eq 'kortemey' ) || + ($ENV{'user.name'} eq 'korte')) { if ($ENV{'user.debug'}) { &Apache::lonnet::delenv('user\.debug'); } else { @@ -709,7 +715,9 @@ ENDABOUTME ENDCOLORFORM - if ($ENV{'user.name'} eq 'albertel') { + if (($ENV{'user.name'} eq 'albertel' ) || + ($ENV{'user.name'} eq 'kortemey' ) || + ($ENV{'user.name'} eq 'korte')) { $r->print(<