--- loncom/interface/lonpreferences.pm 2010/01/28 15:40:10 1.125.4.9 +++ loncom/interface/lonpreferences.pm 2009/12/07 01:41:31 1.125.8.5 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.125.4.9 2010/01/28 15:40:10 raeburn Exp $ +# $Id: lonpreferences.pm,v 1.125.8.5 2009/12/07 01:41:31 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -156,11 +156,8 @@ sub languagechanger { = &Apache::loncommon::plainlanguagedescription($_); } } - my $selectionbox= - &Apache::loncommon::select_form( - $language, - 'language', - &Apache::lonlocal::texthash(%langchoices)); + my $selectionbox=&Apache::loncommon::select_form($language,'language', + %langchoices); $r->print(< @@ -211,15 +208,12 @@ sub texenginechanger { 'mimetex' => 'mimetex (Convert to Images)', 'raw' => 'Raw (Screen Reader)' ); - my $selectionbox= - &Apache::loncommon::select_form( - $texengine, - 'texengine', - &Apache::lonlocal::texthash(%mathchoices)); + my $selectionbox=&Apache::loncommon::select_form($texengine,'texengine', + %mathchoices); my $jsMath_start=&Apache::lontexconvert::jsMath_header(); my %lt=&Apache::lonlocal::texthash( - 'headline' => 'Change how math is displayed', - 'preftxt' => 'Preferred method to display math', + 'headline' => 'Change Math Preferences', + 'preftxt' => 'Preferred method to display Math', 'change' => 'Save', 'exmpl' => 'Examples', 'jsmath' => 'jsMath:', @@ -274,7 +268,7 @@ if (jsMath.nofonts == 1) {

$lt{'tth'}

- +

ENDLSCREEN if ($env{'environment.texengine'} ne 'jsMath') { @@ -383,20 +377,13 @@ sub rolesprefchanger {

-
'. -'

'.&mt('Recent '.$role.'s Hotlist').'

'. -&Apache::lonhtmlcommon::start_pick_box(). -&Apache::lonhtmlcommon::row_title(''). -''. -&Apache::lonhtmlcommon::row_closure(). -&Apache::lonhtmlcommon::row_title(''). -''. -&Apache::lonhtmlcommon::row_closure(1). -&Apache::lonhtmlcommon::end_pick_box(). -'

'.&mt('Freeze Roles').'

'. -'

'.&mt('This list below can be used to freeze '.$lc_role.'s on your screen. Those marked as frozen will not be removed from the list, even if they have not been used recently.').' +
+
'.&mt('Number of '.$role.'s in Hotlist:').' + +

'.&mt('This list below can be used to freeze '.$lc_role.'s on your screen. Those marked as frozen will not be removed from the list, even if they have not been used recently.').'

'.$roles_check_list.'
@@ -446,11 +433,11 @@ sub verify_and_change_rolespref { if ($hotlist_flag) { &Apache::lonnet::put('environment',{'recentroles' => $hotlist_flag}); &Apache::lonnet::appenv({'environment.recentroles' => $hotlist_flag}); - $message=&Apache::lonhtmlcommon::confirm_success(&mt('Recent '.$role.'s Hotlist is Enabled.')." ".&mt('Display [_1] Most Recent '.$role.'s.',$hotlist_n)); + $message=&mt('Recent '.$role.'s Hotlist is Enabled'); } else { &Apache::lonnet::del('environment',['recentroles']); &Apache::lonnet::delenv('environment.recentroles'); - $message=&Apache::lonhtmlcommon::confirm_success(&mt('Recent '.$role.'s Hotlist is Disabled')); + $message=&mt('Recent '.$role.'s Hotlist is Disabled'); } if ($hotlist_n) { &Apache::lonnet::put('environment',{'recentrolesn' => $hotlist_n}); @@ -765,9 +752,8 @@ sub msgforwardchanger { all => 'All', crit => 'Critical only', reg => 'Non-critical only', - foad => 'Forward to account(s)', - fwdm => 'Forward messages to other account(s) in LON-CAPA', - noti => 'E-mail notification of LON-CAPA messages', + foad => 'Forwarding Address(es)', + noti => 'Notification E-mail Address(es)', foad_exmpl => 'e.g. userA:domain1,userB:domain2,...', mnot => 'E-mail Address(es) which should be notified about new LON-CAPA messages', mnot_exmpl => 'e.g. joe@doe.com', @@ -842,12 +828,11 @@ $validatescript $r->print(<$lt{'fwdm'} $forwardingHelp +

$lt{'foad'} $forwardingHelp

$lt{'foad'} ($lt{'foad_exmpl'}): - -

+

$lt{'noti'} $notificationHelp

$lt{'mnot'} ($lt{'mnot_exmpl'}):
ENDMSG @@ -892,7 +877,7 @@ ENDMSG ''. - $lt{$type}.''.(' ' x4); + $lt{$type}.' '; } my $htmlon = ''; my $htmloff = ''; @@ -904,7 +889,7 @@ ENDMSG $output .= ''.(' ' x3). + &mt('Yes').' '. ' '; } $output .= ''.(' ' x3). + '" value="1" />'.&mt('Yes').' '. ''. @@ -970,32 +955,28 @@ sub verify_and_change_msgforward { my $domain = $env{'user.domain'}; my $newscreen = ''; my $message=''; - foreach my $recip (split(/\,/,$env{'form.msgforward'})) { - my ($msuser,$msdomain); - if ($recip =~ /:/) { - ($msuser,$msdomain)=split(':',$recip); - } else { - ($msuser,$msdomain)=split(/\@/,$recip); - } + foreach (split(/\,/,$env{'form.msgforward'})) { + my ($msuser,$msdomain)=split(/[\@\:]/,$_); $msuser = &LONCAPA::clean_username($msuser); $msdomain = &LONCAPA::clean_domain($msdomain); if (($msuser) && ($msdomain)) { if (&Apache::lonnet::homeserver($msuser,$msdomain) ne 'no_host') { - $newscreen.=$msuser.':'.$msdomain.','; - } else { - $message.= &mt('No such user: ').''.$msuser.':'.$msdomain.'
'; - } + $newscreen.=$msuser.':'.$msdomain.','; + } else { + $message.= &mt('No such user: ').''.$msuser.':'.$msdomain.'
'; + } } } $newscreen=~s/\,$//; if ($newscreen) { &Apache::lonnet::put('environment',{'msgforward' => $newscreen}); &Apache::lonnet::appenv({'environment.msgforward' => $newscreen}); - $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Set message forwarding to ').'"'.$newscreen.'".
'); + $message .= &mt('Set message forwarding to ').'"'.$newscreen.'".' + .'
'; } else { &Apache::lonnet::del('environment',['msgforward']); &Apache::lonnet::delenv('environment.msgforward'); - $message.= &Apache::lonhtmlcommon::confirm_success(&mt("Set message forwarding to 'off'.").'
'); + $message.= &mt("Set message forwarding to 'off'.").'
'; } my $critnotification; my $notification; @@ -1031,33 +1012,33 @@ sub verify_and_change_msgforward { if ($notification) { &Apache::lonnet::put('environment',{'notification' => $notification}); &Apache::lonnet::appenv({'environment.notification' => $notification}); - $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set non-critical message notification address(es) to ').'"'.$notification.'".
'); + $message.=&mt('Set non-critical message notification address(es) to ').'"'.$notification.'".
'; } else { &Apache::lonnet::del('environment',['notification']); &Apache::lonnet::delenv('environment.notification'); - $message.=&Apache::lonhtmlcommon::confirm_success(&mt("Set non-critical message notification to 'off'.").'
'); + $message.=&mt("Set non-critical message notification to 'off'.").'
'; } if ($critnotification) { &Apache::lonnet::put('environment',{'critnotification' => $critnotification}); &Apache::lonnet::appenv({'environment.critnotification' => $critnotification}); - $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set critical message notification address(es) to ').'"'.$critnotification.'".
'); + $message.=&mt('Set critical message notification address(es) to ').'"'.$critnotification.'".
'; } else { &Apache::lonnet::del('environment',['critnotification']); &Apache::lonnet::delenv('environment.critnotification'); - $message.=&Apache::lonhtmlcommon::confirm_success(&mt("Set critical message notification to 'off'.").'
'); + $message.=&mt("Set critical message notification to 'off'.").'
'; } if ($critnotification || $notification) { if ($notify_with_html) { &Apache::lonnet::put('environment',{'notifywithhtml' => $notify_with_html}); &Apache::lonnet::appenv({'environment.notifywithhtml' => $notify_with_html}); - $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set address(es) to receive excerpts with html retained ').'"'.$notify_with_html.'".'); + $message.=&mt('Set address(es) to receive excerpts with html retained ').'"'.$notify_with_html.'".'; } else { &Apache::lonnet::del('environment',['notifywithhtml']); &Apache::lonnet::delenv('environment.notifywithhtml'); if ($totaladdresses == 1) { - $message.=&Apache::lonhtmlcommon::confirm_success(&mt("Set notification address to receive excerpts with html stripped.")); + $message.=&mt("Set notification address to receive excerpts with html stripped."); } else { - $message.=&Apache::lonhtmlcommon::confirm_success(&mt("Set all notification addresses to receive excerpts with html stripped.")); + $message.=&mt("Set all notification addresses to receive excerpts with html stripped."); } } } else { @@ -1068,7 +1049,6 @@ sub verify_and_change_msgforward { $message .= '

'; } &Apache::loncommon::flush_email_cache($user,$domain); - $message=&Apache::loncommon::confirmwrapper($message); &msgforwardchanger($r,$message); } @@ -1541,7 +1521,6 @@ ENDERROR my $message; if ($result =~ /^ok$/) { $message = &Apache::lonhtmlcommon::confirm_success(&mt('The password for user [_1] was successfully changed.',''.$user.'')); - $message = &Apache::loncommon::confirmwrapper($message); if ($caller eq 'reset_by_email') { $r->print($message.'
'); } else { @@ -1770,19 +1749,19 @@ sub verify_and_change_coursepage { my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; my ($furl,$ferr)= &Apache::lonuserstate::readmap($cdom.'/'.$cnum); - $message .= '
'.$lt{'gtts'}.' '.&mt('now').''; + $message .= '
'.$lt{'gtts'}.' '.&mt('now').''; } else { - $message .= '
'.$lt{'dasp'}.''; + $message .= '
'.$lt{'dasp'}.''; } } $message = &Apache::lonhtmlcommon::confirm_success($message); - $message = &Apache::loncommon::confirmwrapper($message); $r->print(< 'Prefs_Messages', breadcrumb => { href => '/adm/preferences?action=changemsgforward', - - text => 'Messages & Notifications'}, + text => 'Change Message Forwarding/Notification'}, subroutine => \&msgforwardchanger, }, { action => 'verify_and_change_msgforward', help => 'Prefs_Messages', breadcrumb => { href => '/adm/preferences?action=changemsgforward', - text => 'Messages & Notifications'}, + text => 'Change Message Forwarding/Notification'}, printmenu => 'no', subroutine => \&verify_and_change_msgforward })); if (&Apache::lonnet::usertools_access($user,$domain,'aboutme')) { @@ -1886,22 +1864,24 @@ sub handler { printmenu => 'yes', subroutine => \&verify_and_change_colors, })); - push (@Options,({ action => 'changelanguages', - linktext => 'Change Language Preferences', - href => '/adm/preferences', - help => 'Prefs_Language', - breadcrumb=> - { href => '/adm/preferences?action=changelanguages', - text => 'Change Language'}, - subroutine => \&languagechanger, - }, - { action => 'verify_and_change_languages', - breadcrumb=> - {href => '/adm/preferences?action=changelanguages', - text => 'Change Language'}, - printmenu => 'yes', - subroutine=>\&verify_and_change_languages, } + if ($env{'user.adv'}) { + push (@Options,({ action => 'changelanguages', + linktext => 'Change Language Preferences', + href => '/adm/preferences', + help => 'Prefs_Language', + breadcrumb=> + { href => '/adm/preferences?action=changelanguages', + text => 'Change Language'}, + subroutine => \&languagechanger, + }, + { action => 'verify_and_change_languages', + breadcrumb=> + {href => '/adm/preferences?action=changelanguages', + text => 'Change Language'}, + printmenu => 'yes', + subroutine=>\&verify_and_change_languages, } )); + } push (@Options,({ action => 'changewysiwyg', linktext => 'Change WYSIWYG Editor Preferences', href => '/adm/preferences', @@ -1952,12 +1932,12 @@ sub handler { })); push (@Options,({ action => 'changetexenginepref', - linktext => 'Math display settings', + linktext => 'Change How Math Equations Are Displayed', href => '/adm/preferences', subroutine => \&texenginechanger, breadcrumb => { href => '/adm/preferences?action=changetexenginepref', - text => 'Math display settings'}, + text => 'Change Math Pref'}, }, { action => 'verify_and_change_texengine', subroutine => \&verify_and_change_texengine, @@ -1994,22 +1974,23 @@ sub handler { text => 'Change Main Menu'}, printmenu => 'yes', })); - - push (@Options,({ action => 'changeclicker', - linktext => 'Register Response Devices ("Clickers")', - href => '/adm/preferences', - subroutine => \&clickerchanger, - breadcrumb => - { href => '/adm/preferences?action=changeclicker', - text => 'Register Clicker'}, - }, - { action => 'verify_and_change_clicker', - subroutine => \&verify_and_change_clicker, - breadcrumb => - { href => '/adm/preferences?action=changeclicker', - text => 'Register Clicker'}, - printmenu => 'yes', - })); + if ($env{'user.adv'}) { + push (@Options,({ action => 'changeclicker', + linktext => 'Register Response Devices ("Clickers")', + href => '/adm/preferences', + subroutine => \&clickerchanger, + breadcrumb => + { href => '/adm/preferences?action=changeclicker', + text => 'Register Clicker'}, + }, + { action => 'verify_and_change_clicker', + subroutine => \&verify_and_change_clicker, + breadcrumb => + { href => '/adm/preferences?action=changeclicker', + text => 'Register Clicker'}, + printmenu => 'yes', + })); + } my %author_roles = &Apache::lonnet::get_my_roles($user,$domain,'userroles','',['au']); if (keys(%author_roles) > 0) { push (@Options,({ action => 'changedomcoord',