--- loncom/interface/lonpreferences.pm 2003/04/01 22:21:45 1.18 +++ loncom/interface/lonpreferences.pm 2003/04/30 15:12:29 1.22 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.18 2003/04/01 22:21:45 www Exp $ +# $Id: lonpreferences.pm,v 1.22 2003/04/30 15:12:29 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -265,6 +265,151 @@ $message ENDVCMSG } +################################################################ +# Colors # +################################################################ + +sub colorschanger { + my $r = shift; + my $bodytag=&Apache::loncommon::bodytag( + 'Change Color Scheme for Current Role Type','', + 'onUnload="pclose();"'); +# figure out colors + my $function='student'; + if ($ENV{'request.role'}=~/^(cc|in|ta|ep)/) { + $function='coordinator'; + } + if ($ENV{'request.role'}=~/^(su|dc|ad|li)/) { + $function='admin'; + } + if (($ENV{'request.role'}=~/^(au|ca)/) || + ($ENV{'REQUEST_URI'}=~/^(\/priv|\~)/)) { + $function='author'; + } + my $domain=&Apache::loncommon::determinedomain(); + my %colortypes=('pgbg' => 'Page Background', + 'tabbg' => 'Header Background', + 'sidebg'=> 'Header Border', + 'font' => 'Font', + 'link' => 'Un-Visited Link', + 'vlink' => 'Visited Link', + 'alink' => 'Active Link'); + my $chtable=''; + foreach my $item (sort(keys(%colortypes))) { + my $curcol=&Apache::loncommon::designparm($function.'.'.$item,$domain); + $chtable.='