--- loncom/interface/lonpreferences.pm 2009/02/17 21:18:05 1.138 +++ loncom/interface/lonpreferences.pm 2009/05/05 16:01:50 1.158 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.138 2009/02/17 21:18:05 schafran Exp $ +# $Id: lonpreferences.pm,v 1.158 2009/05/05 16:01:50 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -101,7 +101,7 @@ sub wysiwygchanger { Apache::lonhtmlcommon::add_breadcrumb( { href => '/adm/preferences?action=changewysiwyg', text => 'Change WYSIWYG Preferences'}); - $r->print(Apache::loncommon::start_page('Change WYSIWYG Preferences')); + $r->print(Apache::loncommon::start_page('Content Display Settings')); $r->print(Apache::lonhtmlcommon::breadcrumbs('Change WYSIWYG Preferences')); my %userenv = &Apache::lonnet::get @@ -135,9 +135,9 @@ sub verify_and_change_wysiwyg { my $newsetting=$env{'form.wysiwyg'}; &Apache::lonnet::put('environment',{'wysiwygeditor' => $newsetting}); &Apache::lonnet::appenv({'environment.wysiwygeditor' => $newsetting}); -# $r->print('

'.&mt('Setting WYSIWYG editor to:').' '.&mt($newsetting).'

'); - print_main_menu($r,'

'.&mt('Setting WYSIWYG editor to:').' ' - .&mt($newsetting).'

'); + my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('WYSIWYG Editor').'',''.&mt($newsetting).'')); + $message=&Apache::loncommon::confirmwrapper($message); + &print_main_menu($r,$message); } ################################################################ @@ -149,7 +149,7 @@ sub languagechanger { Apache::lonhtmlcommon::add_breadcrumb( { href => '/adm/preferences?action=changelanguages', text => 'Change Language'}); - $r->print(Apache::loncommon::start_page('Change Language')); + $r->print(Apache::loncommon::start_page('Content Display Settings')); $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Language')); my $user = $env{'user.name'}; my $domain = $env{'user.domain'}; @@ -187,17 +187,15 @@ sub verify_and_change_languages { if ($newlanguage) { &Apache::lonnet::put('environment',{'languages' => $newlanguage}); &Apache::lonnet::appenv({'environment.languages' => $newlanguage}); - $message=&mt('Set new preferred languages to ').'"'.$newlanguage.'".'; + $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Preferred language').'','"'.$newlanguage.'".')); } else { &Apache::lonnet::del('environment',['languages']); - &Apache::lonnet::delenv('environment\.languages'); - $message=&mt('Reset preferred language.'); + &Apache::lonnet::delenv('environment.languages'); + $message=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]',''.&mt('Preferred language').'')); } + $message=&Apache::loncommon::confirmwrapper($message); &Apache::loncommon::flush_langs_cache($user,$domain); - print_main_menu($r, $message); -# $r->print(< '/adm/preferences?action=changetexenginepref', text => 'Change How Math Equations Are Displayed'}); - $r->print(Apache::loncommon::start_page('Change How Math Equations Are Displayed')); + $r->print(Apache::loncommon::start_page('Content Display Settings')); $r->print(Apache::lonhtmlcommon::breadcrumbs('Change How Math Equations Are Displayed')); my $user = $env{'user.name'}; my $domain = $env{'user.domain'}; @@ -251,7 +249,7 @@ $lt{'exmpl'}

$lt{'jsmath'}

$jsMath_start -'); + $r->print(''); } } @@ -304,18 +302,14 @@ sub verify_and_change_texengine { if ($newtexengine) { &Apache::lonnet::put('environment',{'texengine' => $newtexengine}); &Apache::lonnet::appenv({'environment.texengine' => $newtexengine}); - $message=&mt('Set new preferred math display to ').'"'.$newtexengine.'".'; + $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Preferred method to display Math').'','"'.$newtexengine.'"')); } else { &Apache::lonnet::del('environment',['texengine']); - &Apache::lonnet::delenv('environment\.texengine'); - $message=&mt('Reset preferred math display.'); + &Apache::lonnet::delenv('environment.texengine'); + $message=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]',''.&mt('Preferred method to display Math').'')); } - - -# $r->print(< '/adm/preferences?action=changerolespref', text => 'Change '.$role.' Page Pref'}); - $r->print(Apache::loncommon::start_page('Change '.$role.' Page Pref')); + $r->print(Apache::loncommon::start_page('Content Display Settings')); $r->print(Apache::lonhtmlcommon::breadcrumbs('Change '.$role.' Page Pref')); my $hotlist_flag=$userenv{'recentroles'}; my $hotlist_n=$userenv{'recentrolesn'}; @@ -452,7 +446,7 @@ sub verify_and_change_rolespref { $message=&mt('Recent '.$role.'s Hotlist is Enabled'); } else { &Apache::lonnet::del('environment',['recentroles']); - &Apache::lonnet::delenv('environment\.recentroles'); + &Apache::lonnet::delenv('environment.recentroles'); $message=&mt('Recent '.$role.'s Hotlist is Disabled'); } if ($hotlist_n) { @@ -482,7 +476,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}.'')); &Apache::lonhtmlcommon::store_recent('roles',$role_key,' ',0); } } @@ -490,17 +484,14 @@ 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}.'')); &Apache::lonhtmlcommon::store_recent('roles', $role_key,' ',1); } } - $message .= "



\n"; - -# $r->print(< '/adm/preferences?action=changescreenname', text => 'Change Screen Name'}); - $r->print(Apache::loncommon::start_page('Change Screen Name')); + $r->print(Apache::loncommon::start_page('Personal Data')); $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Screen Name')); $r->print('

' .&mt('Change the name that is displayed in your posts.') @@ -528,10 +519,10 @@ sub screennamechanger { $r->print('

' .'' .&Apache::lonhtmlcommon::start_pick_box() - .&Apache::lonhtmlcommon::row_title(&mt('New screenname (shown if you post anonymously)')) + .&Apache::lonhtmlcommon::row_title(&mt('Screenname').' '.&mt('(shown if you post anonymously)')) .'' .&Apache::lonhtmlcommon::row_closure() - .&Apache::lonhtmlcommon::row_title(&mt('New nickname (shown if you post non-anonymously)')) + .&Apache::lonhtmlcommon::row_title(&mt('Nickname').' '.&mt('(shown if you post non-anonymously)')) .'' .&Apache::lonhtmlcommon::row_closure() .&Apache::lonhtmlcommon::row_title() @@ -553,11 +544,11 @@ sub verify_and_change_screenname { if ($newscreen) { &Apache::lonnet::put('environment',{'screenname' => $newscreen}); &Apache::lonnet::appenv({'environment.screenname' => $newscreen}); - $message=&mt('Set new screenname to ').'"'.$newscreen.'.".'; + $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Screenname').'','"'.$newscreen.'."')); } else { &Apache::lonnet::del('environment',['screenname']); - &Apache::lonnet::delenv('environment\.screenname'); - $message=&mt('Reset screenname.'); + &Apache::lonnet::delenv('environment.screenname'); + $message=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]',''.&mt('Screenname').'')); } # Nickname $message.='
'; @@ -566,17 +557,15 @@ sub verify_and_change_screenname { if ($newscreen) { &Apache::lonnet::put('environment',{'nickname' => $newscreen}); &Apache::lonnet::appenv({'environment.nickname' => $newscreen}); - $message.=&mt('Set new nickname to ').'"'.$newscreen.'".'; + $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Nickname').'','"'.$newscreen.'".')); } else { &Apache::lonnet::del('environment',['nickname']); - &Apache::lonnet::delenv('environment\.nickname'); - $message.=&mt('Reset nickname.'); + &Apache::lonnet::delenv('environment.nickname'); + $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]',''.&mt('Nickname').'')); } &Apache::lonnet::devalidate_cache_new('namescache',$user.':'.$domain); -# $r->print(< '/adm/preferences?action=changeicons', text => 'Change Main Menu'}); - $r->print(Apache::loncommon::start_page('Change Main Menu')); + $r->print(Apache::loncommon::start_page('Page Display Settings')); $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Main Menu')); my $user = $env{'user.name'}; @@ -624,12 +613,13 @@ sub verify_and_change_icons { my $r = shift; my $user = $env{'user.name'}; my $domain = $env{'user.domain'}; - my $newicons = $env{'form.menumode'}; + my $newicons = $env{'form.menumode'}; &Apache::lonnet::put('environment',{'icons' => $newicons}); &Apache::lonnet::appenv({'environment.icons' => $newicons}); -# $r->print(&mt('Set menu mode to [_1].',$newicons)); - print_main_menu($r, &mt('Set menu mode to [_1].',$newicons)); + my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Menu Display').'',''.$newicons.'')); + $message=&Apache::loncommon::confirmwrapper($message); + &print_main_menu($r, $message); } ################################################################ @@ -638,10 +628,10 @@ sub verify_and_change_icons { sub clickerchanger { my $r = shift; - Apache::lonhtmlcommon::add_breadcrumb( + &Apache::lonhtmlcommon::add_breadcrumb( { href => '/adm/preferences?action=changeclicker', text => 'Register Clicker'}); - $r->print(Apache::loncommon::start_page('Register Clicker')); + $r->print(Apache::loncommon::start_page('Other')); $r->print(Apache::lonhtmlcommon::breadcrumbs('Register Clicker')); my $user = $env{'user.name'}; my $domain = $env{'user.domain'}; @@ -650,14 +640,15 @@ sub clickerchanger { my $clickers=$userenv{'clickers'}; $clickers=~s/\,/\n/gs; my $text=&mt('Enter response device ("clicker") numbers'); - my $change=&mt('Register'); + my $change=&mt('Save'); my $helplink=&Apache::loncommon::help_open_topic('Clicker_Registration',&mt('Locating your clicker ID')); $r->print(< -