--- loncom/interface/lonpreferences.pm 2009/12/07 00:04:10 1.125.8.4 +++ loncom/interface/lonpreferences.pm 2009/08/19 20:03:40 1.169 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.125.8.4 2009/12/07 00:04:10 raeburn Exp $ +# $Id: lonpreferences.pm,v 1.169 2009/08/19 20:03:40 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -42,7 +42,6 @@ use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::lonlocal; use Apache::lonnet; -use LONCAPA::lonauthcgi(); use LONCAPA(); # @@ -99,6 +98,12 @@ sub des_decrypt { sub wysiwygchanger { my $r = shift; + Apache::lonhtmlcommon::add_breadcrumb( + { href => '/adm/preferences?action=changewysiwyg', + text => '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 ('environment',['wysiwygeditor']); my $onselect='checked="checked"'; @@ -132,9 +137,7 @@ sub verify_and_change_wysiwyg { &Apache::lonnet::appenv({'environment.wysiwygeditor' => $newsetting}); my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('WYSIWYG Editor').'',''.&mt($newsetting).'')); $message=&Apache::loncommon::confirmwrapper($message); - $r->print(< '/adm/preferences?action=changelanguages', + text => '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'}; my %userenv = &Apache::lonnet::get @@ -186,9 +195,7 @@ sub verify_and_change_languages { } $message=&Apache::loncommon::confirmwrapper($message); &Apache::loncommon::flush_langs_cache($user,$domain); - $r->print(< '/adm/preferences?action=changetexenginepref', + text => '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'}; my %userenv = &Apache::lonnet::get('environment',['texengine']); @@ -241,7 +253,7 @@ sub texenginechanger { -$lt{'preftxt'}: $selectionbox +$lt{'preftxt'}: $selectionbox @@ -253,7 +265,7 @@ $lt{'exmpl'} $lt{'jsmath'} $jsMath_start -'); + $r->print(''); } } @@ -302,9 +314,7 @@ sub verify_and_change_texengine { $message=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]',''.&mt('Preferred method to display Math').'')); } $message=&Apache::loncommon::confirmwrapper($message); - $r->print(< '/adm/preferences?action=changerolespref', + text => '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'}; my $checked; if ($hotlist_flag) { - $checked = ' checked="checked"'; + $checked = 'checked="checked"'; } if (!$hotlist_n) { $hotlist_n=3; } @@ -466,7 +481,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 .= "".&Apache::lonhtmlcommon::confirm_success(&mt('Unfreezing '.$role.': [_1]',''.$role_text{$role_key}.'')); + $message .= "".&Apache::lonhtmlcommon::confirm_success(&mt('Unfreezing '.$role.': [_1]',''.$role_text{$role_key}.'')); &Apache::lonhtmlcommon::store_recent('roles',$role_key,' ',0); } } @@ -481,9 +496,7 @@ sub verify_and_change_rolespref { } } $message=&Apache::loncommon::confirmwrapper($message); - $r->print(< '/adm/preferences?action=changescreenname', + text => '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.') .'' @@ -506,10 +524,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() @@ -552,9 +570,7 @@ sub verify_and_change_screenname { } &Apache::lonnet::devalidate_cache_new('namescache',$user.':'.$domain); $message=&Apache::loncommon::confirmwrapper($message); - $r->print(< '/adm/preferences?action=changeicons', + text => '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'}; my $domain = $env{'user.domain'}; my %userenv = &Apache::lonnet::get @@ -596,15 +618,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}); my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Menu Display').'',''.$newicons.'')); $message=&Apache::loncommon::confirmwrapper($message); - $r->print(< '/adm/preferences?action=changeclicker', + text => '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'}; my %userenv = &Apache::lonnet::get @@ -620,7 +645,7 @@ 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(< @@ -649,9 +674,7 @@ sub verify_and_change_clicker { &Apache::lonnet::appenv({'environment.clickers' => $newclickers}); my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Registering clickers: [_1]',$newclickers)); $message=&Apache::loncommon::confirmwrapper($message); - $r->print(< '/adm/preferences?action=changedomcoord', + text => 'Restrict Domain Coordinator Access'}); + $r->print(Apache::loncommon::start_page('Restrict Domain Coordinator Access')); + $r->print(Apache::lonhtmlcommon::breadcrumbs('Restrict Domain Coordinator Access')); my $user = $env{'user.name'}; my $domain = $env{'user.domain'}; my %userenv = &Apache::lonnet::get @@ -697,9 +725,7 @@ sub verify_and_change_domcoord { } my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Block access to construction space').'',''.$status.'')); $message=&Apache::loncommon::confirmwrapper($message); - $r->print(< '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', + # old: 'Message Notification Email Address(es)', mnot_exmpl => 'e.g. joe@doe.com', chg => 'Save', email => 'The e-mail address entered in row ', notv => 'is not a valid e-mail address', - toen => "To enter multiple addresses, enter one address at a time, click 'Save' and then add the next one", + toen => "To enter multiple addresses, enter one address at a time, click 'Change' and then add the next one", prme => 'Back', ); + Apache::lonhtmlcommon::add_breadcrumb( + { href => '/adm/preferences?action=changemsgforward', + text => 'Change Message Forwarding/Notification'}); + $r->print(Apache::loncommon::start_page('Message Management')); + $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Message Forwarding/Notification')); my $forwardingHelp = &Apache::loncommon::help_open_topic("Prefs_Forwarding"); my $notificationHelp = &Apache::loncommon::help_open_topic("Prefs_Notification"); my $criticalMessageHelp = &Apache::loncommon::help_open_topic("Course_Critical_Message"); @@ -770,7 +802,7 @@ sub msgforwardchanger { my %allnot = &get_notifications(\%userenv); my $validatescript = &Apache::lonhtmlcommon::javascript_valid_email(); my $jscript = qq| -
-$lt{'preftxt'}: $selectionbox +$lt{'preftxt'}: $selectionbox
$jsMath_start -'); + $r->print(''); } } @@ -302,9 +314,7 @@ sub verify_and_change_texengine { $message=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]',''.&mt('Preferred method to display Math').'')); } $message=&Apache::loncommon::confirmwrapper($message); - $r->print(< '/adm/preferences?action=changerolespref', + text => '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'}; my $checked; if ($hotlist_flag) { - $checked = ' checked="checked"'; + $checked = 'checked="checked"'; } if (!$hotlist_n) { $hotlist_n=3; } @@ -466,7 +481,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 .= "".&Apache::lonhtmlcommon::confirm_success(&mt('Unfreezing '.$role.': [_1]',''.$role_text{$role_key}.'')); + $message .= "".&Apache::lonhtmlcommon::confirm_success(&mt('Unfreezing '.$role.': [_1]',''.$role_text{$role_key}.'')); &Apache::lonhtmlcommon::store_recent('roles',$role_key,' ',0); } } @@ -481,9 +496,7 @@ sub verify_and_change_rolespref { } } $message=&Apache::loncommon::confirmwrapper($message); - $r->print(< '/adm/preferences?action=changescreenname', + text => '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.') .'' @@ -506,10 +524,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() @@ -552,9 +570,7 @@ sub verify_and_change_screenname { } &Apache::lonnet::devalidate_cache_new('namescache',$user.':'.$domain); $message=&Apache::loncommon::confirmwrapper($message); - $r->print(< '/adm/preferences?action=changeicons', + text => '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'}; my $domain = $env{'user.domain'}; my %userenv = &Apache::lonnet::get @@ -596,15 +618,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}); my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Menu Display').'',''.$newicons.'')); $message=&Apache::loncommon::confirmwrapper($message); - $r->print(< '/adm/preferences?action=changeclicker', + text => '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'}; my %userenv = &Apache::lonnet::get @@ -620,7 +645,7 @@ 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(< @@ -649,9 +674,7 @@ sub verify_and_change_clicker { &Apache::lonnet::appenv({'environment.clickers' => $newclickers}); my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Registering clickers: [_1]',$newclickers)); $message=&Apache::loncommon::confirmwrapper($message); - $r->print(< '/adm/preferences?action=changedomcoord', + text => 'Restrict Domain Coordinator Access'}); + $r->print(Apache::loncommon::start_page('Restrict Domain Coordinator Access')); + $r->print(Apache::lonhtmlcommon::breadcrumbs('Restrict Domain Coordinator Access')); my $user = $env{'user.name'}; my $domain = $env{'user.domain'}; my %userenv = &Apache::lonnet::get @@ -697,9 +725,7 @@ sub verify_and_change_domcoord { } my $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Block access to construction space').'',''.$status.'')); $message=&Apache::loncommon::confirmwrapper($message); - $r->print(< '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', + # old: 'Message Notification Email Address(es)', mnot_exmpl => 'e.g. joe@doe.com', chg => 'Save', email => 'The e-mail address entered in row ', notv => 'is not a valid e-mail address', - toen => "To enter multiple addresses, enter one address at a time, click 'Save' and then add the next one", + toen => "To enter multiple addresses, enter one address at a time, click 'Change' and then add the next one", prme => 'Back', ); + Apache::lonhtmlcommon::add_breadcrumb( + { href => '/adm/preferences?action=changemsgforward', + text => 'Change Message Forwarding/Notification'}); + $r->print(Apache::loncommon::start_page('Message Management')); + $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Message Forwarding/Notification')); my $forwardingHelp = &Apache::loncommon::help_open_topic("Prefs_Forwarding"); my $notificationHelp = &Apache::loncommon::help_open_topic("Prefs_Notification"); my $criticalMessageHelp = &Apache::loncommon::help_open_topic("Course_Critical_Message"); @@ -770,7 +802,7 @@ sub msgforwardchanger { my %allnot = &get_notifications(\%userenv); my $validatescript = &Apache::lonhtmlcommon::javascript_valid_email(); my $jscript = qq| -
' .&mt('Change the name that is displayed in your posts.') .'