--- loncom/interface/lonpreferences.pm 2009/04/25 17:14:24 1.153 +++ 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.153 2009/04/25 17:14:24 www Exp $ +# $Id: lonpreferences.pm,v 1.157 2009/05/05 11:40:51 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -473,7 +473,7 @@ sub verify_and_change_rolespref { # Unset any roles that were previously frozen but aren't in list foreach my $role_key (sort(keys(%recent_roles))) { if (($frozen_roles{$role_key}) && (!exists($freeze{$role_key}))) { - $message .= "
".&mt('Unfreezing '.$role.': [_1]',$role_text{$role_key})."\n"; + $message .= "
".&Apache::lonhtmlcommon::confirm_success(&mt('Unfreezing '.$role.': [_1]',$role_text{$role_key}))."\n"; &Apache::lonhtmlcommon::store_recent('roles',$role_key,' ',0); } } @@ -481,7 +481,8 @@ sub verify_and_change_rolespref { # Freeze selected roles foreach my $role_key (@freeze_list) { if (!$frozen_roles{$role_key}) { - $message .= "
".&mt('Freezing '.$role.': [_1]',$role_text{$role_key})."\n"; + $message .= "
". + &Apache::lonhtmlcommon::confirm_success(&mt('Freezing '.$role.': [_1]',$role_text{$role_key}))."\n"; &Apache::lonhtmlcommon::store_recent('roles', $role_key,' ',1); } @@ -568,7 +569,7 @@ sub verify_and_change_screenname { ################################################################ sub iconchanger { my $r = shift; - Apache::lonhtmlcommon::add_breadcrumb( + &Apache::lonhtmlcommon::add_breadcrumb( { href => '/adm/preferences?action=changeicons', text => 'Change Main Menu'}); $r->print(Apache::loncommon::start_page('Page Display Settings')); @@ -669,7 +670,7 @@ sub verify_and_change_clicker { sub domcoordchanger { my $r = shift; - Apache::lonhtmlcommon::add_breadcrumb( + &Apache::lonhtmlcommon::add_breadcrumb( { href => '/adm/preferences?action=changedomcoord', text => 'Restrict Domain Coordinator Access'}); $r->print(Apache::loncommon::start_page('Restrict Domain Coordinator Access')); @@ -1076,13 +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', - '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))) { @@ -1093,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(< @@ -1139,8 +1143,10 @@ $start_data_table $chtable $end_data_table - - +

+ + +

ENDCOL } @@ -1150,13 +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', - '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) { @@ -1165,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}); @@ -1205,7 +1217,9 @@ sub passwordchanger { $defdom = $r->dir_config('lonDefDomain'); my %data = &Apache::lonnet::tmpget($mailtoken); if (keys(%data) == 0) { - $r->print(&mt('Sorry, the URL you provided to complete the reset of your password was invalid. Either the token included in the URL has been deleted or the URL you provided was invalid. Please submit a new request for a password reset, and follow the link to the new URL included in the e-mail that will be sent to you, to allow you to enter a new password.')); + $r->print(&mt('Sorry, the URL you provided to complete the reset of your password was invalid. Either the token included in the URL has been deleted or the URL you provided was invalid. Please submit a [_1]new request[_2] for a password reset, and follow the link to the new URL included in the e-mail that will be sent to you, to allow you to enter a new password.' + ,'','') + ); return; } if (defined($data{time})) { @@ -1538,7 +1552,8 @@ ENDERROR } } else { # error error: run in circles, scream and shout - $message = &mt("The password for [_1] was not changed.",$user).' '.&mt('Please make sure your old password was entered correctly.'); + $message = &Apache::lonhtmlcommon::confirm_success( + &mt("The password for [_1] was not changed.",$user).' '.&mt('Please make sure your old password was entered correctly.'),1); unless ($caller eq 'reset_by_email') { &print_main_menu($r, $message); } @@ -2040,8 +2055,8 @@ sub handler { }elsif($env{'form.action'} eq 'verify_and_change_coursepage'){ &verify_and_change_coursepage($r); }elsif($env{'form.action'} eq 'debugtoggle'){ - toggle_debug(); - print_main_menu($r); + &toggle_debug(); + &print_main_menu($r); } return OK; @@ -2322,7 +2337,8 @@ sub handler2 { })); } - if ($env{'user.name'} =~ /^(albertel|fox|foxr|kortemey|korte|raeburn)$/) { + if (($env{'user.name'} =~ /^(albertel|fox|foxr|kortemey|korte|raeburn)$/) + && ($env{'user.domain'} =~/^(msu|gerd)$/)){ push (@Options,({ action => 'debugtoggle', printmenu => 'yes', subroutine => \&toggle_debug,