--- loncom/interface/lonpreferences.pm 2009/09/23 15:12:54 1.125.8.1 +++ loncom/interface/lonpreferences.pm 2008/12/08 23:09:26 1.131 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.125.8.1 2009/09/23 15:12:54 gci Exp $ +# $Id: lonpreferences.pm,v 1.131 2008/12/08 23:09:26 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -98,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('Change WYSIWYG Preferences')); + $r->print(Apache::lonhtmlcommon::breadcrumbs('Change WYSIWYG Preferences')); + my %userenv = &Apache::lonnet::get ('environment',['wysiwygeditor']); my $onselect='checked="checked"'; @@ -120,7 +126,7 @@ $warning
ENDLSCREEN - $r->print('
'); + $r->print('
'); } @@ -129,11 +135,9 @@ sub verify_and_change_wysiwyg { my $newsetting=$env{'form.wysiwyg'}; &Apache::lonnet::put('environment',{'wysiwygeditor' => $newsetting}); &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(<print('

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

'); + print_main_menu($r,'

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

'); } ################################################################ @@ -141,6 +145,12 @@ ENDVCSCREEN ################################################################ sub languagechanger { my $r = shift; + + Apache::lonhtmlcommon::add_breadcrumb( + { href => '/adm/preferences?action=changelanguages', + text => 'Change Language'}); + $r->print(Apache::loncommon::start_page('Change Language')); + $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Language')); my $user = $env{'user.name'}; my $domain = $env{'user.domain'}; my %userenv = &Apache::lonnet::get @@ -162,7 +172,7 @@ sub languagechanger {
$pref: $selectionbox ENDLSCREEN - $r->print('
'); + $r->print('
'); } @@ -177,17 +187,16 @@ sub verify_and_change_languages { if ($newlanguage) { &Apache::lonnet::put('environment',{'languages' => $newlanguage}); &Apache::lonnet::appenv({'environment.languages' => $newlanguage}); - $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Preferred language').'','"'.$newlanguage.'".')); + $message=&mt('Set new preferred languages to ').'"'.$newlanguage.'".'; } else { &Apache::lonnet::del('environment',['languages']); - &Apache::lonnet::delenv('environment.languages'); - $message=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]',''.&mt('Preferred language').'')); + &Apache::lonnet::delenv('environment\.languages'); + $message=&mt('Reset preferred language.'); } - $message=&Apache::loncommon::confirmwrapper($message); - &Apache::loncommon::flush_langs_cache($user,$domain); - $r->print(<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::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']); @@ -204,8 +218,7 @@ sub texenginechanger { 'tth' => 'tth (TeX to HTML)', #'ttm' => 'TeX to MathML', 'jsMath' => 'jsMath', - 'mimetex' => 'mimetex (Convert to Images)', - 'raw' => 'Raw (Screen Reader)' + 'mimetex' => 'mimetex (Convert to Images)' ); my $selectionbox=&Apache::loncommon::select_form($texengine,'texengine', %mathchoices); @@ -213,36 +226,20 @@ sub texenginechanger { my %lt=&Apache::lonlocal::texthash( 'headline' => 'Change Math Preferences', 'preftxt' => 'Preferred method to display Math', - 'change' => 'Save', + 'change' => 'Change', 'exmpl' => 'Examples', 'jsmath' => 'jsMath:', 'tth' => 'tth (TeX to HTML):', 'mimetex' => 'mimetex (Convert to Images):', ); - my $jsMathWarning='

' - .'

' - .&mt("It looks like you don't have the TeX math fonts installed.") - .'
' - .'
' - .&mt('The jsMath example on this page may not look right without them. ' - .'The [_1]jsMath Home Page[_2] has information on how to download the ' - .'needed fonts. In the meantime, jsMath will do the best it can ' - .'with the fonts you have, but it may not be pretty and some equations ' - .'may not be rendered correctly.' - ,'' - ,'') - .'
' - .'

'; - $r->print(<$lt{'headline'}

-$lt{'preftxt'}: $selectionbox -
- +$lt{'preftxt'}:
+$selectionbox


@@ -254,7 +251,18 @@ $lt{'exmpl'} $jsMath_start @@ -294,16 +302,18 @@ sub verify_and_change_texengine { if ($newtexengine) { &Apache::lonnet::put('environment',{'texengine' => $newtexengine}); &Apache::lonnet::appenv({'environment.texengine' => $newtexengine}); - $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Preferred method to display Math').'','"'.$newtexengine.'"')); + $message=&mt('Set new preferred math display to ').'"'.$newtexengine.'".'; } else { &Apache::lonnet::del('environment',['texengine']); - &Apache::lonnet::delenv('environment.texengine'); - $message=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]',''.&mt('Preferred method to display Math').'')); + &Apache::lonnet::delenv('environment\.texengine'); + $message=&mt('Reset preferred math display.'); } - $message=&Apache::loncommon::confirmwrapper($message); - $r->print(<print(< '/adm/preferences?action=changerolespref', + text => 'Change '.$role.' Page Pref'}); + $r->print(Apache::loncommon::start_page('Change '.$role.' Page Pref')); + $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; } @@ -356,13 +371,13 @@ sub rolesprefchanger { my $checked = ""; my $value = $recent_roles{$role_key}; if ($frozen_roles{$role_key}) { - $checked = ' checked="checked"'; + $checked = "checked=\"checked\""; } $count++; $roles_check_list .= &Apache::loncommon::start_data_table_row(). ''. - "". "". @@ -374,10 +389,10 @@ sub rolesprefchanger { $r->print('

'.&mt('Some LON-CAPA users have a long list of '.$lc_role.'s. The Recent '.$role.'s Hotlist feature keeps track of the last N '.$lc_role.'s which have been visited and places a table of these at the top of the '.$lc_role.'s page. People with very few '.$lc_role.'s should leave this feature disabled.').'

-
+
+
'.&mt('Number of '.$role.'s in Hotlist:').' +
'); } @@ -435,7 +450,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) { @@ -465,7 +480,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 .= "
".&mt('Unfreezing '.$role.': [_1]',$role_text{$role_key})."\n"; &Apache::lonhtmlcommon::store_recent('roles',$role_key,' ',0); } } @@ -473,16 +488,17 @@ sub verify_and_change_rolespref { # Freeze selected roles foreach my $role_key (@freeze_list) { if (!$frozen_roles{$role_key}) { - $message .= "
". - &Apache::lonhtmlcommon::confirm_success(&mt('Freezing '.$role.': [_1]',''.$role_text{$role_key}.'')); + $message .= "
".&mt('Freezing '.$role.': [_1]',$role_text{$role_key})."\n"; &Apache::lonhtmlcommon::store_recent('roles', $role_key,' ',1); } } - $message=&Apache::loncommon::confirmwrapper($message); - $r->print(<print(<print('

' - .&mt('Change the name that is displayed in your posts.') - .'

' - ); - $r->print('
' - .'' - .&Apache::lonhtmlcommon::start_pick_box() - .&Apache::lonhtmlcommon::row_title(&mt('New screenname (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_closure() - .&Apache::lonhtmlcommon::row_title() - .'' - .&Apache::lonhtmlcommon::row_closure(1) - .&Apache::lonhtmlcommon::end_pick_box() - .'
' - ); + my %lt = &Apache::lonlocal::texthash( + text_screenname => 'New screenname (shown if you post anonymously):', + text_nickname => 'New nickname (shown if you post non-anonymously):', + text_submit => 'Change', + ); + Apache::lonhtmlcommon::add_breadcrumb( + { href => '/adm/preferences?action=changescreenname', + text => 'Change Screen Name'}); + $r->print(Apache::loncommon::start_page('Change Screen Name')); + $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Screen Name')); + $r->print(< + +
$lt{'text_screenname'} + +
$lt{'text_nickname'} + +
+ + +ENDSCREEN } sub verify_and_change_screenname { @@ -530,11 +548,11 @@ sub verify_and_change_screenname { if ($newscreen) { &Apache::lonnet::put('environment',{'screenname' => $newscreen}); &Apache::lonnet::appenv({'environment.screenname' => $newscreen}); - $message=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Screenname').'','"'.$newscreen.'"')); + $message=&mt('Set new screenname to ').'"'.$newscreen.'.".'; } else { &Apache::lonnet::del('environment',['screenname']); - &Apache::lonnet::delenv('environment.screenname'); - $message=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]',''.&mt('Screenname').'')); + &Apache::lonnet::delenv('environment\.screenname'); + $message=&mt('Reset screenname.'); } # Nickname $message.='
'; @@ -543,17 +561,17 @@ sub verify_and_change_screenname { if ($newscreen) { &Apache::lonnet::put('environment',{'nickname' => $newscreen}); &Apache::lonnet::appenv({'environment.nickname' => $newscreen}); - $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Set [_1] to [_2]',''.&mt('Nickname').'','"'.$newscreen.'"')); + $message.=&mt('Set new nickname to ').'"'.$newscreen.'".'; } else { &Apache::lonnet::del('environment',['nickname']); - &Apache::lonnet::delenv('environment.nickname'); - $message.=&Apache::lonhtmlcommon::confirm_success(&mt('Reset [_1]',''.&mt('Nickname').'')); + &Apache::lonnet::delenv('environment\.nickname'); + $message.=&mt('Reset nickname.'); } &Apache::lonnet::devalidate_cache_new('namescache',$user.':'.$domain); - $message=&Apache::loncommon::confirmwrapper($message); - $r->print(<print(< '/adm/preferences?action=changeicons', + text => 'Change Main Menu'}); + $r->print(Apache::loncommon::start_page('Change Main Menu')); + $r->print(Apache::lonhtmlcommon::breadcrumbs('Change Main Menu')); + my $user = $env{'user.name'}; my $domain = $env{'user.domain'}; my %userenv = &Apache::lonnet::get @@ -579,7 +603,7 @@ sub iconchanger { my $useicons=&mt('Use icons and text'); my $usebuttons=&mt('Use buttons and text'); my $useicononly=&mt('Use icons only'); - my $change=&mt('Save'); + my $change=&mt('Change'); $r->print(< @@ -599,11 +623,8 @@ sub verify_and_change_icons { &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(<print(&mt('Set menu mode to [_1].',$newicons)); + print_main_menu($r, &mt('Set menu mode to [_1].',$newicons)); } ################################################################ @@ -612,6 +633,11 @@ ENDVCSCREEN sub clickerchanger { my $r = shift; + Apache::lonhtmlcommon::add_breadcrumb( + { href => '/adm/preferences?action=changeclicker', + text => 'Register Clicker'}); + $r->print(Apache::loncommon::start_page('Register Clicker')); + $r->print(Apache::lonhtmlcommon::breadcrumbs('Register Clicker')); my $user = $env{'user.name'}; my $domain = $env{'user.domain'}; my %userenv = &Apache::lonnet::get @@ -624,10 +650,9 @@ sub clickerchanger { $r->print(< -