--- loncom/interface/lonpreferences.pm 2009/05/04 19:35:31 1.156 +++ loncom/interface/lonpreferences.pm 2009/05/05 11:40:51 1.157 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.156 2009/05/04 19:35:31 tempelho Exp $ +# $Id: lonpreferences.pm,v 1.157 2009/05/05 11:40:51 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1077,14 +1077,16 @@ sub colorschanger { # figure out colors my $function=&Apache::loncommon::get_users_function(); my $domain=&Apache::loncommon::determinedomain(); - my %colortypes=('pgbg' => 'Page Background', - 'tabbg' => 'Header Background', - 'sidebg'=> 'Header Border', - 'font' => 'Font', - 'fontmenu' => 'Font Menu', - 'link' => 'Un-Visited Link', - 'vlink' => 'Visited Link', - 'alink' => 'Active Link'); + my %colortypes=&Apache::lonlocal::texthash( + 'pgbg' => 'Page Background Color', + 'tabbg' => 'Header Background Color', + 'sidebg' => 'Header Border Color', + 'font' => 'Font Color', + 'fontmenu' => 'Font Menu Color', + 'link' => 'Un-Visited Link Color', + 'vlink' => 'Visited Link Color', + 'alink' => 'Active Link Color', + ); my $start_data_table = &Apache::loncommon::start_data_table(); my $chtable=''; foreach my $item (sort(keys(%colortypes))) { @@ -1095,14 +1097,14 @@ sub colorschanger { '" size="10" value="'.$curcol. '" />Select'. + .$item."','parmform.pres','psub'".');">'.&mt('Select').''. &Apache::loncommon::end_data_table_row()."\n"; } my $end_data_table = &Apache::loncommon::end_data_table(); my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); - my $save = &mt('Save'); - my $rstall = &mt('Reset All'); - my $resetdefault = &mt('Reset All Colors to Default'); + my $savebutton = &mt('Save'); + my $resetbutton = &mt('Reset All'); + my $resetbuttondesc = &mt('Reset All Colors to Default'); $r->print(< @@ -1141,8 +1143,10 @@ $start_data_table $chtable $end_data_table - - +

+ + +

ENDCOL } @@ -1152,14 +1156,16 @@ sub verify_and_change_colors { # figure out colors my $function=&Apache::loncommon::get_users_function(); my $domain=&Apache::loncommon::determinedomain(); - my %colortypes=('pgbg' => 'Page Background', - 'tabbg' => 'Header Background', - 'sidebg'=> 'Header Border', - 'font' => 'Font', - 'fontmenu' => 'Font Menu', - 'link' => 'Un-Visited Link', - 'vlink' => 'Visited Link', - 'alink' => 'Active Link'); + my %colortypes=&Apache::lonlocal::texthash( + 'pgbg' => 'Page Background Color', + 'tabbg' => 'Header Background Color', + 'sidebg' => 'Header Border Color', + 'font' => 'Font Color', + 'fontmenu' => 'Font Menu Color', + 'link' => 'Un-Visited Link Color', + 'vlink' => 'Visited Link Color', + 'alink' => 'Active Link Color', + ); my $message=''; foreach my $item (keys %colortypes) { @@ -1168,13 +1174,16 @@ sub verify_and_change_colors { if (($color=~/^\#[0-9A-Fa-f]{6}$/) && (!$env{'form.resetall'})) { &Apache::lonnet::put('environment',{$entry => $color}); &Apache::lonnet::appenv({'environment.'.$entry => $color}); - $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set '.$colortypes{$item}.' to ').'"'.$color.'"').'
'; + $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.$colortypes{$item}.'','"'.$color.'"')) + .'
'; } else { &Apache::lonnet::del('environment',[$entry]); &Apache::lonnet::delenv('environment.'.$entry); - $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Reset '.$colortypes{$item}.'.')).'
'; + $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]',''.$colortypes{$item}.'')) + .'
'; } } + my $now = time; &Apache::lonnet::put('environment',{'color.timestamp' => $now}); &Apache::lonnet::appenv({'environment.color.timestamp' => $now});